]>
Commit | Line | Data |
---|---|---|
34138703 JS |
1 | #ifndef _WX_NOTEBOOK_H_BASE_ |
2 | #define _WX_NOTEBOOK_H_BASE_ | |
53b28675 | 3 | |
4d0f3cd6 VZ |
4 | // ---------------------------------------------------------------------------- |
5 | // headers | |
6 | // ---------------------------------------------------------------------------- | |
7 | ||
8 | #include "wx/event.h" // the base class: wxNotifyEvent | |
9 | ||
10 | // ---------------------------------------------------------------------------- | |
11 | // notebook event class (used by NOTEBOOK_PAGE_CHANGED/ING events) | |
12 | // ---------------------------------------------------------------------------- | |
13 | ||
14 | class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent | |
15 | { | |
16 | public: | |
17 | wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0, | |
18 | int nSel = -1, int nOldSel = -1) | |
19 | : wxNotifyEvent(commandType, id) | |
20 | { | |
21 | m_nSel = nSel; | |
22 | m_nOldSel = nOldSel; | |
23 | } | |
24 | ||
25 | // accessors | |
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; } | |
32 | ||
33 | private: | |
34 | int m_nSel, // currently selected page | |
35 | m_nOldSel; // previously selected page | |
36 | ||
37 | DECLARE_DYNAMIC_CLASS(wxNotebookEvent) | |
38 | }; | |
39 | ||
40 | // ---------------------------------------------------------------------------- | |
41 | // event macros | |
42 | // ---------------------------------------------------------------------------- | |
43 | ||
44 | typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&); | |
45 | ||
25889d3c JS |
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) \ | |
49 | { \ | |
50 | wxEVT_COMMAND_NB_PAGE_CHANGED, \ | |
51 | id, \ | |
52 | -1, \ | |
53 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
54 | NULL \ | |
55 | }, | |
56 | ||
57 | #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \ | |
58 | { \ | |
59 | wxEVT_COMMAND_NB_PAGE_CHANGING, \ | |
60 | id, \ | |
61 | -1, \ | |
62 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
63 | NULL \ | |
64 | }, | |
65 | ||
66 | #else | |
67 | ||
4d0f3cd6 VZ |
68 | #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \ |
69 | { \ | |
70 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \ | |
71 | id, \ | |
72 | -1, \ | |
73 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
74 | NULL \ | |
75 | }, | |
76 | ||
77 | #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \ | |
78 | { \ | |
79 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \ | |
80 | id, \ | |
81 | -1, \ | |
82 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
83 | NULL \ | |
84 | }, | |
85 | ||
25889d3c JS |
86 | #endif |
87 | ||
4d0f3cd6 VZ |
88 | // ---------------------------------------------------------------------------- |
89 | // wxNotebook class itself | |
90 | // ---------------------------------------------------------------------------- | |
91 | ||
2049ba38 | 92 | #if defined(__WXMSW__) |
1e6d9499 JS |
93 | #ifdef __WIN16__ |
94 | #include "wx/generic/notebook.h" | |
95 | #else | |
6a415c9a | 96 | #include "wx/msw/notebook.h" |
1e6d9499 | 97 | #endif |
2049ba38 | 98 | #elif defined(__WXMOTIF__) |
793f619f | 99 | #include "wx/generic/notebook.h" |
2049ba38 | 100 | #elif defined(__WXGTK__) |
53b28675 | 101 | #include "wx/gtk/notebook.h" |
b4e76e0d RR |
102 | #elif defined(__WXQT__) |
103 | #include "wx/qt/notebook.h" | |
34138703 | 104 | #elif defined(__WXMAC__) |
e7549107 | 105 | #include "wx/generic/notebook.h" |
1777b9bb DW |
106 | #elif defined(__WXPM__) |
107 | #include "wx/os2/notebook.h" | |
34138703 JS |
108 | #elif defined(__WXSTUBS__) |
109 | #include "wx/stubs/notebook.h" | |
53b28675 RR |
110 | #endif |
111 | ||
112 | #endif | |
34138703 | 113 | // _WX_NOTEBOOK_H_BASE_ |