]>
Commit | Line | Data |
---|---|---|
1 | #ifndef _WX_NOTEBOOK_H_BASE_ | |
2 | #define _WX_NOTEBOOK_H_BASE_ | |
3 | ||
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 | ||
46 | #define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \ | |
47 | { \ | |
48 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \ | |
49 | id, \ | |
50 | -1, \ | |
51 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
52 | NULL \ | |
53 | }, | |
54 | ||
55 | #define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \ | |
56 | { \ | |
57 | wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \ | |
58 | id, \ | |
59 | -1, \ | |
60 | (wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \ | |
61 | NULL \ | |
62 | }, | |
63 | ||
64 | // ---------------------------------------------------------------------------- | |
65 | // wxNotebook class itself | |
66 | // ---------------------------------------------------------------------------- | |
67 | ||
68 | #if defined(__WXMSW__) | |
69 | #ifdef __WIN16__ | |
70 | #include "wx/generic/notebook.h" | |
71 | #else | |
72 | #include "wx/msw/notebook.h" | |
73 | #endif | |
74 | #elif defined(__WXMOTIF__) | |
75 | #include "wx/generic/notebook.h" | |
76 | #elif defined(__WXGTK__) | |
77 | #include "wx/gtk/notebook.h" | |
78 | #elif defined(__WXQT__) | |
79 | #include "wx/qt/notebook.h" | |
80 | #elif defined(__WXMAC__) | |
81 | #include "wx/mac/notebook.h" | |
82 | #elif defined(__WXSTUBS__) | |
83 | #include "wx/stubs/notebook.h" | |
84 | #endif | |
85 | ||
86 | #endif | |
87 | // _WX_NOTEBOOK_H_BASE_ |