]>
git.saurik.com Git - wxWidgets.git/blob - samples/notebook/notebook.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: samples/notebook/notebook.h
3 // Purpose: a sample demonstrating notebook usage
4 // Author: Julian Smart
5 // Modified by: Dimitri Schoolwerth
8 // Copyright: (c) 1998-2002 wxWidgets team
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/choicebk.h"
13 #include "wx/listbook.h"
14 #include "wx/treebook.h"
15 #include "wx/notebook.h"
16 #include "wx/toolbook.h"
18 #if wxUSE_LOG && !defined( __SMARTPHONE__ )
24 // Define a new application
25 class MyApp
: public wxApp
34 class MyFrame
: public wxFrame
40 void OnType(wxCommandEvent
& event
);
41 void OnOrient(wxCommandEvent
& event
);
42 void OnShowImages(wxCommandEvent
& event
);
43 void OnMulti(wxCommandEvent
& event
);
44 void OnExit(wxCommandEvent
& event
);
46 void OnAddPage(wxCommandEvent
& event
);
47 void OnAddPageNoSelect(wxCommandEvent
& event
);
48 void OnInsertPage(wxCommandEvent
& event
);
49 void OnDeleteCurPage(wxCommandEvent
& event
);
50 void OnDeleteLastPage(wxCommandEvent
& event
);
51 void OnNextPage(wxCommandEvent
& event
);
52 void OnChangeSelection(wxCommandEvent
&event
);
53 void OnSetSelection(wxCommandEvent
&event
);
55 void OnAddSubPage(wxCommandEvent
& event
);
56 void OnAddPageBefore(wxCommandEvent
& event
);
59 void OnContextHelp(wxCommandEvent
& event
);
62 void OnHitTest(wxCommandEvent
& event
);
64 void OnBookCtrl(wxBookCtrlBaseEvent
& event
);
66 void OnNotebook(wxNotebookEvent
& event
) { OnBookCtrl(event
); }
69 void OnChoicebook(wxChoicebookEvent
& event
) { OnBookCtrl(event
); }
72 void OnListbook(wxListbookEvent
& event
) { OnBookCtrl(event
); }
75 void OnTreebook(wxTreebookEvent
& event
) { OnBookCtrl(event
); }
78 void OnToolbook(wxToolbookEvent
& event
) { OnBookCtrl(event
); }
81 void OnIdle(wxIdleEvent
& event
);
84 void OnUpdateTreeMenu(wxUpdateUIEvent
& event
);
85 #endif // wxUSE_TREEBOOK
87 wxBookCtrlBase
*GetCurrentBook() const { return m_bookCtrl
; }
90 wxLog
*m_logTargetOld
;
93 wxPanel
*CreateNewPage() const;
94 int TranslateBookFlag(int nb
, int lb
, int chb
, int tbk
, int toolbk
) const;
95 void AddFlagStrIfFlagPresent(wxString
& flagStr
, long flags
, long flag
, const wxChar
* flagName
) const;
108 bool m_chkShowImages
;
113 wxPanel
*m_panel
; // Panel containing notebook and other controls
114 wxBookCtrlBase
*m_bookCtrl
;
121 wxBoxSizer
*m_sizerFrame
;
123 wxImageList
*m_imageList
;
125 DECLARE_EVENT_TABLE()
130 // these should be in the same order as Type_XXX elements above
131 ID_BOOK_NOTEBOOK
= wxID_HIGHEST
,
147 ID_ADD_PAGE_NO_SELECT
,
165 Name of each notebook page.
166 Used as a label for a page, and used when cloning the notebook
167 to decide what type of page it is.
170 #define I_WAS_INSERTED_PAGE_NAME wxT("Inserted")
171 #define RADIOBUTTONS_PAGE_NAME wxT("Radiobuttons")
172 #define VETO_PAGE_NAME wxT("Veto")
173 #define MAXIMIZED_BUTTON_PAGE_NAME wxT("Maximized button")
175 // Pages that can be added by the user
176 #define INSERTED_PAGE_NAME wxT("Inserted ")
177 #define ADDED_PAGE_NAME wxT("Added ")
178 #define ADDED_PAGE_NAME_BEFORE wxT(" Inserted before ")
179 #define ADDED_SUB_PAGE_NAME wxT(" Inserted sub-page ")