X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3b60ea2f22359e044a667dcf33e41040f6c97e26..4c7d530a267f11be1e9cf20d7bfa5313286fee1c:/src/cocoa/toolbar.mm diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index bf0d2a4d5a..7d923ed9c2 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -6,7 +6,7 @@ // Created: 2003/08/17 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -21,8 +21,10 @@ #include "wx/wxprec.h" #if wxUSE_TOOLBAR_NATIVE + +#include "wx/toolbar.h" + #ifndef WX_PRECOMP - #include "wx/toolbar.h" #include "wx/frame.h" #include "wx/log.h" #endif // WX_PRECOMP @@ -58,8 +60,8 @@ public: CreateButtonCell(); } - wxToolBarTool(wxToolBar *tbar, wxControl *control) - : wxToolBarToolBase(tbar, control) + wxToolBarTool(wxToolBar *tbar, wxControl *control, const wxString& label) + : wxToolBarToolBase(tbar, control, label) { Init(); } @@ -184,7 +186,13 @@ bool wxToolBar::Create( wxWindow *parent, const wxString& name ) { // Call wxControl::Create so we get a wxNonControlNSControl - return wxToolBarBase::Create(parent,winid,pos,size,style,wxDefaultValidator,name); + if ( !wxToolBarBase::Create(parent, winid, pos, size, style, + wxDefaultValidator, name) ) + return false; + + FixupStyle(); + + return true; } wxToolBarToolBase *wxToolBar::CreateTool(int toolid, @@ -200,9 +208,10 @@ wxToolBarToolBase *wxToolBar::CreateTool(int toolid, clientData, shortHelpString, longHelpString); } -wxToolBarToolBase *wxToolBar::CreateTool(wxControl *control) +wxToolBarToolBase * +wxToolBar::CreateTool(wxControl *control, const wxString& label) { - return new wxToolBarTool(this, control); + return new wxToolBarTool(this, control, label); } void wxToolBar::SetWindowStyleFlag( long style )