X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7848088476db284a94f19eeb24411b45d676ac46..63a3cd7a8c737eb4571f27e5f2af37eda0f1c5cc:/src/cocoa/notebook.mm diff --git a/src/cocoa/notebook.mm b/src/cocoa/notebook.mm index 3518e49a50..d79c9bd875 100644 --- a/src/cocoa/notebook.mm +++ b/src/cocoa/notebook.mm @@ -6,14 +6,17 @@ // Created: 2004/04/08 // RCS-ID: $Id$ // Copyright: (c) 2004 David Elliott -// Licence: wxWindows licence +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #include "wx/wxprec.h" + +#if wxUSE_NOTEBOOK + #ifndef WX_PRECOMP #include "wx/app.h" - #include "wx/notebook.h" #endif //WX_PRECOMP +#include "wx/notebook.h" #include "wx/imaglist.h" #include "wx/cocoa/autorelease.h" @@ -61,6 +64,7 @@ - (void)dealloc { [m_image release]; + [super dealloc]; } - (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel @@ -177,7 +181,7 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) [tvitem retain]; [GetNSTabView() removeTabViewItem:tvitem]; // Remove the child window as a notebook page - wxASSERT([tvitem view] == page->GetNSViewForSuperview()); + wxASSERT(static_cast([tvitem view]) == page->GetNSViewForSuperview()); [tvitem setView:nil]; [tvitem release]; // Make it back into a normal child window @@ -199,7 +203,7 @@ bool wxNotebook::InsertPage( size_t pos, m_pages.Insert(page,pos); NSTabViewItem *tvitem = [[WXCTabViewImageItem alloc] initWithIdentifier:nil]; [tvitem setLabel: wxNSStringWithWxString(title)]; - const wxBitmap *bmp = (imageId!=-1)?m_imageList->GetBitmap(imageId):NULL; + const wxBitmap *bmp = (imageId!=-1)?m_imageList->GetBitmapPtr(imageId):NULL; if(bmp) [(WXCTabViewImageItem*) tvitem setImage: bmp->GetNSImage(true)]; @@ -247,7 +251,7 @@ int wxNotebook::GetPageImage(size_t nPage) const bool wxNotebook::SetPageImage(size_t nPage, int nImage) { - const wxBitmap *bmp = nImage!=-1?m_imageList->GetBitmap(nImage):NULL; + const wxBitmap *bmp = nImage!=-1?m_imageList->GetBitmapPtr(nImage):NULL; if(!bmp) return false; NSTabViewItem *tvitem = [GetNSTabView() tabViewItemAtIndex: nPage]; @@ -260,6 +264,7 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage) int wxNotebook::SetSelection(size_t nPage) { + wxAutoNSAutoreleasePool pool; [GetNSTabView() selectTabViewItemAtIndex:nPage]; return GetSelection(); } @@ -288,3 +293,4 @@ bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed(); } +#endif // wxUSE_NOTEBOOK