]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/notebook.mm
[#1577388] - fix for scaling in wxImage.
[wxWidgets.git] / src / cocoa / notebook.mm
index 33687e9f0b7f3fbe07ca67b2cb73d2a2b5a196f4..9cc3241b6569277ed0141b76d646e98c76663552 100644 (file)
@@ -64,6 +64,7 @@
 - (void)dealloc
 {
     [m_image release];
+    [super dealloc];
 }
 
 - (NSSize)sizeOfLabel:(BOOL)shouldTruncateLabel
@@ -260,8 +261,23 @@ bool wxNotebook::SetPageImage(size_t nPage, int nImage)
     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];