]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/notebook.mm
more native look for wxCheckListBox (especially under XP) (modified patch 1690068)
[wxWidgets.git] / src / cocoa / notebook.mm
index d79c9bd8754affa99d9b271e98b6602c8d28872d..9cc3241b6569277ed0141b76d646e98c76663552 100644 (file)
@@ -261,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];