-// Define a new frame
-class MyCanvas;
-class MyFrame: public wxDocParentFrame
-{
- DECLARE_CLASS(MyFrame)
- public:
- wxMenu *editMenu;
-
- // This pointer only needed if in single window mode
- MyCanvas *canvas;
-
- MyFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size,
- const long type);
-
- void OnAbout(wxCommandEvent& event);
- MyCanvas *CreateCanvas(wxView *view, wxFrame *parent);
-
-DECLARE_EVENT_TABLE()
-};
+ // our specific methods
+ Mode GetMode() const { return m_mode; }
+ wxFrame *CreateChildFrame(wxView *view, bool isCanvas);
+
+ // these accessors should only be called in single document mode, otherwise
+ // the pointers are NULL and an assert is triggered
+ MyCanvas *GetMainWindowCanvas() const
+ { wxASSERT(m_canvas); return m_canvas; }
+ wxMenu *GetMainWindowEditMenu() const
+ { wxASSERT(m_menuEdit); return m_menuEdit; }
+
+private:
+ // append the standard document-oriented menu commands to this menu
+ void AppendDocumentFileCommands(wxMenu *menu, bool supportsPrinting);