⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainfrm.h

📁 一个完整的编辑器的代码(很值得参考
💻 H
字号:
///////////////////////////////////////////////////////////////////////////
//  File:    mainfrm.h
//  Version: 1.1.0.4
//  Updated: 19-Jul-1998
//
//  Main frame core
//
//  Copyright:  Ferdinand Prantl, portions by Stcherbatchenko Andrei
//  E-mail:     prantl@ff.cuni.cz
//
//  You are free to use or modify this code to the following restrictions:
//  - Acknowledge me somewhere in your about box, simple "Parts of code by.."
//  will be enough. If you can't (or don't want to), contact me personally.
//  - LEAVE THIS HEADER INTACT
////////////////////////////////////////////////////////////////////////////

// mainfrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_MAINFRM_H__C9FC90C9_018F_11D3_9ACA_00600875DD5F__INCLUDED_)
#define AFX_MAINFRM_H__C9FC90C9_018F_11D3_9ACA_00600875DD5F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "statbar.h"

class CMainFrame : public CBCGMDIFrameWnd
  {
    DECLARE_DYNAMIC (CMainFrame)
public :
    CMainFrame ();

    // Attributes
public :

	bool m_bFullScreen;
	BOOL m_bGotFocus;

private:
	// used for full-screen mode
	bool m_bStatusBarWasVisible; // , m_bToolBarWasVisible;
	CRect	m_mainRect;
	CToolBar *m_pwndFullScreenBar;
	bool m_bMax, m_bChildMax;

    // Operations
public :

  void FullScreenOn ();
	void FullScreenOff ();
	int MDIGetCount ();
	void MDIPrev ();
  void ChooseStatusBar (BOOL bActivate);

    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMainFrame)
    virtual BOOL PreCreateWindow (CREATESTRUCT & cs);
    //}}AFX_VIRTUAL

    // Implementation
public :
    virtual ~CMainFrame ();
#ifdef _DEBUG
    virtual void AssertValid () const;
    virtual void Dump (CDumpContext & dc) const;
#endif
	void FlashUntilFocus ();

protected :                   // control bar embedded members
    CEditStatusBar m_wndStatusBar;
    CBCGMenuBar m_wndMenuBar;
    CBCGToolBar m_wndToolBar;
    CBCGToolBarImages m_UserImages;
    BOOL m_bActivated;

    // Generated message map functions
protected :
    //{{AFX_MSG(CMainFrame)
    afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnClose();
    afx_msg void OnViewFullScreen();
    afx_msg void OnUpdateViewFullScreen(CCmdUI* pCmdUI);
    afx_msg void OnFileCloseAll();
    afx_msg void OnCloseWindow();
    afx_msg void OnNextWindow();
    afx_msg void OnPrevWindow();
    afx_msg void OnUpdateCloseWindow(CCmdUI* pCmdUI);
    afx_msg void OnUpdateNextWindow(CCmdUI* pCmdUI);
    afx_msg void OnUpdatePrevWindow(CCmdUI* pCmdUI);
    afx_msg void OnSetFocus(CWnd* pOldWnd);
    afx_msg void OnEncoding(UINT nID);
    afx_msg void OnUpdateEncoding(CCmdUI* pCmdUI);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP ()
    afx_msg void OnViewCustomize ();
    afx_msg LRESULT OnToolbarReset (WPARAM, LPARAM);
    void OnToolsViewUserToolbar (UINT id);
    void OnUpdateToolsViewUserToolbar (CCmdUI* pCmdUI);
    afx_msg LRESULT OnToolbarContextMenu (WPARAM, LPARAM);
    afx_msg LRESULT OnHelpCustomizeToolbars (WPARAM wp, LPARAM lp);
  };

inline void CMainFrame::MDIPrev ()
	{ ASSERT (::IsWindow (m_hWnd)); ::SendMessage (m_hWndMDIClient, WM_MDINEXT, 0, TRUE); }

/////////////////////////////////////////////////////////////////////////////

class CMainFrame2 : public CMDIFrameWnd
  {
    DECLARE_DYNAMIC (CMainFrame2)
public :
    CMainFrame2 ();

    // Attributes
public :

	bool m_bFullScreen;
	BOOL m_bGotFocus;

private:
	// used for full-screen mode
	bool m_bStatusBarWasVisible; // , m_bToolBarWasVisible;
	CRect	m_mainRect;
	CToolBar *m_pwndFullScreenBar;
	bool m_bMax, m_bChildMax;

    // Operations
public :

  void FullScreenOn ();
	void FullScreenOff ();
	int MDIGetCount ();
	void MDIPrev ();
  void ChooseStatusBar (BOOL bActivate);

    // Overrides
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CMainFrame2)
    virtual BOOL PreCreateWindow (CREATESTRUCT & cs);
    //}}AFX_VIRTUAL

    // Implementation
public :
    virtual ~CMainFrame2 ();
#ifdef _DEBUG
    virtual void AssertValid () const;
    virtual void Dump (CDumpContext & dc) const;
#endif
	void FlashUntilFocus ();

protected :                   // control bar embedded members
    CEditStatusBar m_wndStatusBar;
    CToolBar m_wndToolBar;
    BOOL m_bActivated;

    // Generated message map functions
protected :
    //{{AFX_MSG(CMainFrame2)
    afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnClose();
    afx_msg void OnViewFullScreen();
    afx_msg void OnUpdateViewFullScreen(CCmdUI* pCmdUI);
    afx_msg void OnFileCloseAll();
    afx_msg void OnCloseWindow();
    afx_msg void OnNextWindow();
    afx_msg void OnPrevWindow();
    afx_msg void OnUpdateCloseWindow(CCmdUI* pCmdUI);
    afx_msg void OnUpdateNextWindow(CCmdUI* pCmdUI);
    afx_msg void OnUpdatePrevWindow(CCmdUI* pCmdUI);
    afx_msg void OnSetFocus(CWnd* pOldWnd);
    afx_msg void OnEncoding(UINT nID);
    afx_msg void OnUpdateEncoding(CCmdUI* pCmdUI);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP ()
  };

inline void CMainFrame2::MDIPrev ()
	{ ASSERT (::IsWindow (m_hWnd)); ::SendMessage (m_hWndMDIClient, WM_MDINEXT, 0, TRUE); }

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_MAINFRM_H__C9FC90C9_018F_11D3_9ACA_00600875DD5F__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -