]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/nbkbase.cpp
don't test sei.hInstApp in DoLaunchDefaultBrowser(), just look at ShellExecuteEx...
[wxWidgets.git] / src / common / nbkbase.cpp
index 2a8177e50aa4d9c121be33da34e893bca5cd127d..1671877483fab39387d62830faec06298329797e 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     02.07.01
 // RCS-ID:      $Id$
 // Copyright:   (c) 2001 Vadim Zeitlin
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ============================================================================
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "notebookbase.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -39,6 +35,9 @@
 // implementation
 // ============================================================================
 
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
+
 // ----------------------------------------------------------------------------
 // geometry
 // ----------------------------------------------------------------------------
@@ -49,7 +48,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;
@@ -63,5 +62,26 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
     return sizeTotal;
 }
 
-#endif // wxUSE_NOTEBOOK
+// ----------------------------------------------------------------------------
+// events
+// ----------------------------------------------------------------------------
 
+bool wxNotebookBase::SendPageChangingEvent(int nPage)
+{
+    wxBookCtrlEvent 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)
+{
+    wxBookCtrlEvent 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