]>
Commit | Line | Data |
---|---|---|
0b4d4194 | 1 | ///////////////////////////////////////////////////////////////////////////// |
c1dfe277 JS |
2 | // Name: samples/notebook/notebook.h |
3 | // Purpose: a sample demonstrating notebook usage | |
0b4d4194 | 4 | // Author: Julian Smart |
c1dfe277 | 5 | // Modified by: Dimitri Schoolwerth |
0b4d4194 JS |
6 | // Created: 25/10/98 |
7 | // RCS-ID: $Id$ | |
be5a51fb | 8 | // Copyright: (c) 1998-2002 wxWidgets team |
c1dfe277 | 9 | // License: wxWindows license |
0b4d4194 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
9133965e WS |
12 | #include "wx/choicebk.h" |
13 | #include "wx/listbook.h" | |
14 | #include "wx/notebook.h" | |
15 | ||
16 | #if wxUSE_LOG && !defined( __SMARTPHONE__ ) | |
17 | #define USE_LOG 1 | |
4e62c3fd | 18 | #else |
9133965e | 19 | #define USE_LOG 0 |
4e62c3fd | 20 | #endif |
0b4d4194 JS |
21 | |
22 | // Define a new application | |
c1dfe277 | 23 | class MyApp : public wxApp |
0b4d4194 JS |
24 | { |
25 | public: | |
477350ce | 26 | bool OnInit(); |
0b4d4194 JS |
27 | }; |
28 | ||
29 | DECLARE_APP(MyApp) | |
30 | ||
c1dfe277 | 31 | class MyFrame : public wxFrame |
0b4d4194 JS |
32 | { |
33 | public: | |
c1dfe277 | 34 | MyFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition, |
c02e5a31 | 35 | const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE); |
c1dfe277 JS |
36 | |
37 | virtual ~MyFrame(); | |
38 | ||
9133965e WS |
39 | void OnType(wxCommandEvent& event); |
40 | void OnOrient(wxCommandEvent& event); | |
41 | void OnShowImages(wxCommandEvent& event); | |
42 | void OnMulti(wxCommandEvent& event); | |
43 | void OnExit(wxCommandEvent& event); | |
c1dfe277 | 44 | |
9133965e WS |
45 | void OnAddPage(wxCommandEvent& event); |
46 | void OnInsertPage(wxCommandEvent& event); | |
47 | void OnDeleteCurPage(wxCommandEvent& event); | |
48 | void OnDeleteLastPage(wxCommandEvent& event); | |
49 | void OnNextPage(wxCommandEvent& event); | |
c1dfe277 | 50 | |
02161c7c | 51 | #if wxUSE_NOTEBOOK |
c1dfe277 | 52 | void OnNotebook(wxNotebookEvent& event); |
02161c7c WS |
53 | #endif |
54 | #if wxUSE_CHOICEBOOK | |
9133965e | 55 | void OnChoicebook(wxChoicebookEvent& event); |
02161c7c WS |
56 | #endif |
57 | #if wxUSE_LISTBOOK | |
9133965e | 58 | void OnListbook(wxListbookEvent& event); |
02161c7c | 59 | #endif |
96d37807 | 60 | |
3957448a | 61 | void OnIdle(wxIdleEvent& event); |
96d37807 | 62 | |
61c083e7 | 63 | wxBookCtrlBase *GetCurrentBook(); |
9133965e | 64 | |
c1dfe277 JS |
65 | private: |
66 | wxLog *m_logTargetOld; | |
67 | ||
9133965e WS |
68 | int SelectFlag(int id, int nb, int lb, int chb); |
69 | void ShowCurrentBook(); | |
70 | void RecreateBooks(); | |
71 | ||
72 | // Sample setup | |
73 | int m_type; | |
74 | int m_orient; | |
75 | bool m_chkShowImages; | |
76 | bool m_multi; | |
c1dfe277 JS |
77 | |
78 | // Controls | |
79 | ||
80 | wxPanel *m_panel; // Panel containing notebook and other controls | |
81 | ||
02161c7c | 82 | #if wxUSE_NOTEBOOK |
9133965e | 83 | wxNotebook *m_notebook; |
02161c7c WS |
84 | #endif |
85 | #if wxUSE_CHOICEBOOK | |
9133965e | 86 | wxChoicebook *m_choicebook; |
02161c7c WS |
87 | #endif |
88 | #if wxUSE_LISTBOOK | |
9133965e | 89 | wxListbook *m_listbook; |
02161c7c | 90 | #endif |
c1dfe277 | 91 | |
9133965e | 92 | #if USE_LOG |
c1dfe277 JS |
93 | // Log window |
94 | wxTextCtrl *m_text; | |
9133965e | 95 | #endif // USE_LOG |
c1dfe277 | 96 | |
c1dfe277 JS |
97 | wxBoxSizer *m_sizerFrame; |
98 | ||
c1dfe277 | 99 | wxImageList *m_imageList; |
0b4d4194 | 100 | |
d22699b5 | 101 | DECLARE_EVENT_TABLE() |
0b4d4194 JS |
102 | }; |
103 | ||
9133965e | 104 | enum ID_COMMANDS |
c1dfe277 | 105 | { |
9133965e WS |
106 | ID_BOOK_NOTEBOOK = wxID_HIGHEST, |
107 | ID_BOOK_LISTBOOK, | |
108 | ID_BOOK_CHOICEBOOK, | |
109 | ID_BOOK_MAX, | |
110 | ID_ORIENT_DEFAULT, | |
111 | ID_ORIENT_TOP, | |
112 | ID_ORIENT_BOTTOM, | |
113 | ID_ORIENT_LEFT, | |
114 | ID_ORIENT_RIGHT, | |
115 | ID_ORIENT_MAX, | |
116 | ID_SHOW_IMAGES, | |
117 | ID_MULTI, | |
118 | ID_ADD_PAGE, | |
119 | ID_INSERT_PAGE, | |
120 | ID_DELETE_CUR_PAGE, | |
121 | ID_DELETE_LAST_PAGE, | |
122 | ID_NEXT_PAGE, | |
123 | ID_NOTEBOOK, | |
124 | ID_LISTBOOK, | |
125 | ID_CHOICEBOOK | |
c1dfe277 | 126 | }; |
76645ab3 VZ |
127 | |
128 | /* | |
129 | Name of each notebook page. | |
130 | Used as a label for a page, and used when cloning the notebook | |
131 | to decide what type of page it is. | |
132 | */ | |
133 | ||
134 | #define I_WAS_INSERTED_PAGE_NAME wxT("Inserted") | |
135 | #define RADIOBUTTONS_PAGE_NAME wxT("Radiobuttons") | |
136 | #define VETO_PAGE_NAME wxT("Veto") | |
137 | #define MAXIMIZED_BUTTON_PAGE_NAME wxT("Maximized button") | |
138 | ||
139 | // Pages that can be added by the user | |
140 | #define INSERTED_PAGE_NAME wxT("Inserted ") | |
141 | #define ADDED_PAGE_NAME wxT("Added ") |