1998-07-28 13:33:23 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: docmdi.h
|
|
|
|
// Purpose: Frame classes for MDI document/view applications
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
2005-05-04 18:57:50 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-09-10 12:56:07 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-07-28 13:33:23 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DOCMDI_H_
|
|
|
|
#define _WX_DOCMDI_H_
|
|
|
|
|
1999-06-22 08:36:29 +00:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2003-01-12 22:20:46 +00:00
|
|
|
#if wxUSE_MDI_ARCHITECTURE
|
1999-06-22 08:36:29 +00:00
|
|
|
|
1998-07-28 13:33:23 +00:00
|
|
|
#include "wx/docview.h"
|
|
|
|
#include "wx/mdi.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use this instead of wxMDIParentFrame
|
|
|
|
*/
|
|
|
|
|
1999-01-08 14:19:09 +00:00
|
|
|
class WXDLLEXPORT wxDocMDIParentFrame: public wxMDIParentFrame
|
1998-07-28 13:33:23 +00:00
|
|
|
{
|
2002-12-04 14:11:26 +00:00
|
|
|
public:
|
2004-05-11 14:35:51 +00:00
|
|
|
wxDocMDIParentFrame();
|
2002-12-04 14:11:26 +00:00
|
|
|
wxDocMDIParentFrame(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 = wxT("frame"));
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2004-05-11 14:35:51 +00:00
|
|
|
bool 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 = wxT("frame"));
|
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
// Extend event processing to search the document manager's event table
|
|
|
|
virtual bool ProcessEvent(wxEvent& event);
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
void OnExit(wxCommandEvent& event);
|
|
|
|
void OnMRUFile(wxCommandEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
protected:
|
2004-05-11 14:35:51 +00:00
|
|
|
void Init();
|
2002-12-04 14:11:26 +00:00
|
|
|
wxDocManager *m_docManager;
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxDocMDIParentFrame)
|
|
|
|
DECLARE_EVENT_TABLE()
|
2003-01-02 23:38:11 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame)
|
1998-07-28 13:33:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use this instead of wxMDIChildFrame
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxDocMDIChildFrame: public wxMDIChildFrame
|
|
|
|
{
|
2002-12-04 14:11:26 +00:00
|
|
|
public:
|
2003-07-09 23:25:27 +00:00
|
|
|
wxDocMDIChildFrame();
|
2002-12-04 14:11:26 +00:00
|
|
|
wxDocMDIChildFrame(wxDocument *doc, wxView *view, wxMDIParentFrame *frame, wxWindowID id,
|
|
|
|
const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long type = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("frame"));
|
|
|
|
~wxDocMDIChildFrame();
|
|
|
|
|
2003-07-09 23:25:27 +00:00
|
|
|
bool Create(wxDocument *doc,
|
|
|
|
wxView *view,
|
|
|
|
wxMDIParentFrame *frame,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long type = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
// Extend event processing to search the view's event table
|
|
|
|
virtual bool ProcessEvent(wxEvent& event);
|
|
|
|
|
|
|
|
void OnActivate(wxActivateEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
|
|
|
|
|
|
|
inline wxDocument *GetDocument() const { return m_childDocument; }
|
|
|
|
inline wxView *GetView(void) const { return m_childView; }
|
|
|
|
inline void SetDocument(wxDocument *doc) { m_childDocument = doc; }
|
|
|
|
inline void SetView(wxView *view) { m_childView = view; }
|
|
|
|
bool Destroy() { m_childView = (wxView *)NULL; return wxMDIChildFrame::Destroy(); }
|
2004-09-10 12:56:07 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
protected:
|
2003-07-09 23:25:27 +00:00
|
|
|
void Init();
|
2002-12-04 14:11:26 +00:00
|
|
|
wxDocument* m_childDocument;
|
|
|
|
wxView* m_childView;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_CLASS(wxDocMDIChildFrame)
|
2003-01-02 23:38:11 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame)
|
1998-07-28 13:33:23 +00:00
|
|
|
};
|
|
|
|
|
1999-06-22 08:36:29 +00:00
|
|
|
#endif
|
|
|
|
// wxUSE_MDI_ARCHITECTURE
|
1999-06-22 17:39:02 +00:00
|
|
|
|
1998-07-28 13:33:23 +00:00
|
|
|
#endif
|
|
|
|
// _WX_DOCMDI_H_
|