// macros
// ----------------------------------------------------------------------------
- IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
- IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
+IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
// ============================================================================
// implementation
}
// Single check box item
-bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
- const wxPoint& pos,
- const wxSize& size, long style,
- const wxValidator& validator,
- const wxString& name)
+bool wxCheckBox::Create(wxWindow *parent,
+ wxWindowID id,
+ const wxString& label,
+ const wxPoint& pos,
+ const wxSize& size, long style,
+ const wxValidator& validator,
+ const wxString& name)
{
SetName(name);
+#if wxUSE_VALIDATORS
SetValidator(validator);
+#endif // wxUSE_VALIDATORS
if (parent) parent->AddChild(this);
SetBackgroundColour(parent->GetBackgroundColour()) ;
m_windowStyle = style;
+ // VZ: disabling this ugliness which completely breaks checkboxes in wxGrid
+ // whoever did it, please tell me where and how does the checkbox fail
+ // to appear
+#if 0
wxString Label = label;
if (Label == wxT(""))
Label = wxT(" "); // Apparently needed or checkbox won't show
+#endif // 0
if ( id == -1 )
m_windowId = NewControlId();
msStyle |= WS_BORDER;
*/
- m_hWnd = (WXHWND)CreateWindowEx(exStyle, wxT("BUTTON"), Label,
+ m_hWnd = (WXHWND)CreateWindowEx(exStyle, wxT("BUTTON"), label,
msStyle,
0, 0, 0, 0,
(HWND)parent->GetHWND(), (HMENU)m_windowId,
SetWindowText(GetHwnd(), label);
}
+#define CHECK_SIZE 13
+
wxSize wxCheckBox::DoGetBestSize() const
{
int wCheckbox, hCheckbox;
- wxString str = wxGetWindowText(GetHWND());
+ wxString str = wxGetWindowText(GetHWND()) + " ";
if ( !str.IsEmpty() )
{
GetTextExtent(str, &wCheckbox, &hCheckbox);
- wCheckbox += RADIO_SIZE;
+ wCheckbox += CHECK_SIZE;
- if ( hCheckbox < RADIO_SIZE )
- hCheckbox = RADIO_SIZE;
+ if ( hCheckbox < CHECK_SIZE )
+ hCheckbox = CHECK_SIZE;
}
else
{
- wCheckbox = RADIO_SIZE;
- hCheckbox = RADIO_SIZE;
+ wCheckbox = CHECK_SIZE;
+ hCheckbox = CHECK_SIZE;
}
return wxSize(wCheckbox, hCheckbox);
const wxString& name)
{
SetName(name);
+#if wxUSE_VALIDATORS
SetValidator(validator);
+#endif // wxUSE_VALIDATORS
if (parent) parent->AddChild(this);
SetBackgroundColour(parent->GetBackgroundColour()) ;