1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common dialogs demo
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 // Define a new application type
16 class MyApp
: public wxApp
22 wxColour m_canvasTextColour
;
25 // A custom modeless dialog
26 class MyModelessDialog
: public wxDialog
29 MyModelessDialog(wxWindow
*parent
);
31 void OnButton(wxCommandEvent
& event
);
32 void OnClose(wxCloseEvent
& event
);
38 // A custom modal dialog
39 class MyModalDialog
: public wxDialog
42 MyModalDialog(wxWindow
*parent
);
44 void OnButton(wxCommandEvent
& event
);
54 // Define a new frame type
55 class MyFrame
: public wxFrame
58 MyFrame(wxWindow
*parent
, const wxString
& title
,
59 const wxPoint
& pos
, const wxSize
& size
);
61 void ChooseColour(wxCommandEvent
& event
);
62 void ChooseFont(wxCommandEvent
& event
);
63 void LogDialog(wxCommandEvent
& event
);
64 void MessageBox(wxCommandEvent
& event
);
65 void SingleChoice(wxCommandEvent
& event
);
66 void MultiChoice(wxCommandEvent
& event
);
67 void TextEntry(wxCommandEvent
& event
);
68 void PasswordEntry(wxCommandEvent
& event
);
69 void NumericEntry(wxCommandEvent
& event
);
70 void FileOpen(wxCommandEvent
& event
);
71 void FileOpen2(wxCommandEvent
& event
);
72 void FilesOpen(wxCommandEvent
& event
);
73 void FileSave(wxCommandEvent
& event
);
74 void DirChoose(wxCommandEvent
& event
);
75 void DirChooseNew(wxCommandEvent
& event
);
76 void GenericDirChoose(wxCommandEvent
& event
);
77 void ShowTip(wxCommandEvent
& event
);
78 void ModalDlg(wxCommandEvent
& event
);
79 void ModelessDlg(wxCommandEvent
& event
);
81 void ShowProgress(wxCommandEvent
& event
);
82 #endif // wxUSE_PROGRESSDLG
84 void ShowBusyInfo(wxCommandEvent
& event
);
85 #endif // wxUSE_BUSYINFO
87 void ShowFindDialog(wxCommandEvent
& event
);
88 void ShowReplaceDialog(wxCommandEvent
& event
);
90 void OnFindDialog(wxFindDialogEvent
& event
);
91 #endif // wxUSE_FINDREPLDLG
93 #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
94 void ChooseColourGeneric(wxCommandEvent
& event
);
95 void ChooseFontGeneric(wxCommandEvent
& event
);
98 void OnExit(wxCommandEvent
& event
);
101 void DoDirChoose(int style
);
103 MyModelessDialog
*m_dialog
;
105 #if wxUSE_FINDREPLDLG
106 wxFindReplaceData m_findData
;
108 wxFindReplaceDialog
*m_dlgFind
,
110 #endif // wxUSE_FINDREPLDLG
112 DECLARE_EVENT_TABLE()
115 class MyCanvas
: public wxScrolledWindow
118 MyCanvas(wxWindow
*parent
) :
119 wxScrolledWindow(parent
,-1,wxDefaultPosition
,wxDefaultSize
,wxNO_FULL_REPAINT_ON_RESIZE
) { }
121 void OnPaint(wxPaintEvent
& event
);
123 DECLARE_EVENT_TABLE()
130 DIALOGS_CHOOSE_COLOUR
= 1,
131 DIALOGS_CHOOSE_COLOUR_GENERIC
,
133 DIALOGS_CHOOSE_FONT_GENERIC
,
135 DIALOGS_SINGLE_CHOICE
,
136 DIALOGS_MULTI_CHOICE
,
138 DIALOGS_PASSWORD_ENTRY
,
144 DIALOGS_DIRNEW_CHOOSE
,
145 DIALOGS_GENERIC_DIR_CHOOSE
,
151 DIALOGS_MODELESS_BTN
,