resize mdi and notebook client
[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 #ifdef __WXMSW__
38
39 class TestRibbon: public wxToolBar
40 {
41 public:
42 TestRibbon(wxFrame *frame, int x = 0, int y = 0, int w = -1, int h = -1,
43 long style = wxNO_BORDER, int direction = wxVERTICAL, int RowsOrColumns = 2);
44 bool OnLeftClick(int toolIndex, bool toggled);
45 void OnMouseEnter(int toolIndex);
46 void OnPaint(wxPaintEvent& event);
47
48 DECLARE_EVENT_TABLE()
49 };
50
51 #endif
52
53 // Define a new frame
54 class MyFrame: public wxMDIParentFrame
55 {
56 public:
57 wxTextCtrl *textWindow;
58
59 #ifdef __WXMSW__
60 TestRibbon* toolBar;
61 #endif
62
63 MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
64 bool OnClose(void);
65 void OnSize(wxSizeEvent& event);
66 void OnAbout(wxCommandEvent& event);
67 void OnNewWindow(wxCommandEvent& event);
68 void OnQuit(wxCommandEvent& event);
69
70 DECLARE_EVENT_TABLE()
71 };
72
73 class MyChild: public wxMDIChildFrame
74 {
75 public:
76 MyCanvas *canvas;
77 MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
78 ~MyChild(void);
79 bool OnClose(void);
80 void OnSize(wxSizeEvent& event);
81 void OnActivate(wxActivateEvent& event);
82 void OnQuit(wxCommandEvent& event);
83
84 DECLARE_EVENT_TABLE()
85 };
86
87 #define MDI_QUIT 1
88 #define MDI_NEW_WINDOW 2
89 #define MDI_REFRESH 3
90 #define MDI_CHILD_QUIT 4
91 #define MDI_ABOUT 5