| 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 |
| 9 | // Licence: wxWindows license |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifndef __DIALOGSH__ |
| 13 | #define __DIALOGSH__ |
| 14 | |
| 15 | // Define a new application type |
| 16 | class MyApp: public wxApp |
| 17 | { |
| 18 | public: |
| 19 | bool OnInit(); |
| 20 | |
| 21 | wxFont m_canvasFont; |
| 22 | wxColour m_canvasTextColour; |
| 23 | }; |
| 24 | |
| 25 | // Define a new frame type |
| 26 | class MyFrame: public wxFrame |
| 27 | { |
| 28 | public: |
| 29 | MyFrame(wxWindow *parent, const wxString& title, |
| 30 | const wxPoint& pos, const wxSize& size); |
| 31 | |
| 32 | void ChooseColour(wxCommandEvent& event); |
| 33 | void ChooseFont(wxCommandEvent& event); |
| 34 | void LogDialog(wxCommandEvent& event); |
| 35 | void MessageBox(wxCommandEvent& event); |
| 36 | void SingleChoice(wxCommandEvent& event); |
| 37 | void TextEntry(wxCommandEvent& event); |
| 38 | void NumericEntry(wxCommandEvent& event); |
| 39 | void FileOpen(wxCommandEvent& event); |
| 40 | void FilesOpen(wxCommandEvent& event); |
| 41 | void FileSave(wxCommandEvent& event); |
| 42 | void DirChoose(wxCommandEvent& event); |
| 43 | void ShowTip(wxCommandEvent& event); |
| 44 | |
| 45 | #if !defined(__WXMSW__) || wxTEST_GENERIC_DIALOGS_IN_MSW |
| 46 | void ChooseColourGeneric(wxCommandEvent& event); |
| 47 | void ChooseFontGeneric(wxCommandEvent& event); |
| 48 | #endif |
| 49 | |
| 50 | void OnExit(wxCommandEvent& event); |
| 51 | |
| 52 | DECLARE_EVENT_TABLE() |
| 53 | }; |
| 54 | |
| 55 | class MyCanvas: public wxScrolledWindow |
| 56 | { |
| 57 | public: |
| 58 | MyCanvas(wxWindow *parent) : wxScrolledWindow(parent) { } |
| 59 | |
| 60 | void OnPaint(wxPaintEvent& event); |
| 61 | |
| 62 | DECLARE_EVENT_TABLE() |
| 63 | }; |
| 64 | |
| 65 | |
| 66 | // Menu IDs |
| 67 | #define DIALOGS_CHOOSE_COLOUR 1 |
| 68 | #define DIALOGS_CHOOSE_COLOUR_GENERIC 2 |
| 69 | #define DIALOGS_CHOOSE_FONT 3 |
| 70 | #define DIALOGS_CHOOSE_FONT_GENERIC 4 |
| 71 | #define DIALOGS_MESSAGE_BOX 5 |
| 72 | #define DIALOGS_SINGLE_CHOICE 6 |
| 73 | #define DIALOGS_TEXT_ENTRY 7 |
| 74 | #define DIALOGS_FILE_OPEN 8 |
| 75 | #define DIALOGS_FILES_OPEN 9 |
| 76 | #define DIALOGS_FILE_SAVE 10 |
| 77 | #define DIALOGS_DIR_CHOOSE 11 |
| 78 | #define DIALOGS_TIP 12 |
| 79 | #define DIALOGS_NUM_ENTRY 13 |
| 80 | #define DIALOGS_LOG_DIALOG 14 |
| 81 | |
| 82 | #endif |
| 83 | |