X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bfbb0b4c77cd55b5d3073ce3392fa4b2fdc39a50..61a028dc4af537da90fd52935a75afc9056ecd09:/src/msw/tglbtn.cpp diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index eb3ba7f2f3..e3e986fe8c 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -2,17 +2,17 @@ // Name: src/msw/tglbtn.cpp // Purpose: Definition of the wxToggleButton class, which implements a // toggle button under wxMSW. -// Author: John Norris, minor changes by Axel Schlueter -// and William Gallafent. +// Author: John Norris, minor changes by Axel Schlueter +// and William Gallafent. // Modified by: // Created: 08.02.01 // RCS-ID: $Id$ // Copyright: (c) 2000 Johnny C. Norris II -// License: Rocketeer license +// License: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ -// declatations +// declarations // ============================================================================ // ---------------------------------------------------------------------------- @@ -25,10 +25,10 @@ #pragma hdrstop #endif -#include "wx/tglbtn.h" - #if wxUSE_TOGGLEBTN +#include "wx/tglbtn.h" + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/brush.h" @@ -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()); @@ -135,6 +135,7 @@ wxSize wxToggleButton::DoGetBestSize() const wxSize sz(wBtn, hBtn); #endif + CacheBestSize(sz); return sz; } @@ -163,4 +164,3 @@ void wxToggleButton::Command(wxCommandEvent & event) } #endif // wxUSE_TOGGLEBTN -