1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common dialogs demo
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
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 OnClose(wxCloseEvent
& event
);
37 // A custom modal dialog
38 class MyModalDialog
: public wxDialog
41 MyModalDialog(wxWindow
*parent
);
43 void OnButton(wxCommandEvent
& event
);
46 wxButton
*m_btnFocused
;
47 wxButton
*m_btnDelete
;
52 // Define a new frame type
53 class MyFrame
: public wxFrame
56 MyFrame(wxWindow
*parent
, const wxString
& title
,
57 const wxPoint
& pos
, const wxSize
& size
);
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
);
78 void ShowProgress(wxCommandEvent
& event
);
79 #endif // wxUSE_PROGRESSDLG
81 void ShowFindDialog(wxCommandEvent
& event
);
82 void ShowReplaceDialog(wxCommandEvent
& event
);
84 void OnFindDialog(wxFindDialogEvent
& event
);
85 #endif // wxUSE_FINDREPLDLG
87 #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
88 void ChooseColourGeneric(wxCommandEvent
& event
);
89 void ChooseFontGeneric(wxCommandEvent
& event
);
92 void OnExit(wxCommandEvent
& event
);
94 void OnButton(wxCommandEvent
& event
);
97 MyModelessDialog
*m_dialog
;
100 wxFindReplaceData m_findData
;
101 #endif // wxUSE_FINDREPLDLG
103 DECLARE_EVENT_TABLE()
106 class MyCanvas
: public wxScrolledWindow
109 MyCanvas(wxWindow
*parent
) : wxScrolledWindow(parent
) { }
111 void OnPaint(wxPaintEvent
& event
);
113 DECLARE_EVENT_TABLE()
120 DIALOGS_CHOOSE_COLOUR
= 1,
121 DIALOGS_CHOOSE_COLOUR_GENERIC
,
123 DIALOGS_CHOOSE_FONT_GENERIC
,
125 DIALOGS_SINGLE_CHOICE
,
126 DIALOGS_MULTI_CHOICE
,
128 DIALOGS_PASSWORD_ENTRY
,
134 DIALOGS_GENERIC_DIR_CHOOSE
,
140 DIALOGS_MODELESS_BTN
,