From 49e3e2c25f93dd8114b36155de1756139b7f18b9 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 7 Aug 2004 14:37:20 +0000 Subject: [PATCH] support for Mac Help Button added (wxID_HELP) is automatically translated git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/button.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/button.cpp b/src/mac/carbon/button.cpp index b9dee54353..488ca0496c 100644 --- a/src/mac/carbon/button.cpp +++ b/src/mac/carbon/button.cpp @@ -40,7 +40,15 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label, Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; m_peer = new wxMacControl() ; - if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND) + if ( id == wxID_HELP ) + { + ControlButtonContentInfo info ; + info.contentType = kControlContentIconRef ; + GetIconRef(kOnSystemDisk, kSystemIconsCreator, kHelpIcon, &info.u.iconRef); + verify_noerr ( CreateRoundButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , kControlRoundButtonNormalSize , + &info , m_peer->GetControlRefAddr() ) ); + } + else if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND) { verify_noerr ( CreatePushButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , CFSTR("") , m_peer->GetControlRefAddr() ) ); } @@ -77,6 +85,9 @@ void wxButton::SetDefault() wxSize wxButton::DoGetBestSize() const { + if ( GetId() == wxID_HELP ) + return wxSize( 20 , 20 ) ; + wxSize sz = GetDefaultSize() ; int charspace = 8 ; -- 2.45.2