From: Vadim Zeitlin Date: Fri, 19 Jun 2009 23:24:51 +0000 (+0000) Subject: respect wxBU_NOTEXT style in wxButton X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/85284ca4b226d9a1ab6bed26c5eaa480543649d5 respect wxBU_NOTEXT style in wxButton git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/button.h b/include/wx/osx/button.h index 6c599dfaaa..8a1a8e06e6 100644 --- a/include/wx/osx/button.h +++ b/include/wx/osx/button.h @@ -45,6 +45,7 @@ public: static wxSize GetDefaultSize(); + virtual void SetLabel(const wxString& label); virtual wxWindow *SetDefault(); virtual void Command(wxCommandEvent& event); diff --git a/src/osx/button_osx.cpp b/src/osx/button_osx.cpp index 6428e4842a..a7c7cf869c 100644 --- a/src/osx/button_osx.cpp +++ b/src/osx/button_osx.cpp @@ -43,7 +43,8 @@ bool wxButton::Create(wxWindow *parent, if ( !wxButtonBase::Create(parent, id, pos, size, style, validator, name) ) return false; - m_labelOrig = m_label = label ; + m_labelOrig = + m_label = label ; m_peer = wxWidgetImpl::CreateButton( this, parent, id, label, pos, size, style, GetExtraStyle() ); @@ -52,6 +53,20 @@ bool wxButton::Create(wxWindow *parent, return true; } +void wxButton::SetLabel(const wxString& label) +{ + if ( GetId() == wxID_HELP || HasFlag(wxBU_NOTEXT) ) + { + // just store the label internally but don't really use it for the + // button + m_labelOrig = + m_label = label; + return; + } + + wxButtonBase::SetLabel(label); +} + wxWindow *wxButton::SetDefault() { wxWindow *btnOldDefault = wxButtonBase::SetDefault();