]>
git.saurik.com Git - wxWidgets.git/blob - samples/mdi/mdi.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #include "wx/toolbar.h"
13 // Define a new application
14 class MyApp
: public wxApp
17 virtual bool OnInit();
20 class MyCanvas
: public wxScrolledWindow
23 MyCanvas(wxWindow
*parent
, const wxPoint
& pos
, const wxSize
& size
);
24 virtual void OnDraw(wxDC
& dc
);
26 bool IsDirty() const { return m_dirty
; }
28 void SetText(const wxString
& text
) { m_text
= text
; Refresh(); }
31 void OnEvent(wxMouseEvent
& event
);
41 class MyFrame
: public wxMDIParentFrame
47 static wxMenuBar
*CreateMainMenubar();
50 void InitToolBar(wxToolBar
* toolBar
);
52 void OnSize(wxSizeEvent
& event
);
53 void OnAbout(wxCommandEvent
& event
);
54 void OnNewWindow(wxCommandEvent
& event
);
55 void OnFullScreen(wxCommandEvent
& event
);
56 void OnQuit(wxCommandEvent
& event
);
57 void OnCloseAll(wxCommandEvent
& event
);
59 void OnClose(wxCloseEvent
& event
);
61 wxTextCtrl
*m_textWindow
;
66 class MyChild
: public wxMDIChildFrame
69 MyChild(wxMDIParentFrame
*parent
);
72 static unsigned GetChildrenCount() { return ms_numChildren
; }
75 void OnActivate(wxActivateEvent
& event
);
77 void OnRefresh(wxCommandEvent
& event
);
78 void OnUpdateRefresh(wxUpdateUIEvent
& event
);
79 void OnChangeTitle(wxCommandEvent
& event
);
80 void OnChangePosition(wxCommandEvent
& event
);
81 void OnChangeSize(wxCommandEvent
& event
);
82 void OnClose(wxCommandEvent
& event
);
83 void OnSize(wxSizeEvent
& event
);
84 void OnMove(wxMoveEvent
& event
);
85 void OnCloseWindow(wxCloseEvent
& event
);
88 void OnPaste(wxCommandEvent
& event
);
89 void OnUpdatePaste(wxUpdateUIEvent
& event
);
90 #endif // wxUSE_CLIPBOARD
92 static unsigned ms_numChildren
;
96 // simple test event handler class
97 class EventHandler
: public wxEvtHandler
100 EventHandler(unsigned numChild
) : m_numChild(numChild
) { }
103 void OnRefresh(wxCommandEvent
& event
)
105 wxLogMessage("Child #%u refreshed.", m_numChild
);
109 const unsigned m_numChild
;
111 DECLARE_EVENT_TABLE()
113 wxDECLARE_NO_COPY_CLASS(EventHandler
);
116 DECLARE_EVENT_TABLE()
122 MDI_FULLSCREEN
= 100,