]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mdi.cpp | |
3 | // Purpose: MDI sample | |
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 | // Define a new application | |
13 | class MyApp: public wxApp | |
14 | { | |
15 | public: | |
16 | bool OnInit(void); | |
17 | }; | |
18 | ||
19 | class MyCanvas: public wxScrolledWindow | |
20 | { | |
21 | public: | |
22 | MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size); | |
23 | virtual void OnDraw(wxDC& dc); | |
24 | void OnEvent(wxMouseEvent& event); | |
25 | ||
26 | DECLARE_EVENT_TABLE() | |
27 | }; | |
28 | ||
29 | #ifdef __WINDOWS__ | |
30 | ||
31 | class TestRibbon: public wxToolBar95 | |
32 | { | |
33 | public: | |
34 | TestRibbon(wxFrame *frame, int x = 0, int y = 0, int w = -1, int h = -1, | |
35 | long style = wxNO_BORDER, int direction = wxVERTICAL, int RowsOrColumns = 2); | |
36 | bool OnLeftClick(int toolIndex, bool toggled); | |
37 | void OnMouseEnter(int toolIndex); | |
38 | void OnPaint(wxPaintEvent& event); | |
39 | ||
40 | DECLARE_EVENT_TABLE() | |
41 | }; | |
42 | ||
43 | #endif | |
44 | ||
45 | // Define a new frame | |
46 | class MyFrame: public wxMDIParentFrame | |
47 | { | |
48 | public: | |
49 | wxTextCtrl *textWindow; | |
50 | ||
51 | #ifdef __WINDOWS__ | |
52 | TestRibbon* toolBar; | |
53 | #endif | |
54 | ||
55 | MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); | |
56 | bool OnClose(void); | |
57 | void OnSize(wxSizeEvent& event); | |
58 | void OnAbout(wxCommandEvent& event); | |
59 | void OnNewWindow(wxCommandEvent& event); | |
60 | void OnQuit(wxCommandEvent& event); | |
61 | ||
62 | DECLARE_EVENT_TABLE() | |
63 | }; | |
64 | ||
65 | class MyChild: public wxMDIChildFrame | |
66 | { | |
67 | public: | |
68 | MyCanvas *canvas; | |
69 | MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); | |
70 | ~MyChild(void); | |
71 | bool OnClose(void); | |
72 | void OnActivate(wxActivateEvent& event); | |
73 | void OnQuit(wxCommandEvent& event); | |
74 | ||
75 | DECLARE_EVENT_TABLE() | |
76 | }; | |
77 | ||
78 | #define MDI_QUIT 1 | |
79 | #define MDI_NEW_WINDOW 2 | |
80 | #define MDI_REFRESH 3 | |
81 | #define MDI_CHILD_QUIT 4 | |
82 | #define MDI_ABOUT 5 |