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
;
26 class MyModelessDialog
: public wxDialog
29 MyModelessDialog(wxWindow
*parent
);
31 void OnClose(wxCloseEvent
& event
);
37 // Define a new frame type
38 class MyFrame
: public wxFrame
41 MyFrame(wxWindow
*parent
, const wxString
& title
,
42 const wxPoint
& pos
, const wxSize
& size
);
44 void ChooseColour(wxCommandEvent
& event
);
45 void ChooseFont(wxCommandEvent
& event
);
46 void LogDialog(wxCommandEvent
& event
);
47 void MessageBox(wxCommandEvent
& event
);
48 void SingleChoice(wxCommandEvent
& event
);
49 void TextEntry(wxCommandEvent
& event
);
50 void PasswordEntry(wxCommandEvent
& event
);
51 void NumericEntry(wxCommandEvent
& event
);
52 void FileOpen(wxCommandEvent
& event
);
53 void FilesOpen(wxCommandEvent
& event
);
54 void FileSave(wxCommandEvent
& event
);
55 void DirChoose(wxCommandEvent
& event
);
56 void ShowTip(wxCommandEvent
& event
);
57 void ModelessDlg(wxCommandEvent
& event
);
58 void ShowProgress(wxCommandEvent
& event
);
60 #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW
61 void ChooseColourGeneric(wxCommandEvent
& event
);
62 void ChooseFontGeneric(wxCommandEvent
& event
);
65 void OnExit(wxCommandEvent
& event
);
67 void OnButton(wxCommandEvent
& event
);
70 MyModelessDialog
*m_dialog
;
75 class MyCanvas
: public wxScrolledWindow
78 MyCanvas(wxWindow
*parent
) : wxScrolledWindow(parent
) { }
80 void OnPaint(wxPaintEvent
& event
);
89 DIALOGS_CHOOSE_COLOUR
= 1,
90 DIALOGS_CHOOSE_COLOUR_GENERIC
,
92 DIALOGS_CHOOSE_FONT_GENERIC
,
94 DIALOGS_SINGLE_CHOICE
,
96 DIALOGS_PASSWORD_ENTRY
,
105 DIALOGS_MODELESS_BTN
,