]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/nbkbase.cpp
use WX_ASSERT_STR/SIZET_EQUAL instead of CPPUNIT_ASSERT_EQUAL with casts
[wxWidgets.git] / src / common / nbkbase.cpp
index 4e7e5f19cd67f6ad0e447e22c082e94906017428..ec391bb57febafa767cb241a8e00501c786189cd 100644 (file)
@@ -45,7 +45,7 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
     // default because not all ports implement this
     wxSize sizeTotal = sizePage;
 
-    if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
+    if ( HasFlag(wxBK_LEFT) || HasFlag(wxBK_RIGHT) )
     {
         sizeTotal.x += 90;
         sizeTotal.y += 10;
@@ -59,5 +59,26 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
     return sizeTotal;
 }
 
-#endif // wxUSE_NOTEBOOK
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
+
+bool wxNotebookBase::SendPageChangingEvent(int nPage)
+{
+    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId());
+    event.SetSelection(nPage);
+    event.SetOldSelection(GetSelection());
+    event.SetEventObject(this);
+    return !GetEventHandler()->ProcessEvent(event) || event.IsAllowed();
+}
 
+void wxNotebookBase::SendPageChangedEvent(int nPageOld, int nPageNew)
+{
+    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId());
+    event.SetSelection(nPageNew == -1 ? GetSelection() : nPageNew);
+    event.SetOldSelection(nPageOld);
+    event.SetEventObject(this);
+    GetEventHandler()->ProcessEvent(event);
+}
+
+#endif // wxUSE_NOTEBOOK