X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d2f5093319b09251870da78e5578eec55942a531..967a322fe965bd511d0d45cec336047c36ea39b9:/src/common/utilscmn.cpp diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 9af79de329..5a685ccc75 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -59,6 +59,10 @@ #endif #endif +#if wxUSE_GUI + #include "wx/colordlg.h" +#endif // wxUSE_GUI + #include #ifndef __MWERKS__ @@ -908,6 +912,30 @@ wxString wxGetPasswordFromUser(const wxString& message, #endif // wxUSE_TEXTDLG +wxColour wxGetColourFromUser(wxWindow *parent, const wxColour& colInit) +{ + wxColourData data; + data.SetChooseFull(TRUE); + if ( colInit.Ok() ) + { + data.SetColour((wxColour &)colInit); // const_cast + } + + wxColour colRet; + wxColourDialog dialog(parent, &data); + if ( dialog.ShowModal() == wxID_OK ) + { + colRet = dialog.GetColourData().GetColour(); + } + //else: leave it invalid + + return colRet; +} + +// ---------------------------------------------------------------------------- +// missing C RTL functions (FIXME shouldn't be here at all) +// ---------------------------------------------------------------------------- + #ifdef __MWERKS__ char *strdup(const char *s) {