]>
git.saurik.com Git - wxWidgets.git/blob - samples/notebook/notebook.h
0a10dcbb2d85904e4ab8b1661c60852053e28c8c
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 wxWindows team
9 // License: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/notebook.h"
14 // Define a new application
15 class MyApp
: public wxApp
24 class MyNotebook
: public wxNotebook
27 MyNotebook(wxWindow
*parent
, wxWindowID id
= -1,
28 const wxPoint
& pos
= wxDefaultPosition
,
29 const wxSize
& size
= wxDefaultSize
, long style
= 0);
31 void CreateInitialPages();
33 int GetIconIndex() const;
37 class MyFrame
: public wxFrame
40 MyFrame(const wxString
& title
, const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
, long style
= wxDEFAULT_FRAME_STYLE
);
45 // Recreates the notebook with the same pages, but with possibly
46 // a different orientation and optionally with images.
47 void ReInitNotebook();
49 void CreateImageList();
51 void OnCheckOrRadioBox(wxCommandEvent
& event
);
53 void OnButtonAddPage(wxCommandEvent
& event
);
54 void OnButtonInsertPage(wxCommandEvent
& event
);
55 void OnButtonDeletePage(wxCommandEvent
& event
);
56 void OnButtonNextPage(wxCommandEvent
& event
);
58 void OnButtonExit(wxCommandEvent
& event
);
60 void OnNotebook(wxNotebookEvent
& event
);
62 void OnIdle(wxIdleEvent
& event
);
66 wxLog
*m_logTargetOld
;
71 wxPanel
*m_panel
; // Panel containing notebook and other controls
73 wxRadioBox
*m_radioOrient
;
74 wxCheckBox
*m_chkShowImages
;
76 wxButton
*m_btnAddPage
;
77 wxButton
*m_btnInsertPage
;
78 wxButton
*m_btnDeletePage
;
79 wxButton
*m_btnNextPage
;
82 MyNotebook
*m_notebook
;
90 // The frame's sizer. Consists of m_sizerTop and the log window
92 wxBoxSizer
*m_sizerFrame
;
94 // Sizer that contains the notebook and controls on the left
95 wxBoxSizer
*m_sizerTop
;
97 // Sizer for m_notebook
98 wxNotebookSizer
*m_sizerNotebook
;
100 wxImageList
*m_imageList
;
102 DECLARE_EVENT_TABLE()
107 ID_RADIO_ORIENT
= wxID_HIGHEST
,
116 // notebook orientations