]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: dialogs.h | |
3 | // Purpose: Common dialogs demo | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart and Markus Holzem | |
9 | // Licence: wxWindows license | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __DIALOGSH__ | |
13 | #define __DIALOGSH__ | |
14 | ||
15 | // Define a new application type | |
16 | class MyApp: public wxApp | |
17 | { | |
18 | public: | |
19 | bool OnInit(); | |
20 | ||
21 | wxFont m_canvasFont; | |
22 | wxColour m_canvasTextColour; | |
23 | }; | |
24 | ||
25 | // A custom modeless dialog | |
26 | class MyModelessDialog : public wxDialog | |
27 | { | |
28 | public: | |
29 | MyModelessDialog(wxWindow *parent); | |
30 | ||
31 | void OnButton(wxCommandEvent& event); | |
32 | void OnClose(wxCloseEvent& event); | |
33 | ||
34 | private: | |
35 | DECLARE_EVENT_TABLE() | |
36 | }; | |
37 | ||
38 | // A custom modal dialog | |
39 | class MyModalDialog : public wxDialog | |
40 | { | |
41 | public: | |
42 | MyModalDialog(wxWindow *parent); | |
43 | ||
44 | void OnButton(wxCommandEvent& event); | |
45 | ||
46 | private: | |
47 | wxButton *m_btnFocused; | |
48 | wxButton *m_btnDelete; | |
49 | ||
50 | DECLARE_EVENT_TABLE() | |
51 | }; | |
52 | ||
53 | // Define a new frame type | |
54 | class MyFrame: public wxFrame | |
55 | { | |
56 | public: | |
57 | MyFrame(wxWindow *parent, const wxString& title, | |
58 | const wxPoint& pos, const wxSize& size); | |
59 | ||
60 | void ChooseColour(wxCommandEvent& event); | |
61 | void ChooseFont(wxCommandEvent& event); | |
62 | void LogDialog(wxCommandEvent& event); | |
63 | void MessageBox(wxCommandEvent& event); | |
64 | void SingleChoice(wxCommandEvent& event); | |
65 | void MultiChoice(wxCommandEvent& event); | |
66 | void TextEntry(wxCommandEvent& event); | |
67 | void PasswordEntry(wxCommandEvent& event); | |
68 | void NumericEntry(wxCommandEvent& event); | |
69 | void FileOpen(wxCommandEvent& event); | |
70 | void FileOpen2(wxCommandEvent& event); | |
71 | void FilesOpen(wxCommandEvent& event); | |
72 | void FileSave(wxCommandEvent& event); | |
73 | void DirChoose(wxCommandEvent& event); | |
74 | void GenericDirChoose(wxCommandEvent& event); | |
75 | void ShowTip(wxCommandEvent& event); | |
76 | void ModalDlg(wxCommandEvent& event); | |
77 | void ModelessDlg(wxCommandEvent& event); | |
78 | #if wxUSE_PROGRESSDLG | |
79 | void ShowProgress(wxCommandEvent& event); | |
80 | #endif // wxUSE_PROGRESSDLG | |
81 | #if wxUSE_BUSYINFO | |
82 | void ShowBusyInfo(wxCommandEvent& event); | |
83 | #endif // wxUSE_BUSYINFO | |
84 | #if wxUSE_FINDREPLDLG | |
85 | void ShowFindDialog(wxCommandEvent& event); | |
86 | void ShowReplaceDialog(wxCommandEvent& event); | |
87 | ||
88 | void OnFindDialog(wxFindDialogEvent& event); | |
89 | #endif // wxUSE_FINDREPLDLG | |
90 | ||
91 | #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW | |
92 | void ChooseColourGeneric(wxCommandEvent& event); | |
93 | void ChooseFontGeneric(wxCommandEvent& event); | |
94 | #endif | |
95 | ||
96 | void OnExit(wxCommandEvent& event); | |
97 | ||
98 | private: | |
99 | MyModelessDialog *m_dialog; | |
100 | ||
101 | #if wxUSE_FINDREPLDLG | |
102 | wxFindReplaceData m_findData; | |
103 | #endif // wxUSE_FINDREPLDLG | |
104 | ||
105 | DECLARE_EVENT_TABLE() | |
106 | }; | |
107 | ||
108 | class MyCanvas: public wxScrolledWindow | |
109 | { | |
110 | public: | |
111 | MyCanvas(wxWindow *parent) : wxScrolledWindow(parent) { } | |
112 | ||
113 | void OnPaint(wxPaintEvent& event); | |
114 | ||
115 | DECLARE_EVENT_TABLE() | |
116 | }; | |
117 | ||
118 | ||
119 | // Menu IDs | |
120 | enum | |
121 | { | |
122 | DIALOGS_CHOOSE_COLOUR = 1, | |
123 | DIALOGS_CHOOSE_COLOUR_GENERIC, | |
124 | DIALOGS_CHOOSE_FONT, | |
125 | DIALOGS_CHOOSE_FONT_GENERIC, | |
126 | DIALOGS_MESSAGE_BOX, | |
127 | DIALOGS_SINGLE_CHOICE, | |
128 | DIALOGS_MULTI_CHOICE, | |
129 | DIALOGS_TEXT_ENTRY, | |
130 | DIALOGS_PASSWORD_ENTRY, | |
131 | DIALOGS_FILE_OPEN, | |
132 | DIALOGS_FILE_OPEN2, | |
133 | DIALOGS_FILES_OPEN, | |
134 | DIALOGS_FILE_SAVE, | |
135 | DIALOGS_DIR_CHOOSE, | |
136 | DIALOGS_GENERIC_DIR_CHOOSE, | |
137 | DIALOGS_TIP, | |
138 | DIALOGS_NUM_ENTRY, | |
139 | DIALOGS_LOG_DIALOG, | |
140 | DIALOGS_MODAL, | |
141 | DIALOGS_MODELESS, | |
142 | DIALOGS_MODELESS_BTN, | |
143 | DIALOGS_PROGRESS, | |
144 | DIALOGS_BUSYINFO, | |
145 | DIALOGS_FIND, | |
146 | DIALOGS_REPLACE | |
147 | }; | |
148 | ||
149 | #endif | |
150 |