2008-03-08 08:52:38 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: docmdi.h
|
2008-04-21 21:38:12 -04:00
|
|
|
// Purpose: interface of wxDocMDIParentFrame and wxDocMDIChildFrame
|
2008-03-08 08:52:38 -05:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxDocMDIParentFrame
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The wxDocMDIParentFrame class provides a default top-level frame for
|
2008-04-21 21:38:12 -04:00
|
|
|
applications using the document/view framework. This class can only be used
|
|
|
|
for MDI parent frames.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-21 21:38:12 -04:00
|
|
|
It cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
|
|
|
|
classes.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2008-04-21 21:38:12 -04:00
|
|
|
@category{docview}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-21 21:38:12 -04:00
|
|
|
@see @ref overview_docview, @ref page_samples_docview, wxMDIParentFrame
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxDocMDIParentFrame : public wxMDIParentFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxDocMDIParentFrame();
|
2008-03-09 08:33:59 -04:00
|
|
|
wxDocMDIParentFrame(wxDocManager* manager, wxFrame* parent,
|
2008-03-08 09:43:31 -05:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = "frame");
|
2008-03-08 08:52:38 -05:00
|
|
|
//@}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
|
|
|
~wxDocMDIParentFrame();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the window.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
bool Create(wxDocManager* manager, wxFrame* parent,
|
2008-03-08 08:52:38 -05:00
|
|
|
wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = "frame");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Deletes all views and documents. If no user input cancelled the
|
|
|
|
operation, the frame will be destroyed and the application will exit.
|
2008-04-21 21:38:12 -04:00
|
|
|
|
|
|
|
Since understanding how document/view clean-up takes place can be
|
|
|
|
difficult, the implementation of this function is shown below:
|
|
|
|
|
|
|
|
@code
|
|
|
|
void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
|
|
|
|
{
|
|
|
|
if (m_docManager->Clear(!event.CanVeto()))
|
|
|
|
{
|
|
|
|
this->Destroy();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
event.Veto();
|
|
|
|
}
|
|
|
|
@endcode
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 11:24:38 -04:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
/**
|
|
|
|
@class wxDocMDIChildFrame
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-21 21:38:12 -04:00
|
|
|
The wxDocMDIChildFrame class provides a default frame for displaying
|
|
|
|
documents on separate windows. This class can only be used for MDI child
|
|
|
|
frames.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
The class is part of the document/view framework supported by wxWidgets,
|
2008-04-21 21:38:12 -04:00
|
|
|
and cooperates with the wxView, wxDocument, wxDocManager and wxDocTemplate
|
|
|
|
classes.
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-03-08 08:52:38 -05:00
|
|
|
@library{wxcore}
|
2008-04-21 21:38:12 -04:00
|
|
|
@category{docview}
|
2008-03-08 09:43:31 -05:00
|
|
|
|
2008-04-21 21:38:12 -04:00
|
|
|
@see @ref overview_docview, @ref page_samples_docview, wxMDIChildFrame
|
2008-03-08 08:52:38 -05:00
|
|
|
*/
|
|
|
|
class wxDocMDIChildFrame : public wxMDIChildFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructor.
|
|
|
|
*/
|
|
|
|
wxDocMDIChildFrame(wxDocument* doc, wxView* view,
|
2008-04-21 21:38:12 -04:00
|
|
|
wxFrame* parent, wxWindowID id,
|
2008-03-08 08:52:38 -05:00
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = "frame");
|
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
|
|
|
~wxDocMDIChildFrame();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the document associated with this frame.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxDocument* GetDocument() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the view associated with this frame.
|
|
|
|
*/
|
2008-03-09 12:24:26 -04:00
|
|
|
wxView* GetView() const;
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the currently active view to be the frame's view. You may need
|
|
|
|
to override (but still call) this function in order to set the keyboard
|
|
|
|
focus for your subwindow.
|
|
|
|
*/
|
|
|
|
void OnActivate(wxActivateEvent event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Closes and deletes the current view and document.
|
|
|
|
*/
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the document for this frame.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void SetDocument(wxDocument* doc);
|
2008-03-08 08:52:38 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the view for this frame.
|
|
|
|
*/
|
2008-03-09 08:33:59 -04:00
|
|
|
void SetView(wxView* view);
|
2008-03-08 08:52:38 -05:00
|
|
|
};
|
2008-03-10 11:24:38 -04:00
|
|
|
|