- Rect bounds ;
- Str255 title ;
-
- MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ;
-
- m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , true , 0 , 0 , 1,
- kControlTabSmallProc , (long) this ) ;
-
- MacPostControlCreate() ;
- return TRUE ;
+ m_macIsUserPane = false ;
+
+ if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
+ return false;
+
+ Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
+
+ if( bounds.right <= bounds.left )
+ bounds.right = bounds.left + 100 ;
+ if ( bounds.bottom <= bounds.top )
+ bounds.bottom = bounds.top + 100 ;
+
+ UInt16 tabstyle = kControlTabDirectionNorth ;
+ if ( HasFlag(wxBK_LEFT) )
+ tabstyle = kControlTabDirectionWest ;
+ else if ( HasFlag( wxBK_RIGHT ) )
+ tabstyle = kControlTabDirectionEast ;
+ else if ( HasFlag( wxBK_BOTTOM ) )
+ tabstyle = kControlTabDirectionSouth ;
+
+ 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(this) ;
+ verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
+ tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) );
+
+
+ MacPostControlCreate(pos,size) ;
+ return true ;