// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "colrdlgg.h"
#endif
#pragma hdrstop
#endif
-#if wxUSE_COLOURDLG
+#if wxUSE_COLOURDLG && !defined(__WXGTK20__)
#ifndef WX_PRECOMP
#include "wx/utils.h"
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;
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();
}
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;
}
}
PaintCustomColour(dc);
}
-#endif // wxUSE_COLOURDLG
+#endif // wxUSE_COLOURDLG && !defined(__WXGTK20__)