X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61e6a2ab5e3e1de051c3db492219627c368141f1..ccdc11bbaf0310a474ad7b9d41413b31c3544356:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index e707738396..ad0fbede21 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/button.cpp +// Name: src/msw/button.cpp // Purpose: wxButton // Author: Julian Smart // Modified by: @@ -26,9 +26,10 @@ #if wxUSE_BUTTON +#include "wx/button.h" + #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/button.h" #include "wx/brush.h" #include "wx/panel.h" #include "wx/bmpbuttn.h" @@ -132,16 +133,16 @@ bool wxButton::Create(wxWindow *parent, { // On Windows, some buttons aren't supposed to have // mnemonics, so strip them out. - - label = wxGetStockLabel(id + + label = wxGetStockLabel(id #if defined(__WXMSW__) || defined(__WXWINCE__) , ( id != wxID_OK && id != wxID_CANCEL && id != wxID_CLOSE ) #endif ); - } - + } + if ( !CreateControl(parent, id, pos, size, style, validator, name) ) return false; @@ -218,7 +219,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(); @@ -729,4 +730,3 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) #endif // __WIN32__ #endif // wxUSE_BUTTON -