]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/colrdlgg.cpp
Ensure there is valid context for DrawRectangle
[wxWidgets.git] / src / generic / colrdlgg.cpp
index 03c93c5e8bb3465b0c6f230affd2d4a3441a834b..49e4bb6a45c5aea8d6ee25b6e8c875c8fd62462e 100644 (file)
@@ -35,6 +35,7 @@
     #include "wx/statline.h"
 #endif
 
+#include "wx/colourdata.h"
 #include "wx/generic/colrdlgg.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
@@ -140,7 +141,7 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 
 bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
-    if ( !wxDialog::Create(GetParentForModalDialog(parent), wxID_ANY,
+    if ( !wxDialog::Create(GetParentForModalDialog(parent, 0), wxID_ANY,
                            _("Choose colour"),
                            wxPoint(0, 0), wxSize(900, 900)) )
         return false;
@@ -199,14 +200,8 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event)
       event.Skip();
 }
 
-void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
+void wxGenericColourDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
-#if !defined(__WXMOTIF__) && !defined(__WXPM__) && !defined(__WXCOCOA__) && !defined(__WXOSX__)
-    wxDialog::OnPaint(event);
-#else
-    wxUnusedVar(event);
-#endif
-
     wxPaintDC dc(this);
 
     PaintBasicColours(dc);
@@ -314,7 +309,7 @@ void wxGenericColourDialog::InitializeColours(void)
     for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
     {
         wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]);
-        if (col.Ok())
+        if (col.IsOk())
             m_standardColours[i].Set(col.Red(), col.Green(), col.Blue());
         else
             m_standardColours[i].Set(0, 0, 0);
@@ -323,14 +318,14 @@ void wxGenericColourDialog::InitializeColours(void)
     for (i = 0; i < WXSIZEOF(m_customColours); i++)
     {
         wxColour c = m_colourData.GetCustomColour(i);
-        if (c.Ok())
+        if (c.IsOk())
             m_customColours[i] = m_colourData.GetCustomColour(i);
         else
             m_customColours[i] = wxColour(255, 255, 255);
     }
 
     wxColour curr = m_colourData.GetColour();
-    if ( curr.Ok() )
+    if ( curr.IsOk() )
     {
         bool m_initColourFound = false;