X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/427ff66291af2d8dd34ff5ee68c81436997144a1..aa522e33fca3ac2562a7c347b8f566d4486c9926:/src/mac/carbon/tabctrl.cpp diff --git a/src/mac/carbon/tabctrl.cpp b/src/mac/carbon/tabctrl.cpp index 4fcf069286..a8b350e713 100644 --- a/src/mac/carbon/tabctrl.cpp +++ b/src/mac/carbon/tabctrl.cpp @@ -34,17 +34,34 @@ wxTabCtrl::wxTabCtrl() bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name) { - Rect bounds ; - Str255 title ; + m_macIsUserPane = FALSE ; + if ( !wxControl::Create(parent, id, pos, size, + style, wxDefaultValidator, name) ) + return false; + m_imageList = NULL; - MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; + Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; + + UInt16 tabstyle = kControlTabDirectionNorth ; + ControlTabSize tabsize = kControlTabSizeLarge ; + if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL ) + tabsize = kControlTabSizeSmall ; + else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI ) + { + if (UMAGetSystemVersion() >= 0x1030 ) + tabsize = 3 ; + else + tabsize = kControlSizeSmall; + } - m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false , 0 , 0 , 1, - kControlTabSmallProc , (long) this ) ; + m_peer = new wxMacControl() ; + verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , + tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) ); - MacPostControlCreate() ; + + MacPostControlCreate(pos,size) ; return TRUE ; }