]> git.saurik.com Git - wxWidgets.git/commitdiff
Get the stock label when stock ID is used with empty label in Create()
authorDavid Elliott <dfe@tgwbd.org>
Wed, 29 Sep 2004 16:07:12 +0000 (16:07 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Wed, 29 Sep 2004 16:07:12 +0000 (16:07 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/button.mm

index 5bd7101249e6798f3d79cd7f961ccb7ad7b302b4..a4955ccb28e45fac0c9138b9e307a073c8142c4a 100644 (file)
@@ -16,6 +16,7 @@
     #include "wx/log.h"
 #endif
 
+#include "wx/stockitem.h"
 #include "wx/cocoa/autorelease.h"
 
 #import <AppKit/NSButton.h>
@@ -27,10 +28,12 @@ END_EVENT_TABLE()
 WX_IMPLEMENT_COCOA_OWNER(wxButton,NSButton,NSControl,NSView)
 
 bool wxButton::Create(wxWindow *parent, wxWindowID winid,
-            const wxString& label, const wxPoint& pos,
+            const wxString& lbl, const wxPoint& pos,
             const wxSize& size, long style,
             const wxValidator& validator, const wxString& name)
 {
+    wxString label((lbl.empty() && wxIsStockID(winid))?wxGetStockLabel(winid):lbl);
+
     wxAutoNSAutoreleasePool pool;
     wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid);
     if(!CreateControl(parent,winid,pos,size,style,validator,name))