]>
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"
17 #include "wx/aui/auibook.h"
19 #if wxUSE_LOG && !defined( __SMARTPHONE__ )
25 // Define a new application
26 class MyApp
: public wxApp
35 class MyFrame
: public wxFrame
41 void OnType(wxCommandEvent
& event
);
42 void OnOrient(wxCommandEvent
& event
);
43 void OnShowImages(wxCommandEvent
& event
);
44 void OnStyle(wxCommandEvent
& event
);
45 void OnExit(wxCommandEvent
& event
);
47 void OnAddPage(wxCommandEvent
& event
);
48 void OnAddPageNoSelect(wxCommandEvent
& event
);
49 void OnInsertPage(wxCommandEvent
& event
);
50 void OnDeleteCurPage(wxCommandEvent
& event
);
51 void OnDeleteLastPage(wxCommandEvent
& event
);
52 void OnNextPage(wxCommandEvent
& event
);
53 void OnChangeSelection(wxCommandEvent
&event
);
54 void OnSetSelection(wxCommandEvent
&event
);
56 void OnAddSubPage(wxCommandEvent
& event
);
57 void OnAddPageBefore(wxCommandEvent
& event
);
60 void OnContextHelp(wxCommandEvent
& event
);
63 void OnHitTest(wxCommandEvent
& event
);
65 void OnBookCtrl(wxBookCtrlBaseEvent
& event
);
67 void OnNotebook(wxNotebookEvent
& event
) { OnBookCtrl(event
); }
70 void OnChoicebook(wxChoicebookEvent
& event
) { OnBookCtrl(event
); }
73 void OnListbook(wxListbookEvent
& event
) { OnBookCtrl(event
); }
76 void OnTreebook(wxTreebookEvent
& event
) { OnBookCtrl(event
); }
79 void OnToolbook(wxToolbookEvent
& event
) { OnBookCtrl(event
); }
82 void OnAuiNotebook(wxAuiNotebookEvent
& event
) { OnBookCtrl(event
); }
85 void OnIdle(wxIdleEvent
& event
);
88 void OnUpdateTreeMenu(wxUpdateUIEvent
& event
);
89 #endif // wxUSE_TREEBOOK
91 wxBookCtrlBase
*GetCurrentBook() const { return m_bookCtrl
; }
94 wxLog
*m_logTargetOld
;
97 wxPanel
*CreateNewPage() const;
98 int TranslateBookFlag(int nb
, int lb
, int chb
, int tbk
, int toolbkm
, int aui
) const;
99 void AddFlagStrIfFlagPresent(wxString
& flagStr
, long flags
, long flag
, const wxChar
* flagName
) const;
113 bool m_chkShowImages
;
122 wxPanel
*m_panel
; // Panel containing notebook and other controls
123 wxBookCtrlBase
*m_bookCtrl
;
130 wxBoxSizer
*m_sizerFrame
;
132 wxImageList
*m_imageList
;
134 DECLARE_EVENT_TABLE()
139 // these should be in the same order as Type_XXX elements above
140 ID_BOOK_NOTEBOOK
= wxID_HIGHEST
,
161 ID_ADD_PAGE_NO_SELECT
,
179 Name of each notebook page.
180 Used as a label for a page, and used when cloning the notebook
181 to decide what type of page it is.
184 #define I_WAS_INSERTED_PAGE_NAME wxT("Inserted")
185 #define RADIOBUTTONS_PAGE_NAME wxT("Radiobuttons")
186 #define VETO_PAGE_NAME wxT("Veto")
187 #define MAXIMIZED_BUTTON_PAGE_NAME wxT("Maximized button")
189 // Pages that can be added by the user
190 #define INSERTED_PAGE_NAME wxT("Inserted ")
191 #define ADDED_PAGE_NAME wxT("Added ")
192 #define ADDED_PAGE_NAME_BEFORE wxT(" Inserted before ")
193 #define ADDED_SUB_PAGE_NAME wxT(" Inserted sub-page ")