]> git.saurik.com Git - wxWidgets.git/blame - samples/dialogs/dialogs.h
Compilation fix
[wxWidgets.git] / samples / dialogs / dialogs.h
CommitLineData
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$
6aa89a22 8// Copyright: (c) Julian Smart
c49245f8 9// Licence: wxWindows license
457814b5
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __DIALOGSH__
13#define __DIALOGSH__
14
15// Define a new application type
16class MyApp: public wxApp
c49245f8
VZ
17{
18public:
19 bool OnInit();
457814b5
JS
20
21 wxFont m_canvasFont;
22 wxColour m_canvasTextColour;
23};
24
f6bcfd97 25// A custom modeless dialog
4c45f240
VZ
26class MyModelessDialog : public wxDialog
27{
28public:
29 MyModelessDialog(wxWindow *parent);
abceee76 30
5d987909 31 void OnButton(wxCommandEvent& event);
abceee76
VZ
32 void OnClose(wxCloseEvent& event);
33
34private:
35 DECLARE_EVENT_TABLE()
4c45f240
VZ
36};
37
f6bcfd97
BP
38// A custom modal dialog
39class MyModalDialog : public wxDialog
40{
41public:
42 MyModalDialog(wxWindow *parent);
43
44 void OnButton(wxCommandEvent& event);
45
46private:
5315ebfa
VZ
47 wxButton *m_btnModal,
48 *m_btnModeless,
49 *m_btnDelete;
f6bcfd97
BP
50
51 DECLARE_EVENT_TABLE()
52};
53
457814b5
JS
54// Define a new frame type
55class MyFrame: public wxFrame
c49245f8
VZ
56{
57public:
58 MyFrame(wxWindow *parent, const wxString& title,
59 const wxPoint& pos, const wxSize& size);
457814b5 60
329e86bf
RR
61 void ChooseColour(wxCommandEvent& event);
62 void ChooseFont(wxCommandEvent& event);
d93c719a 63 void LogDialog(wxCommandEvent& event);
457814b5
JS
64 void MessageBox(wxCommandEvent& event);
65 void SingleChoice(wxCommandEvent& event);
d6c9c1b7 66 void MultiChoice(wxCommandEvent& event);
457814b5 67 void TextEntry(wxCommandEvent& event);
a294c6d5 68 void PasswordEntry(wxCommandEvent& event);
c49245f8 69 void NumericEntry(wxCommandEvent& event);
457814b5 70 void FileOpen(wxCommandEvent& event);
35b45b33 71 void FileOpen2(wxCommandEvent& event);
c61f4f6d 72 void FilesOpen(wxCommandEvent& event);
457814b5
JS
73 void FileSave(wxCommandEvent& event);
74 void DirChoose(wxCommandEvent& event);
f09c8393 75 void DirChooseNew(wxCommandEvent& event);
51a58d8b 76 void GenericDirChoose(wxCommandEvent& event);
c50f1fb9 77 void ShowTip(wxCommandEvent& event);
f6bcfd97 78 void ModalDlg(wxCommandEvent& event);
4c45f240 79 void ModelessDlg(wxCommandEvent& event);
761989ff 80#if wxUSE_PROGRESSDLG
abceee76 81 void ShowProgress(wxCommandEvent& event);
761989ff 82#endif // wxUSE_PROGRESSDLG
a62b0bcc
VZ
83#if wxUSE_BUSYINFO
84 void ShowBusyInfo(wxCommandEvent& event);
85#endif // wxUSE_BUSYINFO
761989ff
VZ
86#if wxUSE_FINDREPLDLG
87 void ShowFindDialog(wxCommandEvent& event);
88 void ShowReplaceDialog(wxCommandEvent& event);
89
90 void OnFindDialog(wxFindDialogEvent& event);
91#endif // wxUSE_FINDREPLDLG
457814b5 92
dfad0599 93#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
329e86bf
RR
94 void ChooseColourGeneric(wxCommandEvent& event);
95 void ChooseFontGeneric(wxCommandEvent& event);
457814b5 96#endif
c49245f8 97
329e86bf 98 void OnExit(wxCommandEvent& event);
c49245f8 99
4c45f240 100private:
f09c8393
VZ
101 void DoDirChoose(int style);
102
4c45f240
VZ
103 MyModelessDialog *m_dialog;
104
761989ff
VZ
105#if wxUSE_FINDREPLDLG
106 wxFindReplaceData m_findData;
14fca738
VZ
107
108 wxFindReplaceDialog *m_dlgFind,
109 *m_dlgReplace;
761989ff
VZ
110#endif // wxUSE_FINDREPLDLG
111
4c45f240 112 DECLARE_EVENT_TABLE()
457814b5
JS
113};
114
115class MyCanvas: public wxScrolledWindow
116{
c49245f8 117public:
c2c0dabf
RR
118 MyCanvas(wxWindow *parent) :
119 wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
c49245f8
VZ
120
121 void OnPaint(wxPaintEvent& event);
122
123 DECLARE_EVENT_TABLE()
457814b5
JS
124};
125
126
127// Menu IDs
a294c6d5
VZ
128enum
129{
130 DIALOGS_CHOOSE_COLOUR = 1,
131 DIALOGS_CHOOSE_COLOUR_GENERIC,
132 DIALOGS_CHOOSE_FONT,
133 DIALOGS_CHOOSE_FONT_GENERIC,
134 DIALOGS_MESSAGE_BOX,
135 DIALOGS_SINGLE_CHOICE,
d6c9c1b7 136 DIALOGS_MULTI_CHOICE,
a294c6d5
VZ
137 DIALOGS_TEXT_ENTRY,
138 DIALOGS_PASSWORD_ENTRY,
139 DIALOGS_FILE_OPEN,
35b45b33 140 DIALOGS_FILE_OPEN2,
a294c6d5
VZ
141 DIALOGS_FILES_OPEN,
142 DIALOGS_FILE_SAVE,
143 DIALOGS_DIR_CHOOSE,
f09c8393 144 DIALOGS_DIRNEW_CHOOSE,
51a58d8b 145 DIALOGS_GENERIC_DIR_CHOOSE,
a294c6d5
VZ
146 DIALOGS_TIP,
147 DIALOGS_NUM_ENTRY,
4c45f240 148 DIALOGS_LOG_DIALOG,
f6bcfd97 149 DIALOGS_MODAL,
4c45f240 150 DIALOGS_MODELESS,
abceee76 151 DIALOGS_MODELESS_BTN,
761989ff 152 DIALOGS_PROGRESS,
a62b0bcc 153 DIALOGS_BUSYINFO,
761989ff
VZ
154 DIALOGS_FIND,
155 DIALOGS_REPLACE
a294c6d5 156};
457814b5
JS
157
158#endif
159