1998-07-28 09:33:23 -04: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 14:57:50 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-09-10 08:56:07 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-07-28 09:33:23 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DOCMDI_H_
|
|
|
|
#define _WX_DOCMDI_H_
|
|
|
|
|
1999-06-22 04:36:29 -04:00
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2003-01-12 17:20:46 -05:00
|
|
|
#if wxUSE_MDI_ARCHITECTURE
|
1999-06-22 04:36:29 -04:00
|
|
|
|
1998-07-28 09:33:23 -04:00
|
|
|
#include "wx/docview.h"
|
|
|
|
#include "wx/mdi.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use this instead of wxMDIParentFrame
|
|
|
|
*/
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDocMDIParentFrame: public wxMDIParentFrame
|
1998-07-28 09:33:23 -04:00
|
|
|
{
|
2002-12-04 09:11:26 -05:00
|
|
|
public:
|
2004-05-11 10:35:51 -04:00
|
|
|
wxDocMDIParentFrame();
|
2002-12-04 09:11:26 -05: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 09:33:23 -04:00
|
|
|
|
2004-05-11 10:35:51 -04: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 09:11:26 -05:00
|
|
|
wxDocManager *GetDocumentManager(void) const { return m_docManager; }
|
1998-07-28 09:33:23 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
void OnExit(wxCommandEvent& event);
|
|
|
|
void OnMRUFile(wxCommandEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1998-07-28 09:33:23 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
protected:
|
2004-05-11 10:35:51 -04:00
|
|
|
void Init();
|
2008-09-21 20:33:11 -04:00
|
|
|
|
|
|
|
virtual bool TryValidator(wxEvent& event);
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
wxDocManager *m_docManager;
|
1998-07-28 09:33:23 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxDocMDIParentFrame)
|
|
|
|
DECLARE_EVENT_TABLE()
|
2003-01-02 18:38:11 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDocMDIParentFrame)
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Use this instead of wxMDIChildFrame
|
|
|
|
*/
|
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxDocMDIChildFrame: public wxMDIChildFrame
|
1998-07-28 09:33:23 -04:00
|
|
|
{
|
2002-12-04 09:11:26 -05:00
|
|
|
public:
|
2003-07-09 19:25:27 -04:00
|
|
|
wxDocMDIChildFrame();
|
2002-12-04 09:11:26 -05: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"));
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxDocMDIChildFrame();
|
2002-12-04 09:11:26 -05:00
|
|
|
|
2003-07-09 19:25:27 -04: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 09:11:26 -05:00
|
|
|
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 08:56:07 -04:00
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
protected:
|
2003-07-09 19:25:27 -04:00
|
|
|
void Init();
|
2008-09-21 20:33:11 -04:00
|
|
|
|
|
|
|
virtual bool TryValidator(wxEvent& event);
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
wxDocument* m_childDocument;
|
|
|
|
wxView* m_childView;
|
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_CLASS(wxDocMDIChildFrame)
|
2003-01-02 18:38:11 -05:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDocMDIChildFrame)
|
1998-07-28 09:33:23 -04:00
|
|
|
};
|
|
|
|
|
1999-06-22 04:36:29 -04:00
|
|
|
#endif
|
|
|
|
// wxUSE_MDI_ARCHITECTURE
|
1999-06-22 13:39:02 -04:00
|
|
|
|
1998-07-28 09:33:23 -04:00
|
|
|
#endif
|
|
|
|
// _WX_DOCMDI_H_
|