]> git.saurik.com Git - wxWidgets.git/blob - samples/mdi/mdi.h
fix SF bug 1236365 (tested in VC only)
[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
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();
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
27 bool IsDirty() const { return m_dirty; }
28
29 void OnEvent(wxMouseEvent& event);
30
31 private:
32 bool m_dirty;
33
34 DECLARE_EVENT_TABLE()
35 };
36
37 // Define a new frame
38 class MyFrame : public wxMDIParentFrame
39 {
40 public:
41 wxTextCtrl *textWindow;
42
43 MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title,
44 const wxPoint& pos, const wxSize& size, const long style);
45
46 void InitToolBar(wxToolBar* toolBar);
47
48 void OnSize(wxSizeEvent& event);
49 void OnIconize(wxIconizeEvent& event);
50 void OnAbout(wxCommandEvent& event);
51 void OnNewWindow(wxCommandEvent& event);
52 void OnQuit(wxCommandEvent& event);
53 void OnClose(wxCloseEvent& event);
54
55 DECLARE_EVENT_TABLE()
56 };
57
58 class MyChild: public wxMDIChildFrame
59 {
60 public:
61 MyCanvas *canvas;
62 MyChild(wxMDIParentFrame *parent, const wxString& title);
63 ~MyChild();
64
65 void OnActivate(wxActivateEvent& event);
66
67 void OnRefresh(wxCommandEvent& event);
68 void OnUpdateRefresh(wxUpdateUIEvent& event);
69 void OnChangeTitle(wxCommandEvent& event);
70 void OnChangePosition(wxCommandEvent& event);
71 void OnChangeSize(wxCommandEvent& event);
72 void OnQuit(wxCommandEvent& event);
73 void OnSize(wxSizeEvent& event);
74 void OnMove(wxMoveEvent& event);
75 void OnClose(wxCloseEvent& event);
76
77 DECLARE_EVENT_TABLE()
78 };
79
80 // menu items ids
81 enum
82 {
83 MDI_QUIT = wxID_EXIT,
84 MDI_NEW_WINDOW = 101,
85 MDI_REFRESH,
86 MDI_CHANGE_TITLE,
87 MDI_CHANGE_POSITION,
88 MDI_CHANGE_SIZE,
89 MDI_CHILD_QUIT,
90 MDI_ABOUT = wxID_ABOUT
91 };