]>
Commit | Line | Data |
---|---|---|
457814b5 JS |
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 | |
c49245f8 | 9 | // Licence: wxWindows license |
457814b5 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __DIALOGSH__ | |
13 | #define __DIALOGSH__ | |
14 | ||
15 | // Define a new application type | |
16 | class MyApp: public wxApp | |
c49245f8 VZ |
17 | { |
18 | public: | |
19 | bool OnInit(); | |
457814b5 JS |
20 | |
21 | wxFont m_canvasFont; | |
22 | wxColour m_canvasTextColour; | |
23 | }; | |
24 | ||
f6bcfd97 | 25 | // A custom modeless dialog |
4c45f240 VZ |
26 | class MyModelessDialog : public wxDialog |
27 | { | |
28 | public: | |
29 | MyModelessDialog(wxWindow *parent); | |
abceee76 | 30 | |
5d987909 | 31 | void OnButton(wxCommandEvent& event); |
abceee76 VZ |
32 | void OnClose(wxCloseEvent& event); |
33 | ||
34 | private: | |
35 | DECLARE_EVENT_TABLE() | |
4c45f240 VZ |
36 | }; |
37 | ||
f6bcfd97 BP |
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 | ||
457814b5 JS |
53 | // Define a new frame type |
54 | class MyFrame: public wxFrame | |
c49245f8 VZ |
55 | { |
56 | public: | |
57 | MyFrame(wxWindow *parent, const wxString& title, | |
58 | const wxPoint& pos, const wxSize& size); | |
457814b5 | 59 | |
329e86bf RR |
60 | void ChooseColour(wxCommandEvent& event); |
61 | void ChooseFont(wxCommandEvent& event); | |
d93c719a | 62 | void LogDialog(wxCommandEvent& event); |
457814b5 JS |
63 | void MessageBox(wxCommandEvent& event); |
64 | void SingleChoice(wxCommandEvent& event); | |
d6c9c1b7 | 65 | void MultiChoice(wxCommandEvent& event); |
457814b5 | 66 | void TextEntry(wxCommandEvent& event); |
a294c6d5 | 67 | void PasswordEntry(wxCommandEvent& event); |
c49245f8 | 68 | void NumericEntry(wxCommandEvent& event); |
457814b5 | 69 | void FileOpen(wxCommandEvent& event); |
35b45b33 | 70 | void FileOpen2(wxCommandEvent& event); |
c61f4f6d | 71 | void FilesOpen(wxCommandEvent& event); |
457814b5 JS |
72 | void FileSave(wxCommandEvent& event); |
73 | void DirChoose(wxCommandEvent& event); | |
51a58d8b | 74 | void GenericDirChoose(wxCommandEvent& event); |
c50f1fb9 | 75 | void ShowTip(wxCommandEvent& event); |
f6bcfd97 | 76 | void ModalDlg(wxCommandEvent& event); |
4c45f240 | 77 | void ModelessDlg(wxCommandEvent& event); |
761989ff | 78 | #if wxUSE_PROGRESSDLG |
abceee76 | 79 | void ShowProgress(wxCommandEvent& event); |
761989ff VZ |
80 | #endif // wxUSE_PROGRESSDLG |
81 | #if wxUSE_FINDREPLDLG | |
82 | void ShowFindDialog(wxCommandEvent& event); | |
83 | void ShowReplaceDialog(wxCommandEvent& event); | |
84 | ||
85 | void OnFindDialog(wxFindDialogEvent& event); | |
86 | #endif // wxUSE_FINDREPLDLG | |
457814b5 | 87 | |
dfad0599 | 88 | #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW |
329e86bf RR |
89 | void ChooseColourGeneric(wxCommandEvent& event); |
90 | void ChooseFontGeneric(wxCommandEvent& event); | |
457814b5 | 91 | #endif |
c49245f8 | 92 | |
329e86bf | 93 | void OnExit(wxCommandEvent& event); |
c49245f8 | 94 | |
4c45f240 VZ |
95 | private: |
96 | MyModelessDialog *m_dialog; | |
97 | ||
761989ff VZ |
98 | #if wxUSE_FINDREPLDLG |
99 | wxFindReplaceData m_findData; | |
100 | #endif // wxUSE_FINDREPLDLG | |
101 | ||
4c45f240 | 102 | DECLARE_EVENT_TABLE() |
457814b5 JS |
103 | }; |
104 | ||
105 | class MyCanvas: public wxScrolledWindow | |
106 | { | |
c49245f8 VZ |
107 | public: |
108 | MyCanvas(wxWindow *parent) : wxScrolledWindow(parent) { } | |
109 | ||
110 | void OnPaint(wxPaintEvent& event); | |
111 | ||
112 | DECLARE_EVENT_TABLE() | |
457814b5 JS |
113 | }; |
114 | ||
115 | ||
116 | // Menu IDs | |
a294c6d5 VZ |
117 | enum |
118 | { | |
119 | DIALOGS_CHOOSE_COLOUR = 1, | |
120 | DIALOGS_CHOOSE_COLOUR_GENERIC, | |
121 | DIALOGS_CHOOSE_FONT, | |
122 | DIALOGS_CHOOSE_FONT_GENERIC, | |
123 | DIALOGS_MESSAGE_BOX, | |
124 | DIALOGS_SINGLE_CHOICE, | |
d6c9c1b7 | 125 | DIALOGS_MULTI_CHOICE, |
a294c6d5 VZ |
126 | DIALOGS_TEXT_ENTRY, |
127 | DIALOGS_PASSWORD_ENTRY, | |
128 | DIALOGS_FILE_OPEN, | |
35b45b33 | 129 | DIALOGS_FILE_OPEN2, |
a294c6d5 VZ |
130 | DIALOGS_FILES_OPEN, |
131 | DIALOGS_FILE_SAVE, | |
132 | DIALOGS_DIR_CHOOSE, | |
51a58d8b | 133 | DIALOGS_GENERIC_DIR_CHOOSE, |
a294c6d5 VZ |
134 | DIALOGS_TIP, |
135 | DIALOGS_NUM_ENTRY, | |
4c45f240 | 136 | DIALOGS_LOG_DIALOG, |
f6bcfd97 | 137 | DIALOGS_MODAL, |
4c45f240 | 138 | DIALOGS_MODELESS, |
abceee76 | 139 | DIALOGS_MODELESS_BTN, |
761989ff VZ |
140 | DIALOGS_PROGRESS, |
141 | DIALOGS_FIND, | |
142 | DIALOGS_REPLACE | |
a294c6d5 | 143 | }; |
457814b5 JS |
144 | |
145 | #endif | |
146 |