X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f25981069f0409ec17d3ff946870b99f918b717..4ff53d1b7a714df97b2b4e584c67c69037fc47b8:/src/msw/checkbox.cpp diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index 1734a9b214..32cfc4e50e 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "checkbox.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -218,7 +214,7 @@ wxSize wxCheckBox::DoGetBestSize() const int wCheckbox, hCheckbox; if ( !str.IsEmpty() ) { - GetTextExtent(str, &wCheckbox, &hCheckbox); + GetTextExtent(wxStripMenuCodes(str), &wCheckbox, &hCheckbox); wCheckbox += s_checkSize + GetCharWidth(); if ( hCheckbox < s_checkSize ) @@ -374,6 +370,12 @@ void wxCheckBox::MakeOwnerDrawn(bool ownerDrawn) } ::SetWindowLong(GetHwnd(), GWL_STYLE, style); + + if ( !ownerDrawn ) + { + // ensure that controls state is consistent with internal state + DoSet3StateValue(m_state); + } } void wxCheckBox::OnMouseEnterOrLeave(wxMouseEvent& event) @@ -451,7 +453,8 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) // to it without breaking backwards compatibility // classic Win32 version -- this can be useful when we move this into -#if 0 + // wxRendererNative +#if defined(__WXWINCE__) || !wxUSE_UXTHEME UINT state = DFCS_BUTTONCHECK; if ( !IsEnabled() ) state |= DFCS_INACTIVE;