Removed explicit #defines for wxToolBar
[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 #include <wx/toolbar.h>
13
14 // Define a new application
15 class MyApp: public wxApp
16 {
17 public:
18 bool OnInit(void);
19 };
20
21 class MyCanvas: public wxScrolledWindow
22 {
23 public:
24 MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
25 virtual void OnDraw(wxDC& dc);
26 void OnEvent(wxMouseEvent& event);
27
28 DECLARE_EVENT_TABLE()
29 };
30
31 class TestRibbon: public wxToolBar
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 // Define a new frame
44 class MyFrame: public wxMDIParentFrame
45 {
46 public:
47 wxTextCtrl *textWindow;
48
49 TestRibbon* toolBar;
50
51 MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
52 bool OnClose(void);
53 void OnSize(wxSizeEvent& event);
54 void OnAbout(wxCommandEvent& event);
55 void OnNewWindow(wxCommandEvent& event);
56 void OnQuit(wxCommandEvent& event);
57
58 DECLARE_EVENT_TABLE()
59 };
60
61 class MyChild: public wxMDIChildFrame
62 {
63 public:
64 MyCanvas *canvas;
65 MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
66 ~MyChild(void);
67 bool OnClose(void);
68 void OnSize(wxSizeEvent& event);
69 void OnActivate(wxActivateEvent& event);
70 void OnQuit(wxCommandEvent& event);
71
72 DECLARE_EVENT_TABLE()
73 };
74
75 #define MDI_QUIT 1
76 #define MDI_NEW_WINDOW 2
77 #define MDI_REFRESH 3
78 #define MDI_CHILD_QUIT 4
79 #define MDI_ABOUT 5