📄 mvdoctemplate.hpp
字号:
// --------------------------------------------------------------------
// @group Implementation Method definition.
// --------------------------------------------------------------------
private:
// To find the frame template associated to the given class and frame.
CFrame* FindFrameEx( CString _ViewClassName, CString _FrameClassName );
public:
CDocFrameMgr( CDocument* _pDocument,
FrameTemplateList_& _FrameTemplateList,
CFrameTemplate* _pFrameToActivate );
~CDocFrameMgr( void );
protected:
// --------------------------------------------------------------------
// @group Functional Method definition.
// --------------------------------------------------------------------
private:
public:
// Usefull method to interact with the different frame.
bool OpenStartupFrame( void );
CFrame* GetActiveFrame( void );
void ShowOrCreateFrame( UINT _nEventID );
// Search method based on different criteria.
CFrame* FindFrame( CString _ViewClassName, CString _FrameClassName );
CFrame* FindFrame( CWnd* _pView, CWnd* _pFrame );
CFrame* FindFrame( UINT _nEventId );
// Method to open the frame associated with the event id.
BOOL OnCmdMsg( UINT _nID, int _nCode, void* _pExtra );
// Wrapper class.
CDocument* GetDocument( void ) { return m_pDocument; };
protected:
};
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @class: (IMPLEMENTATION_CLASS)
// That class represent each reel frame that a document may display.
// Those frame are associated to a document and there is n frame
// for a document where n is the number of frame template you have
// added for a document template.
// @base public | CMultiDocTemplate
// @end =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class CFrame : public CMultiDocTemplate
{
// --------------------------------------------------------------------
// @group Friendship definition.
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// @group Macro definition.
// --------------------------------------------------------------------
DECLARE_DYNAMIC( CFrame )
// --------------------------------------------------------------------
// @group Data definition.
// --------------------------------------------------------------------
private:
CFrameTemplate* m_pFrameTemplate; // The frame information.
CDocument* m_pDocument; // The associated document.
public:
protected:
// --------------------------------------------------------------------
// @group Implementation Method definition.
// --------------------------------------------------------------------
private:
public:
// @Access Creation and destruction method.
CFrame( CFrameTemplate* _FrameTemplate, CDocument* _pDocument );
~CFrame( void );
// Wrapper functions to get object attributes.
// No need for set functions since everything is provide by the constructor
// and the only object that has access to tha class is the doc manager.
CRuntimeClass* GetFrameRTC( void ) { return m_pFrameTemplate->GetFrameRTC(); };
CRuntimeClass* GetViewRTC( void ) { return m_pFrameTemplate->GetViewRTC(); };
UINT GetResourceID( void ) { return m_pFrameTemplate->GetResourceID(); };
UINT GetEventID( void ) { return m_pFrameTemplate->GetEventID(); };
UINT GetDefaultWndStatus( void ) { return m_pFrameTemplate->GetDefaultWndStatus(); };
BOOL GetLoadAtStartup( void ) { return m_pFrameTemplate->GetLoadAtStartup(); };
CDocument* GetDocument( void ) { return m_pDocument; };
protected:
// --------------------------------------------------------------------
// @group Funcional Method definition.
// --------------------------------------------------------------------
private:
public:
// Functions used by the framework to manage the window once created.
CFrameWnd* CreateFrame( void ); // Create the frame window.
bool DestroyFrame( void ); // Destroy the frame window.
bool ShowOrCreateFrame( void ); // To display the frame window.
CFrameWnd* FindFrameWnd( void ); // To find the frame window pointer.
protected:
};
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @class: (FUNCTIONAL_CLASS)
// This class is doing the single document file management. All
// the multiple view processing is done in the base class.
// @base public | CMvDocTemplate
// @end =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class CSDIMVDocTemplate : public CMvDocTemplate
{
// --------------------------------------------------------------------
// @group Macro definition.
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// @group Data definition.
// --------------------------------------------------------------------
private:
public:
protected:
CDocument* m_pDocument; // The only document loaded.
// --------------------------------------------------------------------
// @group Implementation Method definition.
// --------------------------------------------------------------------
private:
public:
// Constructor. Those information are directly passed to the
// base class that will manage the document creation.
CSDIMVDocTemplate( UINT _nIDResource, CRuntimeClass* _pDocClass,
BOOL _bAutoDelete = TRUE );
virtual ~CSDIMVDocTemplate( void );
// Document related method. Those method are needed by the
// sdi concept. To support SDI.
virtual void AddDocument( CDocument* _pDoc );
virtual void RemoveDocument( CDocument* _pDoc );
virtual POSITION GetFirstDocPosition( void ) const;
virtual CDocument* GetNextDoc( POSITION& _rPos ) const;
protected:
// --------------------------------------------------------------------
// @group Funcional Method definition.
// --------------------------------------------------------------------
private:
public:
protected:
// --------------------------------------------------------------------
// @group MFC Definition.
// --------------------------------------------------------------------
private:
public:
protected:
};
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// @class: (FUNCTIONAL_CLASS)
// This class is doing the multiple document file management. All
// the multiple view processing is done in the base class. No need
// to do something. Just use the base mdi stuff.
// @base public | CMvDocTemplate
// @end =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
class CMDIMVDocTemplate : public CMvDocTemplate
{
// --------------------------------------------------------------------
// @group Macro definition.
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// @group Data definition.
// --------------------------------------------------------------------
private:
public:
protected:
// --------------------------------------------------------------------
// @group Implementation Method definition.
// --------------------------------------------------------------------
private:
public:
// Constructor. Those information are directly passed to the
// base class that will manage the document creation.
CMDIMVDocTemplate( UINT _nIDResource, CRuntimeClass* _pDocClass,
BOOL _bAutoDelete = TRUE );
virtual ~CMDIMVDocTemplate( void );
protected:
// --------------------------------------------------------------------
// @group Funcional Method definition.
// --------------------------------------------------------------------
private:
public:
// Document related method.
virtual void RemoveDocument( CDocument* _pDoc );
protected:
// --------------------------------------------------------------------
// @group MFC Definition.
// --------------------------------------------------------------------
private:
public:
protected:
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -