From 164f091f4bb7bfd23c1f7af516327207c2193482 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Wed, 29 Sep 2004 16:07:12 +0000 Subject: [PATCH] Get the stock label when stock ID is used with empty label in Create() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/button.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index 5bd7101249..a4955ccb28 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -16,6 +16,7 @@ #include "wx/log.h" #endif +#include "wx/stockitem.h" #include "wx/cocoa/autorelease.h" #import @@ -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)) -- 2.45.2