diff --git a/docs/latex/wx/xmlresh.tex b/docs/latex/wx/xmlresh.tex index 3c57936906..08671ff6a5 100644 --- a/docs/latex/wx/xmlresh.tex +++ b/docs/latex/wx/xmlresh.tex @@ -108,7 +108,7 @@ Gets a bool flag (1, t, yes, on, true are true, everything else is false). \membersection{wxXmlResourceHandler::GetColour}\label{wxxmlresourcehandlergetcolour} -\func{wxColour}{GetColour}{\param{const wxString\& }{param}} +\func{wxColour}{GetColour}{\param{const wxString\& }{param}, \param{const wxColour\& }{default = wxNullColour}} Gets colour in HTML syntax (\#RRGGBB). diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index a7ac1bdcd8..e6ea2bee4d 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -415,7 +415,7 @@ protected: float GetFloat(const wxString& param, float defaultv = 0); // Gets colour in HTML syntax (#RRGGBB). - wxColour GetColour(const wxString& param); + wxColour GetColour(const wxString& param, const wxColour& defaultv = wxNullColour); // Gets the size (may be in dialog units). wxSize GetSize(const wxString& param = wxT("size"), diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 8743a5c135..96a7cd6b5a 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1042,9 +1042,13 @@ static wxColour GetSystemColour(const wxString& name) return wxNullColour; } -wxColour wxXmlResourceHandler::GetColour(const wxString& param) +wxColour wxXmlResourceHandler::GetColour(const wxString& param, const wxColour& defaultv) { wxString v = GetParamValue(param); + + if ( v.empty() ) + return defaultv; + wxColour clr; // wxString -> wxColour conversion