X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1f9d7bf624dcdf8eccd33d7ea5320e6f851139b..6bba4b8a1391e3db2a289bba00c9673cea306a87:/src/generic/colrdlgg.cpp diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index 952a1ebddd..83cae5f72b 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -5,11 +5,11 @@ // Modified by: // Created: 04/01/98 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows license +// Copyright: (c) Julian Smart +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "colrdlgg.h" #endif @@ -20,7 +20,7 @@ #pragma hdrstop #endif -#if wxUSE_COLOURDLG +#if wxUSE_COLOURDLG && !defined(__WXGTK20__) #ifndef WX_PRECOMP #include "wx/utils.h" @@ -143,9 +143,8 @@ void wxGenericColourDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) bool wxGenericColourDialog::Create(wxWindow *parent, wxColourData *data) { - if ( !wxDialog::Create(parent, -1, wxT("Colour"), - wxPoint(0, 0), wxSize(900, 900), - wxDEFAULT_DIALOG_STYLE | wxDIALOG_MODAL) ) + if ( !wxDialog::Create(parent, -1, _("Choose colour"), + wxPoint(0, 0), wxSize(900, 900)) ) return FALSE; dialogParent = parent; @@ -206,7 +205,7 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event) void wxGenericColourDialog::OnPaint(wxPaintEvent& event) { -#if !defined(__WXMOTIF__) && !defined(__WXMAC__) && !defined(__WXPM__) +#if !defined(__WXMOTIF__) && !defined(__WXMAC__) && !defined(__WXPM__) && !defined(__WXCOCOA__) wxDialog::OnPaint(event); #endif @@ -304,16 +303,20 @@ void wxGenericColourDialog::InitializeColours(void) for (i = 0; i < WXSIZEOF(wxColourDialogNames); i++) { - wxColour *col = wxTheColourDatabase->FindColour(wxColourDialogNames[i]); - if (col) - standardColours[i].Set(col->Red(), col->Green(), col->Blue()); + wxColour col = wxTheColourDatabase->Find(wxColourDialogNames[i]); + if (col.Ok()) + standardColours[i].Set(col.Red(), col.Green(), col.Blue()); else standardColours[i].Set(0, 0, 0); } - for (i = 0; i < 16; i++) + for (i = 0; i < WXSIZEOF(customColours); i++) { - customColours[i] = colourData.GetCustomColour(i); + wxColour c = colourData.GetCustomColour(i); + if (c.Ok()) + customColours[i] = colourData.GetCustomColour(i); + else + customColours[i] = wxColour(255, 255, 255); } wxColour curr = colourData.GetColour(); @@ -333,13 +336,12 @@ void wxGenericColourDialog::InitializeColours(void) } if ( !initColourFound ) { - for ( i = 0; i < 16; i++ ) + for ( i = 0; i < WXSIZEOF(customColours); i++ ) { if ( customColours[i] == curr ) { whichKind = 2; colourSelection = i; - initColourFound = TRUE; break; } } @@ -566,5 +568,5 @@ void wxGenericColourDialog::OnBlueSlider(wxCommandEvent& WXUNUSED(event)) PaintCustomColour(dc); } -#endif // wxUSE_COLOURDLG +#endif // wxUSE_COLOURDLG && !defined(__WXGTK20__)