From: Francesco Montorsi Date: Sat, 9 May 2009 12:40:09 +0000 (+0000) Subject: add new predefined colour (and relative brush/pen): wxYELLOW (closes #10669) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8602802568e2dcd29298c0d802d7c44fd231845b add new predefined colour (and relative brush/pen): wxYELLOW (closes #10669) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 9072ef7230..2d8685e25f 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -760,6 +760,7 @@ public: BRUSH_BLUE, BRUSH_CYAN, BRUSH_GREEN, + BRUSH_YELLOW, BRUSH_GREY, BRUSH_LIGHTGREY, BRUSH_MEDIUMGREY, @@ -770,6 +771,7 @@ public: COLOUR_BLUE, COLOUR_CYAN, COLOUR_GREEN, + COLOUR_YELLOW, COLOUR_LIGHTGREY, COLOUR_RED, COLOUR_WHITE, @@ -785,6 +787,7 @@ public: PEN_BLUE, PEN_CYAN, PEN_GREEN, + PEN_YELLOW, PEN_GREY, PEN_LIGHTGREY, PEN_MEDIUMGREY, @@ -825,6 +828,7 @@ protected: #define wxBLUE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLUE) #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN) #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN) +#define wxYELLOW_PEN wxStockGDI::GetPen(wxStockGDI::PEN_YELLOW) #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY) #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY) #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY) @@ -836,6 +840,7 @@ protected: #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE) #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN) #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN) +#define wxYELLOW_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_YELLOW) #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY) #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY) #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY) @@ -847,6 +852,7 @@ protected: #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE) #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN) #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN) +#define wxYELLOW wxStockGDI::GetColour(wxStockGDI::COLOUR_YELLOW) #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY) #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED) #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE) diff --git a/interface/wx/brush.h b/interface/wx/brush.h index 7af8e2f533..945f1d7487 100644 --- a/interface/wx/brush.h +++ b/interface/wx/brush.h @@ -89,6 +89,7 @@ enum wxBrushStyle @li ::wxBLUE_BRUSH @li ::wxCYAN_BRUSH @li ::wxGREEN_BRUSH + @li ::wxYELLOW_BRUSH @li ::wxGREY_BRUSH @li ::wxLIGHT_GREY_BRUSH @li ::wxMEDIUM_GREY_BRUSH @@ -244,6 +245,13 @@ wxBrush* wxBLUE_BRUSH; */ wxBrush* wxGREEN_BRUSH; +/** + Yellow brush. + Except for the color it has all standard attributes + (@c wxBRUSHSTYLE_SOLID, no stipple bitmap, etc...). +*/ +wxBrush* wxYELLOW_BRUSH; + /** White brush. Except for the color it has all standard attributes diff --git a/interface/wx/colour.h b/interface/wx/colour.h index 2a2193d9ff..36cbfb025b 100644 --- a/interface/wx/colour.h +++ b/interface/wx/colour.h @@ -41,6 +41,7 @@ - ::wxBLUE - ::wxCYAN - ::wxGREEN + - ::wxYELLOW - ::wxLIGHT_GREY - ::wxRED - ::wxWHITE @@ -186,6 +187,7 @@ wxColour* wxBLACK; wxColour* wxBLUE; wxColour* wxCYAN; wxColour* wxGREEN; +wxColour* wxYELLOW; wxColour* wxLIGHT_GREY; wxColour* wxRED; wxColour* wxWHITE; diff --git a/interface/wx/pen.h b/interface/wx/pen.h index 0b617945d8..e5128cc519 100644 --- a/interface/wx/pen.h +++ b/interface/wx/pen.h @@ -134,6 +134,7 @@ enum wxPenCap @li ::wxBLUE_PEN @li ::wxCYAN_PEN @li ::wxGREEN_PEN + @li ::wxYELLOW_PEN @li ::wxGREY_PEN @li ::wxLIGHT_GREY_PEN @li ::wxMEDIUM_GREY_PEN @@ -389,6 +390,13 @@ wxPen* wxCYAN_PEN; */ wxPen* wxGREEN_PEN; +/** + Yellow pen. + Except for the color it has all standard attributes + (1-pixel width, @c wxPENSTYLE_SOLID and @c wxCAP_ROUND styles, etc...). +*/ +wxPen* wxYELLOW_PEN; + /** Black pen. Except for the color it has all standard attributes diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 0e4629e22a..48a1106ce0 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -1092,7 +1092,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) (*m_multitext) << _T(" Appended."); m_multitext->SetInsertionPoint(0); m_multitext->WriteText( _T("Prepended. ") ); - m_multitext->SetForegroundColour(*wxRED); + m_multitext->SetForegroundColour(*wxYELLOW); m_multitext->SetBackgroundColour(*wxLIGHT_GREY); #if wxUSE_TOOLTIPS diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 2d123c899f..3685bb54c6 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -545,6 +545,9 @@ const wxBrush* wxStockGDI::GetBrush(Item item) case BRUSH_GREEN: brush = new wxBrush(*GetColour(COLOUR_GREEN), wxBRUSHSTYLE_SOLID); break; + case BRUSH_YELLOW: + brush = new wxBrush(*GetColour(COLOUR_YELLOW), wxBRUSHSTYLE_SOLID); + break; case BRUSH_GREY: brush = new wxBrush(wxColour(wxT("GREY")), wxBRUSHSTYLE_SOLID); break; @@ -590,6 +593,9 @@ const wxColour* wxStockGDI::GetColour(Item item) case COLOUR_GREEN: colour = new wxColour(0, 255, 0); break; + case COLOUR_YELLOW: + colour = new wxColour(255, 255, 0); + break; case COLOUR_LIGHTGREY: colour = new wxColour(wxT("LIGHT GREY")); break; @@ -680,6 +686,9 @@ const wxPen* wxStockGDI::GetPen(Item item) case PEN_GREEN: pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxPENSTYLE_SOLID); break; + case PEN_YELLOW: + pen = new wxPen(*GetColour(COLOUR_YELLOW), 1, wxPENSTYLE_SOLID); + break; case PEN_GREY: pen = new wxPen(wxColour(wxT("GREY")), 1, wxPENSTYLE_SOLID); break;