X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/facd6764872eede45605ba7c9dfa0e1d0c708fa2..7d9bf1f11cc6c2067af6285682f096d98e523540:/src/mac/carbon/tabctrl.cpp diff --git a/src/mac/carbon/tabctrl.cpp b/src/mac/carbon/tabctrl.cpp index ab984484fd..33bf35469b 100644 --- a/src/mac/carbon/tabctrl.cpp +++ b/src/mac/carbon/tabctrl.cpp @@ -19,12 +19,15 @@ #include "wx/tabctrl.h" #include "wx/mac/uma.h" -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxNotifyEvent) + +DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING) + BEGIN_EVENT_TABLE(wxTabCtrl, wxControl) END_EVENT_TABLE() -#endif wxTabCtrl::wxTabCtrl() { @@ -43,9 +46,24 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons m_imageList = NULL; Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , "\p" , true , 0 , 0 , 1, - kControlTabSmallProc , (long) this ) ; + + 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_peer = new wxMacControl() ; + verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , + tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) ); + MacPostControlCreate(pos,size) ; return TRUE ; } @@ -194,11 +212,3 @@ void wxTabCtrl::SetPadding(const wxSize& padding) // TODO } -// Tab event -IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxCommandEvent) - -wxTabEvent::wxTabEvent(wxEventType commandType, int id): - wxCommandEvent(commandType, id) -{ -} -