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 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 typedef void (wxEvtHandler::*wxNotebookEventFunction
)(wxNotebookEvent
&);
46 // Truncation in 16-bit BC++ means we need to define these differently
47 #if defined(__BORLANDC__) && defined(__WIN16__)
48 #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
50 wxEVT_COMMAND_NB_PAGE_CHANGED, \
53 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
57 #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
59 wxEVT_COMMAND_NB_PAGE_CHANGING, \
62 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
68 #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
70 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
73 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
77 #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
79 wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
82 (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
88 // ----------------------------------------------------------------------------
89 // wxNotebook class itself
90 // ----------------------------------------------------------------------------
92 #if defined(__WXMSW__)
94 #include "wx/generic/notebook.h"
96 #include "wx/msw/notebook.h"
98 #elif defined(__WXMOTIF__)
99 #include "wx/generic/notebook.h"
100 #elif defined(__WXGTK__)
101 #include "wx/gtk/notebook.h"
102 #elif defined(__WXQT__)
103 #include "wx/qt/notebook.h"
104 #elif defined(__WXMAC__)
105 #include "wx/generic/notebook.h"
106 #elif defined(__WXPM__)
107 #include "wx/os2/notebook.h"
108 #elif defined(__WXSTUBS__)
109 #include "wx/stubs/notebook.h"
113 // _WX_NOTEBOOK_H_BASE_