| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: ogledit.h |
| 3 | // Purpose: OGL sample |
| 4 | // Author: Julian Smart |
| 5 | // Modified by: |
| 6 | // Created: 12/07/98 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) Julian Smart |
| 9 | // Licence: wxWindows licence |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #if defined(__GNUG__) && !defined(__APPLE__) |
| 13 | // #pragma interface |
| 14 | #endif |
| 15 | |
| 16 | #ifndef _OGLSAMPLE_OGLEDIT_H_ |
| 17 | #define _OGLSAMPLE_OGLEDIT_H_ |
| 18 | |
| 19 | #include <wx/docview.h> |
| 20 | #include <wx/deprecated/setup.h> |
| 21 | |
| 22 | // Define a new application |
| 23 | class MyFrame; |
| 24 | class EditorToolPalette; |
| 25 | class MyApp: public wxApp |
| 26 | { |
| 27 | public: |
| 28 | MyFrame *frame; |
| 29 | wxDocManager* myDocManager; |
| 30 | |
| 31 | MyApp(void); |
| 32 | bool OnInit(void); |
| 33 | int OnExit(void); |
| 34 | |
| 35 | // Palette stuff |
| 36 | EditorToolPalette *CreatePalette(wxFrame *parent); |
| 37 | }; |
| 38 | |
| 39 | DECLARE_APP(MyApp) |
| 40 | |
| 41 | // Define a new frame |
| 42 | class MyCanvas; |
| 43 | class MyFrame: public wxDocParentFrame |
| 44 | { |
| 45 | DECLARE_CLASS(MyFrame) |
| 46 | public: |
| 47 | wxMenu *editMenu; |
| 48 | |
| 49 | MyCanvas *canvas; |
| 50 | EditorToolPalette *palette; |
| 51 | |
| 52 | MyFrame(wxDocManager *manager, wxFrame *parent, const wxString& title, |
| 53 | const wxPoint& pos = wxDefaultPosition, |
| 54 | const wxSize& size = wxDefaultSize, |
| 55 | long style = wxDEFAULT_FRAME_STYLE); |
| 56 | |
| 57 | MyCanvas *CreateCanvas(wxView *view, wxFrame *parent); |
| 58 | void OnSize(wxSizeEvent& event); |
| 59 | void OnCloseWindow(wxCloseEvent& event); |
| 60 | void OnAbout(wxCommandEvent& event); |
| 61 | |
| 62 | DECLARE_EVENT_TABLE() |
| 63 | }; |
| 64 | |
| 65 | extern MyFrame *GetMainFrame(void); |
| 66 | |
| 67 | // Menu/undo/redo commands |
| 68 | |
| 69 | #define OGLEDIT_CUT 1 |
| 70 | #define OGLEDIT_ADD_SHAPE 2 |
| 71 | #define OGLEDIT_ADD_LINE 3 |
| 72 | #define OGLEDIT_EDIT_LABEL 4 |
| 73 | #define OGLEDIT_CHANGE_BACKGROUND_COLOUR 5 |
| 74 | |
| 75 | #define OGLEDIT_ABOUT 100 |
| 76 | |
| 77 | #endif |
| 78 | // _OGLSAMPLE_OGLEDIT_H_ |