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