X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/888cd6834719021c4beddb57b254adee0424dc30..cc4d5638c66a409e421420ed7110917755a66788:/src/osx/button_osx.cpp diff --git a/src/osx/button_osx.cpp b/src/osx/button_osx.cpp index 6984a9af08..e604d21483 100644 --- a/src/osx/button_osx.cpp +++ b/src/osx/button_osx.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -51,23 +50,23 @@ bool wxButton::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { - DontCreatePeer(); - - m_marginX = - m_marginY = 0; - // FIXME: this hack is needed because we're called from // wxBitmapButton::Create() with this style and we currently use a // different wxWidgetImpl method (CreateBitmapButton() rather than // CreateButton()) for creating bitmap buttons, but we really ought // to unify the creation of buttons of all kinds and then remove // this check - if ( style & wxBU_NOTEXT ) + if ( style & wxBU_NOTEXT && !ShouldCreatePeer() ) { return wxControl::Create(parent, id, pos, size, style, validator, name); } + DontCreatePeer(); + + m_marginX = + m_marginY = 0; + wxString label; // Ignore the standard label for help buttons if possible, they use "?" @@ -101,6 +100,9 @@ void wxButton::SetLabel(const wxString& label) } wxAnyButton::SetLabel(label); +#if wxOSX_USE_COCOA + OSXUpdateAfterLabelChange(label); +#endif } wxWindow *wxButton::SetDefault() @@ -125,7 +127,7 @@ void wxButton::Command (wxCommandEvent & WXUNUSED(event)) bool wxButton::OSXHandleClicked( double WXUNUSED(timestampsec) ) { - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId); + wxCommandEvent event(wxEVT_BUTTON, m_windowId); event.SetEventObject(this); ProcessCommand(event); return true; @@ -170,7 +172,7 @@ bool wxDisclosureTriangle::IsOpen() const bool wxDisclosureTriangle::OSXHandleClicked( double WXUNUSED(timestampsec) ) { // Just emit button event for now - wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, m_windowId); + wxCommandEvent event(wxEVT_BUTTON, m_windowId); event.SetEventObject(this); ProcessCommand(event);