1 #ifndef _WX_NOTEBOOK_H_BASE_
2 #define _WX_NOTEBOOK_H_BASE_
4 // ----------------------------------------------------------------------------
6 // ----------------------------------------------------------------------------
8 #include "wx/event.h" // the base class: wxNotifyEvent
10 // ----------------------------------------------------------------------------
11 // notebook event class (used by NOTEBOOK_PAGE_CHANGED/ING events)
12 // ----------------------------------------------------------------------------
14 class WXDLLEXPORT wxNotebookEvent
: public wxNotifyEvent
17 wxNotebookEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0,
18 int nSel
= -1, int nOldSel
= -1)
19 : wxNotifyEvent(commandType
, id
)
26 // the currently selected page (-1 if none)
27 int GetSelection() const { return m_nSel
; }
28 void SetSelection(int nSel
) { m_nSel
= nSel
; }
29 // the page that was selected before the change (-1 if none)
30 int GetOldSelection() const { return m_nOldSel
; }
31 void SetOldSelection(int nOldSel
) { m_nOldSel
= nOldSel
; }
34 int m_nSel
, // currently selected page
35 m_nOldSel
; // previously selected page
37 DECLARE_DYNAMIC_CLASS(wxNotebookEvent
)
40 // ----------------------------------------------------------------------------
41 // event types and macros for them
42 // ----------------------------------------------------------------------------
44 #if defined(__BORLANDC__) && defined(__WIN16__)
45 // For 16-bit BC++, these 2 would be identical otherwise (truncated)
46 #define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_COMMAND_NB_PAGE_CHANGED
47 #define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxEVT_COMMAND_NB_PAGE_CHANGING
50 BEGIN_DECLARE_EVENT_TYPES()
51 DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
, 802)
52 DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
, 803)
53 END_DECLARE_EVENT_TYPES()
55 typedef void (wxEvtHandler::*wxNotebookEventFunction
)(wxNotebookEvent
&);
57 // Truncation in 16-bit BC++ means we need to define these differently
58 #if defined(__BORLANDC__) && defined(__WIN16__)
59 #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
60 DECLARE_EVENT_TABLE_ENTRY( \
61 wxEVT_COMMAND_NB_PAGE_CHANGED, \
64 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
68 #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
69 DECLARE_EVENT_TABLE_ENTRY( \
70 wxEVT_COMMAND_NB_PAGE_CHANGING, \
73 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
79 #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
80 DECLARE_EVENT_TABLE_ENTRY( \
81 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
84 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
88 #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
89 DECLARE_EVENT_TABLE_ENTRY( \
90 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
93 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
99 // ----------------------------------------------------------------------------
100 // wxNotebook class itself
101 // ----------------------------------------------------------------------------
103 #if defined(__WXMSW__)
105 #include "wx/generic/notebook.h"
107 #include "wx/msw/notebook.h"
109 #elif defined(__WXMOTIF__)
110 #include "wx/generic/notebook.h"
111 #elif defined(__WXGTK__)
112 #include "wx/gtk/notebook.h"
113 #elif defined(__WXQT__)
114 #include "wx/qt/notebook.h"
115 #elif defined(__WXMAC__)
116 #include "wx/mac/notebook.h"
117 #elif defined(__WXPM__)
118 #include "wx/os2/notebook.h"
119 #elif defined(__WXSTUBS__)
120 #include "wx/stubs/notebook.h"
124 // _WX_NOTEBOOK_H_BASE_