X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20b6985553b4e01e7960847e3211d940aeff8742..6ac23e25b85468c7885f6ab43ca0a45f6458af2e:/src/mac/carbon/notebmac.cpp diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 752b676d79..25033f49c4 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -22,6 +22,8 @@ // ---------------------------------------------------------------------------- #include "wx/wxprec.h" +#if wxUSE_NOTEBOOK + #include "wx/app.h" #include "wx/string.h" #include "wx/log.h" @@ -127,7 +129,7 @@ bool wxNotebook::Create(wxWindow *parent, tabsize = kControlSizeSmall; } - m_peer = new wxMacControl() ; + m_peer = new wxMacControl(this) ; verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , tabsize , tabstyle, 0, NULL, m_peer->GetControlRefAddr() ) ); @@ -335,32 +337,35 @@ void wxNotebook::MacSetupTabs() m_peer->SetMaximum( GetPageCount() ) ; wxNotebookPage *page; - ControlTabInfoRec info; + ControlTabInfoRecV1 info; const size_t countPages = GetPageCount(); for(size_t ii = 0; ii < countPages; ii++) { page = m_pages[ii]; - info.version = 0; + info.version = kControlTabInfoVersionOne; info.iconSuiteID = 0; - wxMacStringToPascal( page->GetLabel() , info.name ) ; - m_peer->SetData( ii+1, kControlTabInfoTag, &info ) ; - m_peer->SetTabEnabled( ii + 1 , true ) ; + wxMacCFStringHolder cflabel( page->GetLabel() , m_font.GetEncoding() ) ; + info.name = cflabel ; + m_peer->SetData( ii+1, kControlTabInfoTag, &info ) ; if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 ) { - const wxBitmap* bmap = GetImageList()->GetBitmap( GetPageImage(ii ) ) ; - if ( bmap ) + const wxBitmap bmap = GetImageList()->GetBitmap( GetPageImage(ii ) ) ; + if ( bmap.Ok() ) { ControlButtonContentInfo info ; - wxMacCreateBitmapButton( &info , *bmap ) ; - OSStatus err = m_peer->SetData( ii+1,kControlTabImageContentTag, &info ); + wxMacCreateBitmapButton( &info , bmap ) ; +#ifdef __WXDEBUG__ + OSStatus err = +#endif // __WXDEBUG__ + m_peer->SetData( ii+1,kControlTabImageContentTag, &info ); wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ; wxMacReleaseBitmapButton( &info ) ; } } - + m_peer->SetTabEnabled( ii + 1 , true ) ; } Rect bounds; m_peer->GetRectInWindowCoords( &bounds ) ; @@ -547,3 +552,5 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR return status ; } +#endif +