diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 1ae5bb425e..40dfa1677d 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -82,17 +82,21 @@ bool wxButton::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { - wxString label(lbl); - if (label.empty() && wxIsStockID(id)) + wxString label; + if ( !(style & wxBU_NOTEXT) ) { - // On Windows, some buttons aren't supposed to have mnemonics - label = wxGetStockLabel - ( - id, - id == wxID_OK || id == wxID_CANCEL || id == wxID_CLOSE - ? wxSTOCK_NOFLAGS - : wxSTOCK_WITH_MNEMONIC - ); + label = lbl; + if (label.empty() && wxIsStockID(id)) + { + // On Windows, some buttons aren't supposed to have mnemonics + label = wxGetStockLabel + ( + id, + id == wxID_OK || id == wxID_CANCEL || id == wxID_CLOSE + ? wxSTOCK_NOFLAGS + : wxSTOCK_WITH_MNEMONIC + ); + } } if ( !CreateControl(parent, id, pos, size, style, validator, name) ) diff --git a/src/osx/button_osx.cpp b/src/osx/button_osx.cpp index 4ca954edeb..8895171565 100644 --- a/src/osx/button_osx.cpp +++ b/src/osx/button_osx.cpp @@ -69,12 +69,15 @@ bool wxButton::Create(wxWindow *parent, wxString label; - // Ignore the standard label for help buttons if possible, they use "?" - // label under Mac which looks better. - if ( !IsHelpButtonWithStandardLabel(id, labelOrig) ) + if ( !(style & wxBU_NOTEXT) ) { - label = labelOrig.empty() && wxIsStockID(id) ? wxGetStockLabel(id) - : labelOrig; + // Ignore the standard label for help buttons if possible, they use "?" + // label under Mac which looks better. + if ( !IsHelpButtonWithStandardLabel(id, labelOrig) ) + { + label = labelOrig.empty() && wxIsStockID(id) ? wxGetStockLabel(id) + : labelOrig; + } }