]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/colrdlgg.cpp
1. some more tests in console
[wxWidgets.git] / src / generic / colrdlgg.cpp
index 4049e421fe53cdee0290e76fec8b989666d45d9f..d452a8373a14ce873f1f7e24254916ebee8c9975 100644 (file)
@@ -121,8 +121,8 @@ wxGenericColourDialog::wxGenericColourDialog()
   colourSelection = 0;
 }
 
-wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent, wxColourData *data):
-  wxDialog(parent, -1, wxT("Colour"), wxPoint(0, 0), wxSize(900, 900), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
+wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent,
+                                             wxColourData *data)
 {
   whichKind = 1;
   colourSelection = 0;
@@ -140,16 +140,21 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 
 bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
-  dialogParent = parent;
+    if ( !wxDialog::Create(parent, -1, wxT("Colour"),
+                           wxPoint(0, 0), wxSize(900, 900),
+                           wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) )
+        return FALSE;
 
-  if (data)
-    colourData = *data;
+    dialogParent = parent;
 
-  InitializeColours();
-  CalculateMeasurements();
-  CreateWidgets();
+    if (data)
+        colourData = *data;
 
-  return TRUE;
+    InitializeColours();
+    CalculateMeasurements();
+    CreateWidgets();
+
+    return TRUE;
 }
 
 int wxGenericColourDialog::ShowModal()
@@ -187,7 +192,7 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event)
 
 void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
 {
-#ifndef __WXMOTIF__
+#if !defined(__WXMOTIF__) && !defined(__WXMAC__)
   wxDialog::OnPaint(event);
 #endif
 
@@ -289,11 +294,6 @@ void wxGenericColourDialog::InitializeColours(void)
 
   for (i = 0; i < 16; i++)
     customColours[i] =
-/*
-#ifndef __VMS__
-     (wxColour&)
-#endif
-*/
        colourData.GetCustomColour(i);
 
   singleCustomColour.Set(0, 0, 0);