]> git.saurik.com Git - wxWidgets.git/commitdiff
Must strip menu codes from labels before measuring (fixes bug 1400552)
authorJulian Smart <julian@anthemion.co.uk>
Wed, 18 Jan 2006 16:16:36 +0000 (16:16 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 18 Jan 2006 16:16:36 +0000 (16:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/button.cpp
src/msw/checkbox.cpp
src/msw/radiobox.cpp
src/msw/radiobut.cpp
src/msw/statbox.cpp
src/msw/tglbtn.cpp

index e7077383965ff1e6d2b5cc6cedc53949cfd8e2e5..6b6f67aa651b4d7350a33a91949ee7df7ba7cafa 100644 (file)
@@ -218,7 +218,7 @@ wxSize wxButton::DoGetBestSize() const
 
     wxCoord wBtn,
             hBtn;
-    dc.GetMultiLineTextExtent(GetLabel(), &wBtn, &hBtn);
+    dc.GetMultiLineTextExtent(wxStripMenuCodes(GetLabel()), &wBtn, &hBtn);
 
     // add a margin -- the button is wider than just its label
     wBtn += 3*GetCharWidth();
index cd9dd38df8b3385a730953902ac946c0d6b9419e..32cfc4e50ee82e1e7026fba26ceb99d76ab4d993 100644 (file)
@@ -214,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 )
index 0fba4670c06ff6c1d9d1d987d5ff0dc938074277..795df4f865c8cb646e71783fcfd032f2a8e714c6 100644 (file)
@@ -478,7 +478,7 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const
 
     // and also wide enough for its label
     int widthLabel;
-    GetTextExtent(GetLabel(), &widthLabel, NULL);
+    GetTextExtent(wxStripMenuCodes(GetLabel()), &widthLabel, NULL);
     widthLabel += RADIO_SIZE; // FIXME this is bogus too
     if ( widthLabel > width )
         width = widthLabel;
index e41f4cc7c025a4741828a03ddabbc5411b601b45..42bbdc43e558bbcaa6cced7eeb8ca2fa4f6b52fa 100644 (file)
@@ -296,7 +296,7 @@ wxSize wxRadioButton::DoGetBestSize() const
     int wRadio, hRadio;
     if ( !str.empty() )
     {
-        GetTextExtent(str, &wRadio, &hRadio);
+        GetTextExtent(wxStripMenuCodes(str), &wRadio, &hRadio);
         wRadio += s_radioSize + GetCharWidth();
 
         if ( hRadio < s_radioSize )
index 829976e363bcef1dfe78cb039a7ddd76b6dedfbd..07b6e67c9fa4e35c66285dbb7c006ce34a10a1b2 100644 (file)
@@ -160,7 +160,7 @@ wxSize wxStaticBox::DoGetBestSize() const
     wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
 
     int wBox;
-    GetTextExtent(wxGetWindowText(m_hWnd), &wBox, &cy);
+    GetTextExtent(wxStripMenuCodes(wxGetWindowText(m_hWnd)), &wBox, &cy);
 
     wBox += 3*cx;
     int hBox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy);
index 55368ab31c653684c5c48756a5e33cbe04d7239f..d9c7fd124549d8f3b4281f420d66e8dc3ed17ef5 100644 (file)
@@ -114,7 +114,7 @@ wxSize wxToggleButton::DoGetBestSize() const
 {
    wxString label = wxGetWindowText(GetHWND());
    int wBtn;
-   GetTextExtent(label, &wBtn, NULL);
+   GetTextExtent(wxStripMenuCodes(label), &wBtn, NULL);
 
    int wChar, hChar;
    wxGetCharSize(GetHWND(), &wChar, &hChar, GetFont());