- (void)dealloc
{
[m_image release];
+ [super dealloc];
}
- (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel
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)];
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];
return true;
}
-
int wxNotebook::SetSelection(size_t nPage)
+{
+ const int pageOld = GetSelection();
+
+ if ( !SendPageChangingEvent(nPage) )
+ return pageOld;
+
+ int page = ChangeSelection(nPage);
+ if ( page != wxNOT_FOUND )
+ {
+ SendPageChangedEvent(pageOld);
+ }
+
+ return page;
+}
+
+int wxNotebook::ChangeSelection(size_t nPage)
{
wxAutoNSAutoreleasePool pool;
[GetNSTabView() selectTabViewItemAtIndex:nPage];