]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/utilscmn.cpp
more long/double to int conversion warnings from HP-UX logs fixed
[wxWidgets.git] / src / common / utilscmn.cpp
index 9af79de3296495dc1990c7d8bfc6467896988ebd..5a685ccc754f50eb7f42318c072f493ea31c96ed 100644 (file)
     #endif
 #endif
 
+#if wxUSE_GUI
+    #include "wx/colordlg.h"
+#endif // wxUSE_GUI
+
 #include <time.h>
 
 #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)
 {