]> git.saurik.com Git - wxWidgets.git/commitdiff
use a single wxBookCtrlEvent class for all wxBookCtrlBase-derived controls (#9667)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Aug 2008 13:46:46 +0000 (13:46 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 1 Aug 2008 13:46:46 +0000 (13:46 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

37 files changed:
include/wx/bookctrl.h
include/wx/choicebk.h
include/wx/generic/mdig.h
include/wx/generic/notebook.h
include/wx/gtk/button.h
include/wx/listbook.h
include/wx/motif/mdi.h
include/wx/msw/notebook.h
include/wx/notebook.h
include/wx/os2/notebook.h
include/wx/osx/carbon/notebook.h
include/wx/palmos/notebook.h
include/wx/toolbook.h
include/wx/treebook.h
interface/wx/bookctrl.h
interface/wx/choicebk.h
interface/wx/event.h
interface/wx/notebook.h
interface/wx/treebook.h
src/cocoa/notebook.mm
src/common/bookctrl.cpp
src/common/nbkbase.cpp
src/generic/choicbkg.cpp
src/generic/listbkg.cpp
src/generic/mdig.cpp
src/generic/notebook.cpp
src/generic/toolbkg.cpp
src/generic/treebkg.cpp
src/gtk/notebook.cpp
src/gtk1/notebook.cpp
src/motif/mdi.cpp
src/msw/notebook.cpp
src/os2/notebook.cpp
src/os2/window.cpp
src/osx/carbon/notebmac.cpp
src/palmos/notebook.cpp
src/univ/notebook.cpp

index e864221cada8e43c77a907133a274a93b207db6f..005ef42c3cda35d67f7dec5c7fb5409835475948 100644 (file)
@@ -26,7 +26,7 @@
 WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
 
 class WXDLLIMPEXP_FWD_CORE wxImageList;
-class WXDLLIMPEXP_FWD_CORE wxBookCtrlBaseEvent;
+class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
 
 // ----------------------------------------------------------------------------
 // constants
@@ -260,12 +260,12 @@ protected:
         { wxFAIL_MSG(wxT("Override this function!")); }
 
     // create a new "page changing" event
-    virtual wxBookCtrlBaseEvent* CreatePageChangingEvent() const
+    virtual wxBookCtrlEvent* CreatePageChangingEvent() const
         { wxFAIL_MSG(wxT("Override this function!")); return NULL; }
 
     // modify the event created by CreatePageChangingEvent() to "page changed"
     // event, usually by just calling SetEventType() on it
-    virtual void MakeChangedEvent(wxBookCtrlBaseEvent& WXUNUSED(event))
+    virtual void MakeChangedEvent(wxBookCtrlEvent& WXUNUSED(event))
         { wxFAIL_MSG(wxT("Override this function!")); }
 
 
@@ -341,13 +341,13 @@ private:
 };
 
 // ----------------------------------------------------------------------------
-// wxBookCtrlBaseEvent: page changing events generated by derived classes
+// wxBookCtrlEvent: page changing events generated by book classes
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxBookCtrlBaseEvent : public wxNotifyEvent
+class WXDLLIMPEXP_CORE wxBookCtrlEvent : public wxNotifyEvent
 {
 public:
-    wxBookCtrlBaseEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
+    wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
                         int nSel = -1, int nOldSel = -1)
         : wxNotifyEvent(commandType, winid)
     {
@@ -355,13 +355,15 @@ public:
         m_nOldSel = nOldSel;
     }
 
-    wxBookCtrlBaseEvent(const wxBookCtrlBaseEvent& event)
+    wxBookCtrlEvent(const wxBookCtrlEvent& event)
         : wxNotifyEvent(event)
     {
         m_nSel = event.m_nSel;
         m_nOldSel = event.m_nOldSel;
     }
 
+    virtual wxEvent *Clone() const { return new wxBookCtrlEvent(*this); }
+
     // accessors
         // the currently selected page (-1 if none)
     int GetSelection() const { return m_nSel; }
@@ -373,29 +375,35 @@ public:
 private:
     int m_nSel,     // currently selected page
         m_nOldSel;  // previously selected page
+
+    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxBookCtrlEvent)
 };
 
+typedef void (wxEvtHandler::*wxBookCtrlEventFunction)(wxBookCtrlEvent&);
+
+#define wxBookCtrlEventHandler(func) \
+    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxBookCtrlEventFunction, &func)
+
+// obsolete name, defined for compatibility only
+#define wxBookCtrlBaseEvent wxBookCtrlEvent
+
 // make a default book control for given platform
 #if wxUSE_NOTEBOOK
     // dedicated to majority of desktops
     #include "wx/notebook.h"
     #define wxBookCtrl                             wxNotebook
-    #define wxBookCtrlEvent                        wxNotebookEvent
     #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED    wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
     #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING   wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
     #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn)      EVT_NOTEBOOK_PAGE_CHANGED(id, fn)
     #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn)     EVT_NOTEBOOK_PAGE_CHANGING(id, fn)
-    #define wxBookctrlEventHandler(func)           wxNotebookEventHandler(func)
 #else
     // dedicated to Smartphones
     #include "wx/choicebk.h"
     #define wxBookCtrl                             wxChoicebook
-    #define wxBookCtrlEvent                        wxChoicebookEvent
     #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED    wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED
     #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING   wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING
     #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn)      EVT_CHOICEBOOK_PAGE_CHANGED(id, fn)
     #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn)     EVT_CHOICEBOOK_PAGE_CHANGING(id, fn)
-    #define wxBookctrlEventHandler(func)           wxChoicebookEventHandler(func)
 #endif
 
 #if WXWIN_COMPATIBILITY_2_6
index fc6490cf8add225abeda0e16a9dcca3107335f12..32092c5631b8e2d0ba3b8b760e6ea783d1a43c35 100644 (file)
@@ -97,8 +97,8 @@ protected:
         GetChoiceCtrl()->Select(newsel);
     }
 
-    wxBookCtrlBaseEvent* CreatePageChangingEvent() const;
-    void MakeChangedEvent(wxBookCtrlBaseEvent &event);
+    wxBookCtrlEvent* CreatePageChangingEvent() const;
+    void MakeChangedEvent(wxBookCtrlEvent &event);
 
     // event handlers
     void OnChoiceSelected(wxCommandEvent& event);
@@ -118,36 +118,16 @@ private:
 // choicebook event class and related stuff
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxChoicebookEvent : public wxBookCtrlBaseEvent
-{
-public:
-    wxChoicebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
-                      int nSel = -1, int nOldSel = -1)
-        : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
-    {
-    }
-
-    wxChoicebookEvent(const wxChoicebookEvent& event)
-        : wxBookCtrlBaseEvent(event)
-    {
-    }
-
-    virtual wxEvent *Clone() const { return new wxChoicebookEvent(*this); }
-
-private:
-    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChoicebookEvent)
-};
-
-typedef void (wxEvtHandler::*wxChoicebookEventFunction)(wxChoicebookEvent&);
-
-#define wxChoicebookEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChoicebookEventFunction, &func)
+// wxChoicebookEvent is obsolete and defined for compatibility only
+typedef wxBookCtrlEvent wxChoicebookEvent;
+typedef wxBookCtrlEventFunction wxChoicebookEventFunction;
+#define wxChoicebookEventHandler(func) wxBookCtrlEventHandler(func)
 
 #define EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, winid, wxChoicebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, winid, wxChoicebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
 
 #endif // wxUSE_CHOICEBOOK
 
index bc4bb52f2dae61fa2fd8ad8c6272bf9444e35eba..bee3506d099170da2b68be92a99f5a8fa73380a0 100644 (file)
@@ -237,7 +237,7 @@ public:
 protected:
     void PageChanged(int OldSelection, int newSelection);
 
-    void OnPageChanged(wxNotebookEvent& event);
+    void OnPageChanged(wxBookCtrlEvent& event);
     void OnSize(wxSizeEvent& event);
 
 private:
index 0dec14951081cf0ef37d47f08a961c350477121a..1007d422403994d2663ee5932484070ac2157357 100644 (file)
@@ -115,7 +115,7 @@ public:
   // ---------
   void OnSize(wxSizeEvent& event);
   void OnInternalIdle();
-  void OnSelChange(wxNotebookEvent& event);
+  void OnSelChange(wxBookCtrlEvent& event);
   void OnSetFocus(wxFocusEvent& event);
   void OnNavigationKey(wxNavigationKeyEvent& event);
 
index 190805702d79b4afd4ebac7b9b20c217a522b21d..d04870f76e132c846c5c164eb0cd39e13e970a93 100644 (file)
@@ -44,10 +44,6 @@ public:
     // implementation
     // --------------
 
-    // Since this wxButton doesn't derive from wxButtonBase (why?) we need
-    // to override this here too...
-    virtual bool ShouldInheritColours() const { return false; }
-
     static wxVisualAttributes
     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
index f77b0ca6906575df2ea1206d426fd20db027d461..57f24203dd73600ef0241292cd477b9868059594 100644 (file)
@@ -94,8 +94,8 @@ protected:
 
     void UpdateSelectedPage(size_t newsel);
 
-    wxBookCtrlBaseEvent* CreatePageChangingEvent() const;
-    void MakeChangedEvent(wxBookCtrlBaseEvent &event);
+    wxBookCtrlEvent* CreatePageChangingEvent() const;
+    void MakeChangedEvent(wxBookCtrlEvent &event);
 
     // get flags for different list control modes
     long GetListCtrlIconViewFlags() const;
@@ -124,36 +124,16 @@ private:
 // listbook event class and related stuff
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxListbookEvent : public wxBookCtrlBaseEvent
-{
-public:
-    wxListbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
-                    int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
-        : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
-    {
-    }
-
-    wxListbookEvent(const wxListbookEvent& event)
-        : wxBookCtrlBaseEvent(event)
-    {
-    }
-
-    virtual wxEvent *Clone() const { return new wxListbookEvent(*this); }
-
-private:
-    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxListbookEvent)
-};
-
-typedef void (wxEvtHandler::*wxListbookEventFunction)(wxListbookEvent&);
-
-#define wxListbookEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListbookEventFunction, &func)
+// wxListbookEvent is obsolete and defined for compatibility only
+typedef wxBookCtrlEvent wxListbookEvent;
+typedef wxBookCtrlEventFunction wxListbookEventFunction;
+#define wxListbookEventHandler(func) wxBookCtrlEventHandler(func)
 
 #define EVT_LISTBOOK_PAGE_CHANGED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, winid, wxListbookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_LISTBOOK_PAGE_CHANGING(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, winid, wxListbookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
 
 #endif // wxUSE_LISTBOOK
 
index 8d8ab5f2ad9ebfbd7d5a7693581529a5311fc031..fa8e5a736f9df7fb48dabb04818983897f551b89 100644 (file)
@@ -225,7 +225,7 @@ public:
     void OnScroll(wxScrollEvent& event);
 
     // Implementation
-    void OnPageChanged(wxNotebookEvent& event);
+    void OnPageChanged(wxBookCtrlEvent& event);
 
     int FindPage(const wxNotebookPage* page);
 
index 0509755d5f8341bf6d742f5ee7630a9dede60755..969e7321452c8e16145d0800824316fa39d06336 100644 (file)
@@ -150,7 +150,7 @@ public:
   // callbacks
   // ---------
   void OnSize(wxSizeEvent& event);
-  void OnSelChange(wxNotebookEvent& event);
+  void OnSelChange(wxBookCtrlEvent& event);
   void OnNavigationKey(wxNavigationKeyEvent& event);
 
   // base class virtuals
index 5350a11b2692c251bea758f1aa5124dbfbd9d2ab..060bf6dc7c10c8d6fb17429b0df2092bee626696 100644 (file)
@@ -118,39 +118,19 @@ protected:
 // notebook event class and related stuff
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxNotebookEvent : public wxBookCtrlBaseEvent
-{
-public:
-    wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
-                    int nSel = -1, int nOldSel = -1)
-        : wxBookCtrlBaseEvent(commandType, winid, nSel, nOldSel)
-    {
-    }
-
-    wxNotebookEvent(const wxNotebookEvent& event)
-        : wxBookCtrlBaseEvent(event)
-    {
-    }
-
-    virtual wxEvent *Clone() const { return new wxNotebookEvent(*this); }
-
-private:
-    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNotebookEvent)
-};
+// wxNotebookEvent is obsolete and defined for compatibility only
+typedef wxBookCtrlEvent wxNotebookEvent;
+typedef wxBookCtrlEventFunction wxNotebookEventFunction;
+#define wxNotebookEventHandler(func) wxBookCtrlEventHandler(func)
 
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED;
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING;
 
-typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
-
-#define wxNotebookEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotebookEventFunction, &func)
-
 #define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxNotebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, winid, wxNotebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
 
 // ----------------------------------------------------------------------------
 // wxNotebook class itself
index 3c94de27a7a7ad370e676108ca23ca00b30d0fb0..83b964c0bf0f63f352866cb59101f35dd33dc132 100644 (file)
@@ -155,7 +155,7 @@ public:
     // ---------
     //
     void OnSize(wxSizeEvent& rEvent);
-    void OnSelChange(wxNotebookEvent& rEvent);
+    void OnSelChange(wxBookCtrlEvent& rEvent);
     void OnSetFocus(wxFocusEvent& rEvent);
     void OnNavigationKey(wxNavigationKeyEvent& rEvent);
 
index 48e13feb3a31f366fd2308abb0e81eff8cbf5589..49750b84398099caf2eca6601530c893387b0be7 100644 (file)
@@ -101,7 +101,7 @@ public:
   // callbacks
   // ---------
   void OnSize(wxSizeEvent& event);
-  void OnSelChange(wxNotebookEvent& event);
+  void OnSelChange(wxBookCtrlEvent& event);
   void OnSetFocus(wxFocusEvent& event);
   void OnNavigationKey(wxNavigationKeyEvent& event);
 
index 5a6b32e9099975e1ae8e646ab8bf173960786b47..5e85e4259d009eb4def0838d162566c61d9da5f9 100644 (file)
@@ -145,7 +145,7 @@ public:
     // callbacks
     // ---------
     void OnSize(wxSizeEvent& event);
-    void OnSelChange(wxNotebookEvent& event);
+    void OnSelChange(wxBookCtrlEvent& event);
     void OnNavigationKey(wxNavigationKeyEvent& event);
 
     // base class virtuals
index c6b60383d5a9df354f3af42f48db6567794420d3..63391c858b2512eabf433c327736237f33fc5880 100644 (file)
@@ -111,8 +111,8 @@ protected:
 
     void UpdateSelectedPage(size_t newsel);
 
-    wxBookCtrlBaseEvent* CreatePageChangingEvent() const;
-    void MakeChangedEvent(wxBookCtrlBaseEvent &event);
+    wxBookCtrlEvent* CreatePageChangingEvent() const;
+    void MakeChangedEvent(wxBookCtrlEvent &event);
 
     // the currently selected page or wxNOT_FOUND if none
     int m_selection;
@@ -135,36 +135,17 @@ private:
 // listbook event class and related stuff
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxToolbookEvent : public wxBookCtrlBaseEvent
-{
-public:
-    wxToolbookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
-                    int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
-        : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
-    {
-    }
-
-    wxToolbookEvent(const wxToolbookEvent& event)
-        : wxBookCtrlBaseEvent(event)
-    {
-    }
-
-    virtual wxEvent *Clone() const { return new wxToolbookEvent(*this); }
-
-private:
-    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxToolbookEvent)
-};
-
-typedef void (wxEvtHandler::*wxToolbookEventFunction)(wxToolbookEvent&);
+// wxToolbookEvent is obsolete and defined for compatibility only
+typedef wxBookCtrlEvent wxToolbookEvent;
+typedef wxBookCtrlEventFunction wxToolbookEventFunction;
+#define wxToolbookEventHandler(func) wxBookCtrlEventHandler(func)
 
-#define wxToolbookEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxToolbookEventFunction, &func)
 
 #define EVT_TOOLBOOK_PAGE_CHANGED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, winid, wxToolbookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_TOOLBOOK_PAGE_CHANGING(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, winid, wxToolbookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
 
 #endif // wxUSE_TOOLBOOK
 
index bd60e6dca1942c1941e8ad9e9fc08604c58c0b20..704c87f23490ad9f44c0971d5798e8e46848e36c 100644 (file)
@@ -233,47 +233,28 @@ private:
 // treebook event class and related stuff
 // ----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxTreebookEvent : public wxBookCtrlBaseEvent
-{
-public:
-    wxTreebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
-                    int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
-        : wxBookCtrlBaseEvent(commandType, id, nSel, nOldSel)
-    {
-    }
-
-    wxTreebookEvent(const wxTreebookEvent& event)
-        : wxBookCtrlBaseEvent(event)
-    {
-    }
-
-    virtual wxEvent *Clone() const { return new wxTreebookEvent(*this); }
+// wxTreebookEvent is obsolete and defined for compatibility only
+typedef wxBookCtrlEvent wxTreebookEvent;
+typedef wxBookCtrlEventFunction wxTreebookEventFunction;
+#define wxTreebookEventHandler(func) wxBookCtrlEventHandler(func)
 
-private:
-    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTreebookEvent)
-};
 
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED;
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING;
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED;
 extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED;
 
-typedef void (wxEvtHandler::*wxTreebookEventFunction)(wxTreebookEvent&);
-
-#define wxTreebookEventHandler(func) \
-    (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreebookEventFunction, &func)
-
 #define EVT_TREEBOOK_PAGE_CHANGED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, winid, wxTreebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_TREEBOOK_PAGE_CHANGING(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, winid, wxTreebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_TREEBOOK_NODE_COLLAPSED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, winid, wxTreebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, winid, wxBookCtrlEventHandler(fn))
 
 #define EVT_TREEBOOK_NODE_EXPANDED(winid, fn) \
-    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, winid, wxTreebookEventHandler(fn))
+    wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, winid, wxBookCtrlEventHandler(fn))
 
 
 #endif // wxUSE_TREEBOOK
index 3665a5e87c77106e0c549838efa8d10f4fdbf745..021750acc41183b912d9e42acb6b8e2efc421cec 100644 (file)
@@ -22,3 +22,65 @@ public:
 
 };
 
+
+/**
+    @class wxBookCtrlEvent
+
+    This class represents the events generated by book controls (wxNotebook,
+    wxListbook, wxChoicebook, wxTreebook).
+    The PAGE_CHANGING events are sent before the current page is changed.
+    It allows the program to examine the current page (which can be retrieved
+    with wxBookCtrlEvent::GetOldSelection) and to veto the page change by calling
+    wxNotifyEvent::Veto if, for example, the current values in the controls
+    of the old page are invalid.
+
+    The PAGE_CHANGED events are sent after the page has been changed and
+    the program cannot veto it any more, it just informs it about the page
+    change.
+
+    To summarize, if the program is interested in validating the page values
+    before allowing the user to change it, it should process the PAGE_CHANGING
+    event, otherwise PAGE_CHANGED is probably enough. In any case, it is
+    probably unnecessary to process both events at once.
+
+    @library{wxcore}
+    @category{events}
+
+    @see wxNotebook, wxListbook, wxChoicebook, wxTreebook
+*/
+
+class wxBookCtrlEvent : public wxNotifyEvent
+{
+public:
+    /**
+        Constructor (used internally by wxWidgets only).
+    */
+    wxBookCtrlEvent(wxEventType eventType = wxEVT_NULL, int id = 0,
+                int sel = wxNOT_FOUND, int oldSel = wxNOT_FOUND);
+
+    /**
+        Returns the page that was selected before the change, @c wxNOT_FOUND if
+        none was selected.
+    */
+    int GetOldSelection() const;
+
+    /**
+        Returns the currently selected page, or @c wxNOT_FOUND if none was
+        selected.
+        @note under Windows, GetSelection() will return the same value as
+        GetOldSelection() when called from @c EVT_NOTEBOOK_PAGE_CHANGING
+        handler and not the page which is going to be selected.
+    */
+    int GetSelection() const;
+
+    /**
+        Sets the id of the page selected before the change.
+    */
+    void SetOldSelection(int page);
+
+    /**
+        Sets the selection member variable.
+    */
+    void SetSelection(int page);
+};
+
index 8aa9001b2ccc80a7c8d72291757143eead453d19..01e4032035ece6c68e782cca7e0b8bfd09dc51d6 100644 (file)
@@ -36,7 +36,7 @@
            Place labels below the page area.
     @endStyleTable
 
-    @beginEventTable{wxChoicebookEvent}
+    @beginEventTable{wxBookCtrlEvent}
     @event{EVT_CHOICEBOOK_PAGE_CHANGED(id, func)}
            The page selection was changed. Processes a
            wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED event.
index ce8f4acf06cedd5b4e891e7fc17e4242fdde12dd..e2263ece2758c092d1496aaa89d868862eddf3f5 100644 (file)
@@ -2385,7 +2385,7 @@ public:
     @class wxNotifyEvent
 
     This class is not used by the event handlers by itself, but is a base class
-    for other event classes (such as wxNotebookEvent).
+    for other event classes (such as wxBookCtrlEvent).
 
     It (or an object of a derived class) is sent when the controls state is being
     changed and allows the program to wxNotifyEvent::Veto() this change if it wants
@@ -2394,7 +2394,7 @@ public:
     @library{wxcore}
     @category{events}
 
-    @see wxNotebookEvent
+    @see wxBookCtrlEvent
 */
 class wxNotifyEvent : public wxCommandEvent
 {
index 1ce4eafcdd66ea3cf4dd5cafd8c769680f256980..5325aea8099e366cd06920a7d1b9c1dad4b53fba 100644 (file)
@@ -1,88 +1,21 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        notebook.h
-// Purpose:     interface of wxNotebookEvent
+// Purpose:     interface of wxNotebook
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-/**
-    @class wxNotebookEvent
-
-    This class represents the events generated by a notebook control: currently,
-    there are two of them. The PAGE_CHANGING event is sent before the current
-    page is changed. It allows the program to examine the current page (which
-    can be retrieved with
-    wxNotebookEvent::GetOldSelection) and to veto the page
-    change by calling wxNotifyEvent::Veto if, for example, the
-    current values in the controls of the old page are invalid.
-
-    The second event - PAGE_CHANGED - is sent after the page has been changed and
-    the program cannot veto it any more, it just informs it about the page change.
-
-    To summarize, if the program is interested in validating the page values
-    before allowing the user to change it, it should process the PAGE_CHANGING
-    event, otherwise PAGE_CHANGED is probably enough. In any case, it is probably
-    unnecessary to process both events at once.
-
-    @library{wxcore}
-    @category{events}
-
-    @see wxNotebook
-*/
-class wxNotebookEvent : public wxNotifyEvent
-{
-public:
-    /**
-        Constructor (used internally by wxWidgets only).
-    */
-    wxNotebookEvent(wxEventType eventType = wxEVT_NULL, int id = 0,
-                    int sel = -1,
-                    int oldSel = -1);
-
-    /**
-        Returns the page that was selected before the change, -1 if none was selected.
-    */
-    int GetOldSelection() const;
-
-    /**
-        Returns the currently selected page, or -1 if none was selected.
-        @note under Windows, GetSelection() will return the same value as
-        GetOldSelection() when called from
-        @c EVT_NOTEBOOK_PAGE_CHANGING handler and not the page which is going to
-        be selected. Also note that the values of selection and old selection returned
-        for an event generated in response to a call to
-        wxNotebook::SetSelection shouldn't be trusted
-        as they are currently inconsistent under different platforms (but in this case
-        you presumably don't need them anyhow as you already have the corresponding
-        information).
-    */
-    int GetSelection() const;
-
-    /**
-        Sets the id of the page selected before the change.
-    */
-    void SetOldSelection(int page);
-
-    /**
-        Sets the selection member variable.
-    */
-    void SetSelection(int page);
-};
-
-
-
 /**
     @class wxNotebook
 
     This class represents a notebook control, which manages multiple windows with
     associated tabs.
 
-    To use the class, create a wxNotebook object and call wxNotebook::AddPage or
-    wxNotebook::InsertPage,
-    passing a window to be used as the page. Do not explicitly delete the window
-    for a page that is currently
-    managed by wxNotebook.
+    To use the class, create a wxNotebook object and call wxNotebook::AddPage
+    or wxNotebook::InsertPage, passing a window to be used as the page. Do not
+    explicitly delete the window for a page that is currently managed by
+    wxNotebook.
 
     @b wxNotebookPage is a typedef for wxWindow.
 
@@ -109,8 +42,8 @@ public:
     @library{wxcore}
     @category{miscwnd}
 
-    @see wxBookCtrl(), wxNotebookEvent, wxImageList, 
-    @ref page_samples_notebook "Notebook Sample"
+    @see wxBookCtrl, wxBookCtrlEvent, wxImageList,
+        @ref page_samples_notebook "Notebook Sample"
 */
 class wxNotebook : public wxBookCtrl overview
 {
@@ -190,7 +123,7 @@ public:
     /**
         Changes the selection for the given page, returning the previous selection.
         The call to this function does not generate the page changing events.
-        This is the only difference with SetSelection(). See 
+        This is the only difference with SetSelection(). See
         @ref overview_eventhandling_prog "User Generated Events"
         for more infomation.
     */
@@ -256,10 +189,9 @@ public:
 
     /**
         Returns the currently selected page, or -1 if none was selected.
-        Note that this method may return either the previously or newly selected page
-        when called from the @c EVT_NOTEBOOK_PAGE_CHANGED handler depending on
-        the platform and so
-        wxNotebookEvent::GetSelection should be
+        Note that this method may return either the previously or newly
+        selected page when called from the @c EVT_NOTEBOOK_PAGE_CHANGED handler
+        depending on the platform and so wxBookCtrlEvent::GetSelection should be
         used instead in this case.
     */
     virtual int GetSelection() const;
@@ -327,9 +259,9 @@ public:
     /**
         An event handler function, called when the page selection is changed.
 
-        @see wxNotebookEvent
+        @see wxBookCtrlEvent
     */
-    void OnSelChange(wxNotebookEvent& event);
+    void OnSelChange(wxBookCtrlEvent& event);
 
     /**
         Deletes the specified page, without deleting the associated window.
index a18d2f748264fc784afa2f34b1d39396f790c4a1..f29a05521fd9dceb8d7788a5fdea49b978a71177 100644 (file)
@@ -1,71 +1,11 @@
 /////////////////////////////////////////////////////////////////////////////
 // Name:        treebook.h
-// Purpose:     interface of wxTreebookEvent
+// Purpose:     interface of wxTreebook
 // Author:      wxWidgets team
 // RCS-ID:      $Id$
 // Licence:     wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
-/**
-    @class wxTreebookEvent
-
-    This class represents the events generated by a treebook control: currently,
-    there are four of them. The EVT_TREEBOOK_PAGE_CHANGING() and
-    EVT_TREEBOOK_PAGE_CHANGED() - have exactly the same behaviour as
-    wxNotebookEvent.
-
-    The other two EVT_TREEBOOK_NODE_COLLAPSED() and EVT_TREEBOOK_NODE_EXPANDED()
-    are triggered when page node in the tree control is collapsed/expanded. The
-    page index could be retreived by calling GetSelection().
-
-    @beginEventTable{wxTreebookEvent}
-    @event{EVT_TREEBOOK_PAGE_CHANGED(id, func)}
-        The page selection was changed. Processes a @c
-        wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED event.
-    @event{EVT_TREEBOOK_PAGE_CHANGING(id, func)}
-        The page selection is about to be changed. Processes a @c
-        wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING event. This event can be @ref
-        wxNotifyEvent::Veto() "vetoed".
-    @event{EVT_TREEBOOK_NODE_COLLAPSED(id, func)}
-        The page node is going to be collapsed. Processes a @c
-        wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED event.
-    @event{EVT_TREEBOOK_NODE_EXPANDED(id, func)}
-        The page node is going to be expanded. Processes a @c
-        wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED event.
-    @endEventTable
-    
-    @library{wxcore}
-    @category{events}
-
-    @see wxTreebook, wxNotebookEvent
-*/
-class wxTreebookEvent : public wxNotifyEvent
-{
-public:
-    /**
-        @see wxNotebookEvent
-    */
-    wxTreebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
-                    int nSel = wxNOT_FOUND,
-                    int nOldSel = wxNOT_FOUND);
-
-    /**
-        Returns the page that was selected before the change, @c wxNOT_FOUND if
-        none was selected.
-    */
-    int GetOldSelection() const;
-
-    /**
-        Returns the currently selected page, or @c wxNOT_FOUND if none was
-        selected.
-
-        @see wxNotebookEvent::GetSelection()
-    */
-    int GetSelection() const;
-};
-
-
-
 /**
     @class wxTreebook
 
@@ -81,7 +21,7 @@ public:
     AddPage() and AddSubPage() to sequentially populate your tree by adding at
     every step a page or a subpage to the end of the tree.
 
-    @beginEventTable{wxTreebookEvent}
+    @beginEventTable{wxBookCtrlEvent}
     @event{EVT_TREEBOOK_PAGE_CHANGED(id, func)}
         The page selection was changed. Processes a @c
         wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED event.
@@ -100,7 +40,7 @@ public:
     @library{wxcore}
     @category{miscwnd}
 
-    @see wxTreebookEvent, wxNotebook, wxTreeCtrl, wxImageList,
+    @see wxBookCtrl, wxBookCtrlEvent, wxNotebook, wxTreeCtrl, wxImageList,
          @ref overview_bookctrl, @ref page_samples_notebook
 */
 class wxTreebook : public wxBookCtrlBase
@@ -230,7 +170,7 @@ public:
 
         @note This method may return either the previously or newly selected
             page when called from the EVT_TREEBOOK_PAGE_CHANGED() handler
-            depending on the platform and so wxTreebookEvent::GetSelection()
+            depending on the platform and so wxBookCtrlEvent::GetSelection()
             should be used instead in this case.
     */
     int GetSelection() const;
index 6462b07222d205e3d3c460f74ec04150ef3804af..5e9bab2a0d4e2cfb99ac7da67805fcff0c96feb6 100644 (file)
@@ -125,11 +125,10 @@ WX_DECLARE_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem)
 WX_IMPLEMENT_GET_OBJC_CLASS(WXCTabViewImageItem,NSTabViewItem)
 
 // ========================================================================
-// wxNotebookEvent
+// wxBookCtrlEvent
 // ========================================================================
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
 // ========================================================================
 // wxNotebook
@@ -315,7 +314,7 @@ int wxNotebook::GetSelection() const
 void wxNotebook::CocoaDelegate_tabView_didSelectTabViewItem(WX_NSTabViewItem tabViewItem)
 {
     // FIXME: oldSel probably == newSel
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId(),
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId(),
         [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection());
     event.SetEventObject(this);
     GetEventHandler()->ProcessEvent(event);
@@ -323,7 +322,7 @@ void wxNotebook::CocoaDelegate_tabView_didSelectTabViewItem(WX_NSTabViewItem tab
 
 bool wxNotebook::CocoaDelegate_tabView_shouldSelectTabViewItem(WX_NSTabViewItem tabViewItem)
 {
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(),
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId(),
         [GetNSTabView() indexOfTabViewItem:tabViewItem], GetSelection());
     event.SetEventObject(this);
     return !HandleWindowEvent(event) || event.IsAllowed();
index 3b822dcaa5fad93b398914dd9b42766db4b5df54..d45ff84f7db2a994a58b1b4ca56984557351ddd6 100644 (file)
@@ -455,7 +455,7 @@ int wxBookCtrlBase::DoSetSelection(size_t n, int flags)
 
     if ( n != (size_t)oldSel )
     {
-        wxBookCtrlBaseEvent *event = CreatePageChangingEvent();
+        wxBookCtrlEvent *event = CreatePageChangingEvent();
         bool allowed = false;
 
         if ( flags & SetSelection_SendEvent )
@@ -493,5 +493,6 @@ int wxBookCtrlBase::DoSetSelection(size_t n, int flags)
     return oldSel;
 }
 
+IMPLEMENT_DYNAMIC_CLASS(wxBookCtrlEvent, wxNotifyEvent)
 
 #endif // wxUSE_BOOKCTRL
index ec391bb57febafa767cb241a8e00501c786189cd..b0466a3eeffc24df1ba9d7b3ca254a073f3e07e7 100644 (file)
@@ -65,7 +65,7 @@ wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
 
 bool wxNotebookBase::SendPageChangingEvent(int nPage)
 {
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId());
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, GetId());
     event.SetSelection(nPage);
     event.SetOldSelection(GetSelection());
     event.SetEventObject(this);
@@ -74,7 +74,7 @@ bool wxNotebookBase::SendPageChangingEvent(int nPage)
 
 void wxNotebookBase::SendPageChangedEvent(int nPageOld, int nPageNew)
 {
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId());
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, GetId());
     event.SetSelection(nPageNew == -1 ? GetSelection() : nPageNew);
     event.SetOldSelection(nPageOld);
     event.SetEventObject(this);
index ccc51e049dc7eef7a7f5000fab24275d63b09301..aa24856ec27034fb67135bb4a89015bbeec0c94f 100644 (file)
@@ -48,7 +48,6 @@
 // ----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxChoicebookEvent, wxNotifyEvent)
 
 const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType();
 const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType();
@@ -205,12 +204,12 @@ int wxChoicebook::GetSelection() const
     return m_selection;
 }
 
-wxBookCtrlBaseEvent* wxChoicebook::CreatePageChangingEvent() const
+wxBookCtrlEvent* wxChoicebook::CreatePageChangingEvent() const
 {
-    return new wxChoicebookEvent(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, m_windowId);
+    return new wxBookCtrlEvent(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, m_windowId);
 }
 
-void wxChoicebook::MakeChangedEvent(wxBookCtrlBaseEvent &event)
+void wxChoicebook::MakeChangedEvent(wxBookCtrlEvent &event)
 {
     event.SetEventType(wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED);
 }
index 487b6494a2b4f9f379faf8b9b489341966a7a043..d7cf2df1db5cb156c1a8534b78b83d508013fbf5 100644 (file)
@@ -54,7 +54,6 @@
 // ----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxListbook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxListbookEvent, wxNotifyEvent)
 
 const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType();
 const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType();
@@ -370,12 +369,12 @@ int wxListbook::GetSelection() const
     return m_selection;
 }
 
-wxBookCtrlBaseEvent* wxListbook::CreatePageChangingEvent() const
+wxBookCtrlEvent* wxListbook::CreatePageChangingEvent() const
 {
-    return new wxListbookEvent(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, m_windowId);
+    return new wxBookCtrlEvent(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, m_windowId);
 }
 
-void wxListbook::MakeChangedEvent(wxBookCtrlBaseEvent &event)
+void wxListbook::MakeChangedEvent(wxBookCtrlEvent &event)
 {
     event.SetEventType(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED);
 }
index d97213d79744dc19df967ac0afe0092fdb2db8cb..a64b5e77b18b49caa90c49d93f8cee95973d9d49 100644 (file)
@@ -775,7 +775,7 @@ void wxGenericMDIClientWindow::PageChanged(int OldSelection, int newSelection)
     }
 }
 
-void wxGenericMDIClientWindow::OnPageChanged(wxNotebookEvent& event)
+void wxGenericMDIClientWindow::OnPageChanged(wxBookCtrlEvent& event)
 {
     PageChanged(event.GetOldSelection(), event.GetSelection());
 
index 3b0b6d23823e15bd82698ffa885b6e12d2b8d20a..8fd494e9e944de5de32c9a8e23a738602a4edeee 100644 (file)
@@ -62,7 +62,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 // ============================================================================
 // implementation
@@ -545,7 +544,7 @@ bool wxNotebook::RefreshLayout(bool force)
     return true;
 }
 
-void wxNotebook::OnSelChange(wxNotebookEvent& event)
+void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
 {
     // is it our tab control?
     if ( event.GetEventObject() == this )
@@ -713,7 +712,7 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   if (!m_notebook)
     return;
 
-  wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
+  wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
 
   // Translate from wxTabView's ids (which aren't position-dependent)
   // to wxNotebook's (which are).
@@ -736,7 +735,7 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
 
   if (m_notebook)
   {
-    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
+    wxBookCtrlEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
 
     // Translate from wxTabView's ids (which aren't position-dependent)
     // to wxNotebook's (which are).
index 1693b3cfe2d4586cb3b36b6bd0d8b54d8312ec9a..969960b9881697770c04e3f42e6cbe8baaf74cfa 100644 (file)
@@ -44,7 +44,6 @@
 // ----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxToolbook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxToolbookEvent, wxNotifyEvent)
 
 const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wxNewEventType();
 const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wxNewEventType();
@@ -247,12 +246,12 @@ int wxToolbook::GetSelection() const
     return m_selection;
 }
 
-wxBookCtrlBaseEvent* wxToolbook::CreatePageChangingEvent() const
+wxBookCtrlEvent* wxToolbook::CreatePageChangingEvent() const
 {
-    return new wxToolbookEvent(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, m_windowId);
+    return new wxBookCtrlEvent(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, m_windowId);
 }
 
-void wxToolbook::MakeChangedEvent(wxBookCtrlBaseEvent &event)
+void wxToolbook::MakeChangedEvent(wxBookCtrlEvent &event)
 {
     event.SetEventType(wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED);
 }
index 6c13516a3d301e2b6d253882ef05cc77b8bfd4ac..4984fa306c7e7df43fa68f00dca868996c28a611 100644 (file)
@@ -46,7 +46,6 @@
 // ----------------------------------------------------------------------------
 
 IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxTreebookEvent, wxNotifyEvent)
 
 const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxNewEventType();
 const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wxNewEventType();
@@ -579,7 +578,7 @@ int wxTreebook::DoSetSelection(size_t pagePos, int flags)
     wxASSERT_MSG( GetPageCount() == DoInternalGetPageCount(),
                   wxT("wxTreebook logic error: m_treeIds and m_pages not in sync!"));
 
-    wxTreebookEvent event(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, m_windowId);
+    wxBookCtrlEvent event(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, m_windowId);
     const int oldSel = m_selection;
     wxTreeCtrl *tree = GetTreeCtrl();
     bool allowed = false;
@@ -717,7 +716,7 @@ void wxTreebook::OnTreeNodeExpandedCollapsed(wxTreeEvent & event)
     int pagePos = DoInternalFindPageById(nodeId);
     wxCHECK_RET( pagePos != wxNOT_FOUND, wxT("Internal problem in wxTreebook!..") );
 
-    wxTreebookEvent ev(GetTreeCtrl()->IsExpanded(nodeId)
+    wxBookCtrlEvent ev(GetTreeCtrl()->IsExpanded(nodeId)
             ? wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED
             : wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED,
         m_windowId);
index 7ac1cb4666ff2401ec32bfa4d054b2b06b7afd16..338a0ed5ef4b93dd697385e6426ccf3412270965 100644 (file)
@@ -675,10 +675,4 @@ wxNotebook::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_notebook_new);
 }
 
-//-----------------------------------------------------------------------------
-// wxNotebookEvent
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
-
 #endif
index 37fa1fd8e565945fb5fe4fe847125c7b08dbedd8..4b81047c5f44c081026cc5eb1349b2c833cc18d2 100644 (file)
@@ -112,7 +112,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
         notebook->m_skipNextPageChangeEvent = false;
 
         // make wxNotebook::GetSelection() return the correct (i.e. consistent
-        // with wxNotebookEvent::GetSelection()) value even though the page is
+        // with wxBookCtrlEvent::GetSelection()) value even though the page is
         // not really changed in GTK+
         notebook->m_selection = page;
     }
@@ -126,7 +126,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
         else // change allowed
         {
             // make wxNotebook::GetSelection() return the correct (i.e. consistent
-            // with wxNotebookEvent::GetSelection()) value even though the page is
+            // with wxBookCtrlEvent::GetSelection()) value even though the page is
             // not really changed in GTK+
             notebook->m_selection = page;
 
@@ -865,10 +865,4 @@ wxNotebook::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
     return GetDefaultAttributesFromGTKWidget(gtk_notebook_new);
 }
 
-//-----------------------------------------------------------------------------
-// wxNotebookEvent
-//-----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
-
 #endif
index 998bc5d107c1a786f5e6c4fcfd606d4503972324..b0975e621ed4cd6973fa7715b7c0bbf794948b57 100644 (file)
@@ -682,7 +682,7 @@ void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
     event.Skip();
 }
 
-void wxMDIClientWindow::OnPageChanged(wxNotebookEvent& event)
+void wxMDIClientWindow::OnPageChanged(wxBookCtrlEvent& event)
 {
     // Notify child that it has been activated
     if (event.GetOldSelection() != -1)
index 5c9cd14cd21832c3ecab7e958bdf14a74cc60d72..e58dcd3b425fa8489160a45692331ae2a2b6e10c 100644 (file)
@@ -187,8 +187,8 @@ template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theLis
 }
 
 wxBEGIN_PROPERTIES_TABLE(wxNotebook)
-    wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxNotebookEvent )
-    wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxNotebookEvent )
+    wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxBookCtrlEvent )
+    wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxBookCtrlEvent )
 
     wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
     wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
@@ -216,7 +216,6 @@ wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text ,
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject )
 #endif
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
 // ============================================================================
 // implementation
@@ -1091,7 +1090,7 @@ void wxNotebook::OnSize(wxSizeEvent& event)
     event.Skip();
 }
 
-void wxNotebook::OnSelChange(wxNotebookEvent& event)
+void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
 {
     // is it our tab control?
     if ( event.GetEventObject() == this )
@@ -1423,7 +1422,7 @@ bool wxNotebook::MSWOnScroll(int orientation, WXWORD nSBCode,
 
 bool wxNotebook::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM* result)
 {
-  wxNotebookEvent event(wxEVT_NULL, m_windowId);
+  wxBookCtrlEvent event(wxEVT_NULL, m_windowId);
 
   NMHDR* hdr = (NMHDR *)lParam;
   switch ( hdr->code ) {
index b68b16028ebd4cb111bbfd86b4adca5945a0563d..81e3a98538b8245b3fb47d542ae82063d340c59c 100644 (file)
@@ -64,7 +64,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
 // ============================================================================
 // implementation
@@ -216,7 +215,7 @@ int wxNotebook::SetSelection( size_t nPage )
 
     if (nPage != (size_t)m_nSelection)
     {
-        wxNotebookEvent             vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
+        wxBookCtrlEvent             vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
                                            ,m_windowId
                                           );
 
@@ -683,7 +682,7 @@ void wxNotebook::OnSize(
 } // end of wxNotebook::OnSize
 
 void wxNotebook::OnSelChange (
-  wxNotebookEvent&                  rEvent
+  wxBookCtrlEvent&                  rEvent
 )
 {
     //
index 444a0756c2312a3224852fa1a1a630ac1fdde6c4..74490afd45987d6ab3b4f7aba3b6f553636e68b0 100644 (file)
@@ -2548,7 +2548,7 @@ MRESULT wxWindowOS2::OS2WindowProc( WXUINT uMsg,
                             (pPage->ulPageIdNew > 0L && pPage->ulPageIdCur > 0L))
                         {
                             wxWindowOS2*        pWin = wxFindWinFromHandle(pPage->hwndBook);
-                            wxNotebookEvent     vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
+                            wxBookCtrlEvent     vEvent( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
                                                        ,(int)SHORT1FROMMP(wParam)
                                                        ,(int)pPage->ulPageIdNew
                                                        ,(int)pPage->ulPageIdCur
index 5a5504d8f6b50ed55cabd3b67a8c972b30ad1de0..232d01d258d06e44db77550f8e8d374e3a7c376e 100644 (file)
@@ -43,7 +43,6 @@ BEGIN_EVENT_TABLE(wxNotebook, wxBookCtrlBase)
 END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 
 // common part of all ctors
@@ -458,7 +457,7 @@ void wxNotebook::OnSize(wxSizeEvent& event)
     event.Skip();
 }
 
-void wxNotebook::OnSelChange(wxNotebookEvent& event)
+void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
 {
     // is it our tab control?
     if ( event.GetEventObject() == this )
@@ -593,7 +592,7 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
     SInt32 newSel = m_peer->GetValue() - 1 ;
     if ( newSel != m_nSelection )
     {
-        wxNotebookEvent changing(
+        wxBookCtrlEvent changing(
             wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
             newSel , m_nSelection );
         changing.SetEventObject( this );
@@ -601,7 +600,7 @@ wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTR
 
         if ( changing.IsAllowed() )
         {
-            wxNotebookEvent event(
+            wxBookCtrlEvent event(
                 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
                 newSel, m_nSelection );
             event.SetEventObject( this );
index bca31c6f8613ff4e38e4824834e43c3a118b0d9a..37063ae1415e1f8b465dd0a3a9b39c1657741623 100644 (file)
@@ -98,8 +98,8 @@ template<> void wxCollectionToVariantArray( wxNotebookPageInfoList const &theLis
 }
 
 wxBEGIN_PROPERTIES_TABLE(wxNotebook)
-    wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxNotebookEvent )
-    wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxNotebookEvent )
+    wxEVENT_PROPERTY( PageChanging , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING , wxBookCtrlEvent )
+    wxEVENT_PROPERTY( PageChanged , wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED , wxBookCtrlEvent )
 
     wxPROPERTY_COLLECTION( PageInfos , wxNotebookPageInfoList , wxNotebookPageInfo* , AddPageInfo , GetPageInfos , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
     wxPROPERTY_FLAGS( WindowStyle , wxNotebookStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
@@ -127,7 +127,6 @@ wxCONSTRUCTOR_4( wxNotebookPageInfo , wxNotebookPage* , Page , wxString , Text ,
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookPageInfo, wxObject )
 #endif
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
 
 // ============================================================================
 // implementation
@@ -288,7 +287,7 @@ void wxNotebook::OnSize(wxSizeEvent& event)
 {
 }
 
-void wxNotebook::OnSelChange(wxNotebookEvent& event)
+void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
 {
 }
 
index a1c7d867f29b677399547b685281b13fbecc3e8b..e6210f29278cb717142690c1b83883521d5fb983 100644 (file)
@@ -115,7 +115,6 @@ END_EVENT_TABLE()
 // ============================================================================
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxBookCtrlBase)
-IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
 
 // ----------------------------------------------------------------------------
 // wxNotebook creation