]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/clrpickerg.cpp
fixing PPI bugs in printer dcs and print preview
[wxWidgets.git] / src / generic / clrpickerg.cpp
index c6fc40bb4bf835014c5d00d8b67020659cf8b204..497bfa0a017e38cf74f9026be5d5f61bdef93d4d 100644 (file)
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-    #include "wx/window.h"
-#endif //WX_PRECOMP
+#if wxUSE_COLOURPICKERCTRL
 
 #include "wx/clrpicker.h"
+
 #include "wx/colordlg.h"
 
 
@@ -36,8 +35,6 @@
 // implementation
 // ============================================================================
 
-#if wxUSE_COLOURPICKERCTRL
-
 wxColourData wxGenericColourButton::ms_data;
 IMPLEMENT_DYNAMIC_CLASS(wxGenericColourButton, wxButton)
 
@@ -73,10 +70,11 @@ bool wxGenericColourButton::Create( wxWindow *parent, wxWindowID id,
 void wxGenericColourButton::InitColourData()
 {
     ms_data.SetChooseFull(true);
-    for (int i = 0; i < 16; i++)
+    unsigned char grey = 0;
+    for (int i = 0; i < 16; i++, grey += 16)
     {
         // fill with grey tones the custom colors palette
-        wxColour colour(i*16, i*16, i*16);
+        wxColour colour(grey, grey, grey);
         ms_data.SetCustomColour(i, colour);
     }
 }