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
|
|
|
|
*/
|
|
|
|
|
2008-03-26 15:06:00 +00:00
|
|
|
class WXDLLIMPEXP_CORE 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,
|
2008-11-08 15:01:00 +00:00
|
|
|
const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr);
|
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,
|
2008-11-08 15:01:00 +00:00
|
|
|
const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr);
|
2004-05-11 14:35:51 +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();
|
2008-09-22 00:33:11 +00:00
|
|
|
|
2009-02-26 16:16:31 +00:00
|
|
|
virtual bool TryBefore(wxEvent& event);
|
2008-09-22 00:33:11 +00:00
|
|
|
|
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()
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxDocMDIParentFrame);
|
1998-07-28 13:33:23 +00:00
|
|
|
};
|
|
|
|
|
2009-02-27 12:24:03 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// An MDI document child frame: we need to define it as a class just for wxRTTI,
|
|
|
|
// otherwise we could simply typedef it
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-07-28 13:33:23 +00:00
|
|
|
|
2009-02-27 13:12:25 +00:00
|
|
|
#ifdef __VISUALC6__
|
|
|
|
// "non dll-interface class 'wxDocChildFrameAny<>' used as base interface
|
|
|
|
// for dll-interface class 'wxDocMDIChildFrame'" -- this is bogus as the
|
|
|
|
// template will be DLL-exported but only once it is used as base class
|
|
|
|
// here!
|
|
|
|
#pragma warning (disable:4275)
|
|
|
|
#endif
|
|
|
|
|
2009-02-27 12:24:03 +00:00
|
|
|
typedef
|
|
|
|
wxDocChildFrameAny<wxMDIChildFrame, wxMDIParentFrame> wxDocMDIChildFrameBase;
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxDocMDIChildFrame : public wxDocMDIChildFrameBase
|
1998-07-28 13:33:23 +00:00
|
|
|
{
|
2002-12-04 14:11:26 +00:00
|
|
|
public:
|
2009-02-27 12:24:03 +00:00
|
|
|
wxDocMDIChildFrame(wxDocument *doc,
|
|
|
|
wxView *view,
|
|
|
|
wxMDIParentFrame *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
: wxDocMDIChildFrameBase(doc, view,
|
|
|
|
parent, id, title, pos, size, style, name)
|
|
|
|
{
|
|
|
|
}
|
2002-12-04 14:11:26 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_CLASS(wxDocMDIChildFrame)
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxDocMDIChildFrame);
|
1998-07-28 13:33:23 +00:00
|
|
|
};
|
|
|
|
|
2009-02-27 13:12:25 +00:00
|
|
|
#ifdef __VISUALC6__
|
|
|
|
#pragma warning (default:4275)
|
|
|
|
#endif
|
2009-02-27 12:24:03 +00:00
|
|
|
|
|
|
|
#endif // wxUSE_MDI_ARCHITECTURE
|
1999-06-22 17:39:02 +00:00
|
|
|
|
2009-02-27 12:24:03 +00:00
|
|
|
#endif // _WX_DOCMDI_H_
|