X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11b6a93b1e078fea5bf49ed9e6628a19849c11b3..2035e10e83324c6925d12725b842768f6e2b00a2:/src/msw/checkbox.cpp?ds=inline diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index 3e8f804185..a92fc1b2d6 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -79,9 +79,14 @@ bool wxCheckBox::Create(wxWindow *parent, 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(); @@ -111,7 +116,7 @@ bool wxCheckBox::Create(wxWindow *parent, 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, @@ -140,24 +145,26 @@ void wxCheckBox::SetLabel(const wxString& label) 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);