wxdocparentframethe wxdocparentframe class provides a default top-level frame for applications using the document/view framework. this class can only be used for sdi (not mdi) parent frames. it cooperates with the wxview, wxdocument, wxdocmanager and wxdoctemplates classes. see the example application in samples/docview. derived from
wxframe include files <wx/docview.h> see also document/view overview, wxframe members
wxdocparentframe::wxdocparentframe
wxdocparentframe::wxdocparentframewxdocparentframe() default constructor. wxdocparentframe(wxdocmanager* manager, wxframe *parent, wxwindowid id, const wxstring& title, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxdefault_frame_style, const wxstring& name = "frame") constructor.
wxdocparentframe::~wxdocparentframe~wxdocparentframe() destructor.
wxdocparentframe::createbool create(wxdocmanager* manager, wxframe *parent, wxwindowid id, const wxstring& title, const wxpoint& pos = wxdefaultposition, const wxsize& size = wxdefaultsize, long style = wxdefault_frame_style, const wxstring& name = "frame") used in two-step construction.
wxdocparentframe::getdocumentmanagerwxdocmanager * getdocumentmanager() const returns the associated document manager object.
wxdocparentframe::onclosewindowvoid onclosewindow(wxcloseevent& event) deletes all views and documents. if no user input cancelled the operation, the frame will be destroyed and the application will exit. since understanding how document/view clean-up takes place can be difficult, the implementation of this function is shown below.
void wxdocparentframe::onclosewindow(wxcloseevent& event) { if (m_docmanager->clear(!event.canveto())) { this->destroy(); } else event.veto(); } |