#pragma hdrstop
#endif
-#ifndef WX_PRECOMP
- #include "wx/window.h"
-#endif //WX_PRECOMP
+#if wxUSE_COLOURPICKERCTRL
#include "wx/clrpicker.h"
+
#include "wx/colordlg.h"
// implementation
// ============================================================================
-#if wxUSE_COLOURPICKERCTRL
-
wxColourData wxGenericColourButton::ms_data;
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourButton, wxButton)
SetLabel(m_colour.GetAsString(wxC2S_HTML_SYNTAX));
}
+wxSize wxGenericColourButton::DoGetBestSize() const
+{
+ wxSize sz(wxButton::DoGetBestSize());
+ if ( HasFlag(wxCLRP_SHOW_LABEL) )
+ return sz;
+
+ // if we have no label, then make this button a square
+ // (like e.g. native GTK version of this control)
+ sz.SetWidth(sz.GetHeight());
+ return sz;
+}
+
#endif // wxUSE_COLOURPICKERCTRL