]> git.saurik.com Git - wxWidgets.git/commitdiff
showing a bevel button for a multiline label (is not multline on the OS level, but...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Mar 2004 07:05:51 +0000 (07:05 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 28 Mar 2004 07:05:51 +0000 (07:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/button.cpp

index d11c858561efeabd10f14af4378b73b43c1928bc..44e13791e2cfecba483c33a902b19e858e643135 100644 (file)
@@ -39,8 +39,18 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     m_label = label ;
 
     Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
     m_label = label ;
 
     Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
-    m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 1, 
+    if ( label.Find('\n' ) == wxNOT_FOUND && label.Find('\r' ) == wxNOT_FOUND)
+    {
+        m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 1, 
           kControlPushButtonProc , (long) this ) ;
           kControlPushButtonProc , (long) this ) ;
+    }
+    else
+    {
+        ControlButtonContentInfo info ;
+        info.contentType = kControlNoContent ;
+        verify_noerr(CreateBevelButtonControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds,CFSTR(""),
+            kControlBevelButtonLargeBevel , kControlBehaviorPushbutton , &info , 0 , 0 , 0 , (ControlRef*) &m_macControl ) ) ;
+    }
     wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
     
     MacPostControlCreate(pos,size) ;
     wxASSERT_MSG( (ControlRef) m_macControl != NULL , wxT("No valid mac control") ) ;
     
     MacPostControlCreate(pos,size) ;