]> git.saurik.com Git - wxWidgets.git/blame - samples/dialogs/dialogs.h
changed C++ comments in C comments
[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$
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
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:
47 wxButton *m_btnFocused;
48 wxButton *m_btnDelete;
49
50 DECLARE_EVENT_TABLE()
51};
52
457814b5
JS
53// Define a new frame type
54class MyFrame: public wxFrame
c49245f8
VZ
55{
56public:
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);
f09c8393 74 void DirChooseNew(wxCommandEvent& event);
51a58d8b 75 void GenericDirChoose(wxCommandEvent& event);
c50f1fb9 76 void ShowTip(wxCommandEvent& event);
f6bcfd97 77 void ModalDlg(wxCommandEvent& event);
4c45f240 78 void ModelessDlg(wxCommandEvent& event);
761989ff 79#if wxUSE_PROGRESSDLG
abceee76 80 void ShowProgress(wxCommandEvent& event);
761989ff 81#endif // wxUSE_PROGRESSDLG
a62b0bcc
VZ
82#if wxUSE_BUSYINFO
83 void ShowBusyInfo(wxCommandEvent& event);
84#endif // wxUSE_BUSYINFO
761989ff
VZ
85#if wxUSE_FINDREPLDLG
86 void ShowFindDialog(wxCommandEvent& event);
87 void ShowReplaceDialog(wxCommandEvent& event);
88
89 void OnFindDialog(wxFindDialogEvent& event);
90#endif // wxUSE_FINDREPLDLG
457814b5 91
dfad0599 92#if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
329e86bf
RR
93 void ChooseColourGeneric(wxCommandEvent& event);
94 void ChooseFontGeneric(wxCommandEvent& event);
457814b5 95#endif
c49245f8 96
329e86bf 97 void OnExit(wxCommandEvent& event);
c49245f8 98
4c45f240 99private:
f09c8393
VZ
100 void DoDirChoose(int style);
101
4c45f240
VZ
102 MyModelessDialog *m_dialog;
103
761989ff
VZ
104#if wxUSE_FINDREPLDLG
105 wxFindReplaceData m_findData;
14fca738
VZ
106
107 wxFindReplaceDialog *m_dlgFind,
108 *m_dlgReplace;
761989ff
VZ
109#endif // wxUSE_FINDREPLDLG
110
4c45f240 111 DECLARE_EVENT_TABLE()
457814b5
JS
112};
113
114class MyCanvas: public wxScrolledWindow
115{
c49245f8 116public:
c2c0dabf
RR
117 MyCanvas(wxWindow *parent) :
118 wxScrolledWindow(parent,-1,wxDefaultPosition,wxDefaultSize,wxNO_FULL_REPAINT_ON_RESIZE) { }
c49245f8
VZ
119
120 void OnPaint(wxPaintEvent& event);
121
122 DECLARE_EVENT_TABLE()
457814b5
JS
123};
124
125
126// Menu IDs
a294c6d5
VZ
127enum
128{
129 DIALOGS_CHOOSE_COLOUR = 1,
130 DIALOGS_CHOOSE_COLOUR_GENERIC,
131 DIALOGS_CHOOSE_FONT,
132 DIALOGS_CHOOSE_FONT_GENERIC,
133 DIALOGS_MESSAGE_BOX,
134 DIALOGS_SINGLE_CHOICE,
d6c9c1b7 135 DIALOGS_MULTI_CHOICE,
a294c6d5
VZ
136 DIALOGS_TEXT_ENTRY,
137 DIALOGS_PASSWORD_ENTRY,
138 DIALOGS_FILE_OPEN,
35b45b33 139 DIALOGS_FILE_OPEN2,
a294c6d5
VZ
140 DIALOGS_FILES_OPEN,
141 DIALOGS_FILE_SAVE,
142 DIALOGS_DIR_CHOOSE,
f09c8393 143 DIALOGS_DIRNEW_CHOOSE,
51a58d8b 144 DIALOGS_GENERIC_DIR_CHOOSE,
a294c6d5
VZ
145 DIALOGS_TIP,
146 DIALOGS_NUM_ENTRY,
4c45f240 147 DIALOGS_LOG_DIALOG,
f6bcfd97 148 DIALOGS_MODAL,
4c45f240 149 DIALOGS_MODELESS,
abceee76 150 DIALOGS_MODELESS_BTN,
761989ff 151 DIALOGS_PROGRESS,
a62b0bcc 152 DIALOGS_BUSYINFO,
761989ff
VZ
153 DIALOGS_FIND,
154 DIALOGS_REPLACE
a294c6d5 155};
457814b5
JS
156
157#endif
158