]> git.saurik.com Git - wxWidgets.git/blame - samples/notebook/test.h
Fixed the GUI so it will now work correctly when widgets are clicked/used. This...
[wxWidgets.git] / samples / notebook / test.h
CommitLineData
0b4d4194
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: test.h
3// Purpose: wxNotebook demo
4// Author: Julian Smart
5// Modified by:
6// Created: 25/10/98
7// RCS-ID: $Id$
8// Copyright: (c)
d22699b5 9// Licence: wxWindows licence
0b4d4194
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#include <wx/notebook.h>
13
14// Define a new application
15class MyApp: public wxApp
16{
17public:
18 bool OnInit(void);
d22699b5 19 void InitTabView(wxNotebook* notebook, wxPanel* window);
0b4d4194
JS
20
21 wxButton* m_okButton;
22 wxButton* m_cancelButton;
326f9654 23 wxButton* m_addPageButton;
0b4d4194
JS
24};
25
26DECLARE_APP(MyApp)
27
d22699b5
VZ
28#if USE_TABBED_DIALOG
29
0b4d4194
JS
30class MyDialog: public wxDialog
31{
32public:
33 MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
34 const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_DIALOG_STYLE);
35
36 void OnOK(wxCommandEvent& event);
37 void OnCloseWindow(wxCloseEvent& event);
38 void Init(void);
39
40protected:
41 wxNotebook* m_notebook;
42
d22699b5 43 DECLARE_EVENT_TABLE()
0b4d4194
JS
44};
45
d22699b5
VZ
46#else // USE_TABBED_DIALOG
47
0b4d4194
JS
48class MyFrame: public wxFrame
49{
50public:
51 MyFrame(wxFrame* parent, const wxWindowID id, const wxString& title,
52 const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_FRAME_STYLE);
53
54 void OnOK(wxCommandEvent& event);
55 void OnCloseWindow(wxCloseEvent& event);
326f9654 56 void OnAddPage(wxCommandEvent& event);
29f538ce 57 void OnDeletePage(wxCommandEvent& event);
96d37807
VZ
58 void OnIdle(wxIdleEvent& event);
59
60 void Init();
61
0b4d4194
JS
62protected:
63 wxNotebook* m_notebook;
64 wxPanel* m_panel; // Panel containing notebook and OK/Cancel/Help
65
d22699b5 66 DECLARE_EVENT_TABLE()
0b4d4194
JS
67};
68
d22699b5
VZ
69#endif // USE_TABBED_DIALOG
70
0b4d4194
JS
71// File ids
72#define TEST_ABOUT 2
73
74// Tab ids
75#define TEST_TAB_DOG 1
76#define TEST_TAB_CAT 2
77#define TEST_TAB_GOAT 3
78#define TEST_TAB_GUINEAPIG 4
79#define TEST_TAB_ANTEATER 5
80#define TEST_TAB_HUMMINGBIRD 6
81#define TEST_TAB_SHEEP 7
82#define TEST_TAB_COW 8
83#define TEST_TAB_HORSE 9
84#define TEST_TAB_PIG 10
85#define TEST_TAB_OSTRICH 11
86#define TEST_TAB_AARDVARK 12
87
88#define ID_NOTEBOOK 1000
326f9654 89#define ID_ADD_PAGE 1200
29f538ce 90#define ID_DELETE_PAGE 1201
0b4d4194 91