]>
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 modeless dialog | |
26 | class MyModelessDialog : public wxDialog | |
27 | { | |
28 | public: | |
29 | MyModelessDialog(wxWindow *parent); | |
30 | }; | |
31 | ||
32 | // Define a new frame type | |
33 | class MyFrame: public wxFrame | |
34 | { | |
35 | public: | |
36 | MyFrame(wxWindow *parent, const wxString& title, | |
37 | const wxPoint& pos, const wxSize& size); | |
38 | ||
39 | void ChooseColour(wxCommandEvent& event); | |
40 | void ChooseFont(wxCommandEvent& event); | |
41 | void LogDialog(wxCommandEvent& event); | |
42 | void MessageBox(wxCommandEvent& event); | |
43 | void SingleChoice(wxCommandEvent& event); | |
44 | void TextEntry(wxCommandEvent& event); | |
45 | void PasswordEntry(wxCommandEvent& event); | |
46 | void NumericEntry(wxCommandEvent& event); | |
47 | void FileOpen(wxCommandEvent& event); | |
48 | void FilesOpen(wxCommandEvent& event); | |
49 | void FileSave(wxCommandEvent& event); | |
50 | void DirChoose(wxCommandEvent& event); | |
51 | void ShowTip(wxCommandEvent& event); | |
52 | void ModelessDlg(wxCommandEvent& event); | |
53 | ||
54 | #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW | |
55 | void ChooseColourGeneric(wxCommandEvent& event); | |
56 | void ChooseFontGeneric(wxCommandEvent& event); | |
57 | #endif | |
58 | ||
59 | void OnExit(wxCommandEvent& event); | |
60 | ||
61 | void OnButton(wxCommandEvent& event); | |
62 | ||
63 | private: | |
64 | MyModelessDialog *m_dialog; | |
65 | ||
66 | DECLARE_EVENT_TABLE() | |
67 | }; | |
68 | ||
69 | class MyCanvas: public wxScrolledWindow | |
70 | { | |
71 | public: | |
72 | MyCanvas(wxWindow *parent) : wxScrolledWindow(parent) { } | |
73 | ||
74 | void OnPaint(wxPaintEvent& event); | |
75 | ||
76 | DECLARE_EVENT_TABLE() | |
77 | }; | |
78 | ||
79 | ||
80 | // Menu IDs | |
81 | enum | |
82 | { | |
83 | DIALOGS_CHOOSE_COLOUR = 1, | |
84 | DIALOGS_CHOOSE_COLOUR_GENERIC, | |
85 | DIALOGS_CHOOSE_FONT, | |
86 | DIALOGS_CHOOSE_FONT_GENERIC, | |
87 | DIALOGS_MESSAGE_BOX, | |
88 | DIALOGS_SINGLE_CHOICE, | |
89 | DIALOGS_TEXT_ENTRY, | |
90 | DIALOGS_PASSWORD_ENTRY, | |
91 | DIALOGS_FILE_OPEN, | |
92 | DIALOGS_FILES_OPEN, | |
93 | DIALOGS_FILE_SAVE, | |
94 | DIALOGS_DIR_CHOOSE, | |
95 | DIALOGS_TIP, | |
96 | DIALOGS_NUM_ENTRY, | |
97 | DIALOGS_LOG_DIALOG, | |
98 | DIALOGS_MODELESS, | |
99 | DIALOGS_MODELESS_BTN | |
100 | }; | |
101 | ||
102 | #endif | |
103 |