]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/colrdlgg.cpp
Reflect changes in stc.cpp in stc.cpp.in from which it's generated.
[wxWidgets.git] / src / generic / colrdlgg.cpp
index ec97500ac8cd9942828e1278995df74e6edd61c0..60bdf6a7870c9f37939374c69edf88267b42a091 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
 // Author:      Julian Smart
 // Modified by:
 // Created:     04/01/98
-// RCS-ID:      $Id$
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 // Copyright:   (c) Julian Smart
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -16,7 +15,7 @@
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
-#if wxUSE_COLOURDLG && (!defined(__WXGTK20__) || defined(__WXUNIVERSAL__))
+#if wxUSE_COLOURDLG
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
@@ -35,6 +34,7 @@
     #include "wx/statline.h"
 #endif
 
     #include "wx/statline.h"
 #endif
 
+#include "wx/colourdata.h"
 #include "wx/generic/colrdlgg.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
 #include "wx/generic/colrdlgg.h"
 
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
@@ -58,7 +58,7 @@ END_EVENT_TABLE()
 
 // don't change the number of elements (48) in this array, the code below is
 // hardcoded to use it
 
 // don't change the number of elements (48) in this array, the code below is
 // hardcoded to use it
-static const wxChar *wxColourDialogNames[] =
+static const wxChar *const wxColourDialogNames[] =
 {
     wxT("ORANGE"),
     wxT("GOLDENROD"),
 {
     wxT("ORANGE"),
     wxT("GOLDENROD"),
@@ -140,8 +140,9 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
 
 bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
 
 bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data)
 {
-    if ( !wxDialog::Create(parent, wxID_ANY, _("Choose colour"),
-                           wxPoint(0,0), wxSize(900, 900)) )
+    if ( !wxDialog::Create(GetParentForModalDialog(parent, 0), wxID_ANY,
+                           _("Choose colour"),
+                           wxPoint(0, 0), wxSize(900, 900)) )
         return false;
 
     if (data)
         return false;
 
     if (data)
@@ -198,14 +199,8 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event)
       event.Skip();
 }
 
       event.Skip();
 }
 
-void wxGenericColourDialog::OnPaint(wxPaintEvent& event)
+void wxGenericColourDialog::OnPaint(wxPaintEvent& WXUNUSED(event))
 {
 {
-#if !defined(__WXMOTIF__) && !defined(__WXPM__) && !defined(__WXCOCOA__)
-    wxDialog::OnPaint(event);
-#else
-    wxUnusedVar(event);
-#endif
-
     wxPaintDC dc(this);
 
     PaintBasicColours(dc);
     wxPaintDC dc(this);
 
     PaintBasicColours(dc);
@@ -313,7 +308,7 @@ void wxGenericColourDialog::InitializeColours(void)
     for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++)
     {
         wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]);
     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);
             m_standardColours[i].Set(col.Red(), col.Green(), col.Blue());
         else
             m_standardColours[i].Set(0, 0, 0);
@@ -322,14 +317,14 @@ void wxGenericColourDialog::InitializeColours(void)
     for (i = 0; i < WXSIZEOF(m_customColours); i++)
     {
         wxColour c = m_colourData.GetCustomColour(i);
     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();
             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;
 
     {
         bool m_initColourFound = false;
 
@@ -379,7 +374,7 @@ void wxGenericColourDialog::PaintBasicColours(wxDC& dc)
             int y = (i*(m_smallRectangleSize.y+m_gridSpacing) + m_standardColoursRect.y);
 
             dc.SetPen(*wxBLACK_PEN);
             int y = (i*(m_smallRectangleSize.y+m_gridSpacing) + m_standardColoursRect.y);
 
             dc.SetPen(*wxBLACK_PEN);
-            wxBrush brush(m_standardColours[ptr], wxSOLID);
+            wxBrush brush(m_standardColours[ptr]);
             dc.SetBrush(brush);
 
             dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
             dc.SetBrush(brush);
 
             dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
@@ -402,7 +397,7 @@ void wxGenericColourDialog::PaintCustomColours(wxDC& dc)
 
       dc.SetPen(*wxBLACK_PEN);
 
 
       dc.SetPen(*wxBLACK_PEN);
 
-      wxBrush brush(m_customColours[ptr], wxSOLID);
+      wxBrush brush(m_customColours[ptr]);
       dc.SetBrush(brush);
 
       dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
       dc.SetBrush(brush);
 
       dc.DrawRectangle( x, y, m_smallRectangleSize.x, m_smallRectangleSize.y);
@@ -460,7 +455,7 @@ void wxGenericColourDialog::PaintCustomColour(wxDC& dc)
 {
     dc.SetPen(*wxBLACK_PEN);
 
 {
     dc.SetPen(*wxBLACK_PEN);
 
-    wxBrush *brush = new wxBrush(m_colourData.m_dataColour, wxSOLID);
+    wxBrush *brush = new wxBrush(m_colourData.m_dataColour);
     dc.SetBrush(*brush);
 
     dc.DrawRectangle( m_singleCustomColourRect.x, m_singleCustomColourRect.y,
     dc.SetBrush(*brush);
 
     dc.DrawRectangle( m_singleCustomColourRect.x, m_singleCustomColourRect.y,
@@ -580,4 +575,4 @@ void wxGenericColourDialog::OnBlueSlider(wxCommandEvent& WXUNUSED(event))
 
 #endif // wxUSE_SLIDER
 
 
 #endif // wxUSE_SLIDER
 
-#endif // wxUSE_COLOURDLG && !defined(__WXGTK20__)
+#endif // wxUSE_COLOURDLG