]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/dialogs/dialogs.h
don't try to refresh the menu bar before showing it, fixes crash on startup with...
[wxWidgets.git] / samples / dialogs / dialogs.h
... / ...
CommitLineData
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
16class MyApp: public wxApp
17{
18public:
19 bool OnInit();
20
21 wxFont m_canvasFont;
22 wxColour m_canvasTextColour;
23};
24
25// A custom modeless dialog
26class MyModelessDialog : public wxDialog
27{
28public:
29 MyModelessDialog(wxWindow *parent);
30
31 void OnClose(wxCloseEvent& event);
32
33private:
34 DECLARE_EVENT_TABLE()
35};
36
37// A custom modal dialog
38class MyModalDialog : public wxDialog
39{
40public:
41 MyModalDialog(wxWindow *parent);
42
43 void OnButton(wxCommandEvent& event);
44
45private:
46 wxButton *m_btnFocused;
47 wxButton *m_btnDelete;
48
49 DECLARE_EVENT_TABLE()
50};
51
52// Define a new frame type
53class MyFrame: public wxFrame
54{
55public:
56 MyFrame(wxWindow *parent, const wxString& title,
57 const wxPoint& pos, const wxSize& size);
58
59 void ChooseColour(wxCommandEvent& event);
60 void ChooseFont(wxCommandEvent& event);
61 void LogDialog(wxCommandEvent& event);
62 void MessageBox(wxCommandEvent& event);
63 void SingleChoice(wxCommandEvent& event);
64 void MultiChoice(wxCommandEvent& event);
65 void TextEntry(wxCommandEvent& event);
66 void PasswordEntry(wxCommandEvent& event);
67 void NumericEntry(wxCommandEvent& event);
68 void FileOpen(wxCommandEvent& event);
69 void FileOpen2(wxCommandEvent& event);
70 void FilesOpen(wxCommandEvent& event);
71 void FileSave(wxCommandEvent& event);
72 void DirChoose(wxCommandEvent& event);
73 void GenericDirChoose(wxCommandEvent& event);
74 void ShowTip(wxCommandEvent& event);
75 void ModalDlg(wxCommandEvent& event);
76 void ModelessDlg(wxCommandEvent& event);
77#if wxUSE_PROGRESSDLG
78 void ShowProgress(wxCommandEvent& event);
79#endif // wxUSE_PROGRESSDLG
80#if wxUSE_FINDREPLDLG
81 void ShowFindDialog(wxCommandEvent& event);
82 void ShowReplaceDialog(wxCommandEvent& event);
83
84 void OnFindDialog(wxFindDialogEvent& event);
85#endif // wxUSE_FINDREPLDLG
86
87#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
88 void ChooseColourGeneric(wxCommandEvent& event);
89 void ChooseFontGeneric(wxCommandEvent& event);
90#endif
91
92 void OnExit(wxCommandEvent& event);
93
94 void OnButton(wxCommandEvent& event);
95
96private:
97 MyModelessDialog *m_dialog;
98
99#if wxUSE_FINDREPLDLG
100 wxFindReplaceData m_findData;
101#endif // wxUSE_FINDREPLDLG
102
103 DECLARE_EVENT_TABLE()
104};
105
106class MyCanvas: public wxScrolledWindow
107{
108public:
109 MyCanvas(wxWindow *parent) : wxScrolledWindow(parent) { }
110
111 void OnPaint(wxPaintEvent& event);
112
113 DECLARE_EVENT_TABLE()
114};
115
116
117// Menu IDs
118enum
119{
120 DIALOGS_CHOOSE_COLOUR = 1,
121 DIALOGS_CHOOSE_COLOUR_GENERIC,
122 DIALOGS_CHOOSE_FONT,
123 DIALOGS_CHOOSE_FONT_GENERIC,
124 DIALOGS_MESSAGE_BOX,
125 DIALOGS_SINGLE_CHOICE,
126 DIALOGS_MULTI_CHOICE,
127 DIALOGS_TEXT_ENTRY,
128 DIALOGS_PASSWORD_ENTRY,
129 DIALOGS_FILE_OPEN,
130 DIALOGS_FILE_OPEN2,
131 DIALOGS_FILES_OPEN,
132 DIALOGS_FILE_SAVE,
133 DIALOGS_DIR_CHOOSE,
134 DIALOGS_GENERIC_DIR_CHOOSE,
135 DIALOGS_TIP,
136 DIALOGS_NUM_ENTRY,
137 DIALOGS_LOG_DIALOG,
138 DIALOGS_MODAL,
139 DIALOGS_MODELESS,
140 DIALOGS_MODELESS_BTN,
141 DIALOGS_PROGRESS,
142 DIALOGS_FIND,
143 DIALOGS_REPLACE
144};
145
146#endif
147