]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/colrdlgg.cpp
Added chapter on collection and container classes to contents
[wxWidgets.git] / src / generic / colrdlgg.cpp
index 23026756ef188f0ab5d4eabbd545e8c5bd21b90f..e4b06443bbb4b448fc8356fe8209051de3d0b6cb 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "wx/generic/colrdlgg.h"
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
 
 BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
@@ -54,7 +53,6 @@ BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
     EVT_CLOSE(wxGenericColourDialog::OnCloseWindow)
 END_EVENT_TABLE()
 
-#endif
 
 /*
  * Generic wxColourDialog
@@ -123,8 +121,8 @@ wxGenericColourDialog::wxGenericColourDialog()
   colourSelection = 0;
 }
 
-wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent, wxColourData *data):
-  wxDialog(parent, -1, "Colour", wxPoint(0, 0), wxSize(900, 900), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
+wxGenericColourDialog::wxGenericColourDialog(wxWindow *parent,
+                                             wxColourData *data)
 {
   whichKind = 1;
   colourSelection = 0;
@@ -142,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;
+
+    dialogParent = parent;
 
-  if (data)
-    colourData = *data;
+    if (data)
+        colourData = *data;
 
-  InitializeColours();
-  CalculateMeasurements();
-  CreateWidgets();
+    InitializeColours();
+    CalculateMeasurements();
+    CreateWidgets();
 
-  return TRUE;
+    return TRUE;
 }
 
 int wxGenericColourDialog::ShowModal()
@@ -189,7 +192,7 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event)
 
 void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
 {
-#ifndef __WXMOTIF__
+#if !defined(__WXMOTIF__) && !defined(__WXMAC__)
   wxDialog::OnPaint(event);
 #endif