Removed lots of OnClose functions; doc'ed OnCloseWindow better;
[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 // Define a new frame
32 class MyFrame: public wxMDIParentFrame
33 {
34 public:
35 wxTextCtrl *textWindow;
36
37 MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
38
39 void InitToolBar(wxToolBar* toolBar);
40
41 void OnSize(wxSizeEvent& event);
42 void OnAbout(wxCommandEvent& event);
43 void OnNewWindow(wxCommandEvent& event);
44 void OnQuit(wxCommandEvent& event);
45
46 DECLARE_EVENT_TABLE()
47 };
48
49 class MyChild: public wxMDIChildFrame
50 {
51 public:
52 MyCanvas *canvas;
53 MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
54 ~MyChild(void);
55 void OnActivate(wxActivateEvent& event);
56 void OnQuit(wxCommandEvent& event);
57
58 DECLARE_EVENT_TABLE()
59 };
60
61 #define MDI_QUIT 1
62 #define MDI_NEW_WINDOW 2
63 #define MDI_REFRESH 3
64 #define MDI_CHILD_QUIT 4
65 #define MDI_ABOUT 5