]> git.saurik.com Git - wxWidgets.git/commitdiff
respect wxBU_NOTEXT style in wxButton
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Jun 2009 23:24:51 +0000 (23:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 19 Jun 2009 23:24:51 +0000 (23:24 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/button.h
src/osx/button_osx.cpp

index 6c599dfaaa37c84c5c5fe50e3a5e10c238fb6738..8a1a8e06e6c8c97c1b5777866a320a3946b5debb 100644 (file)
@@ -45,6 +45,7 @@ public:
 
     static wxSize GetDefaultSize();
 
+    virtual void SetLabel(const wxString& label);
     virtual wxWindow *SetDefault();
     virtual void Command(wxCommandEvent& event);
 
index 6428e4842ac7219525e83d1922f2f284141df948..a7c7cf869c969198d51651825a55dc56d0afe0b9 100644 (file)
@@ -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();