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