📄 tabbedmdi.h
字号:
#pragma once
/////////////////////////////////////////////////////////////////////////////
// MFC Wrapper for an existing WTL library
// Written by Quynh Nguyen Huu
//
// Original WTL source code:
// - http://www.codeproject.com/wtl/igorsplitpane.asp
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to you or your
// computer whatsoever. It's free, so don't hassle me about it.
//
// Beware of bugs.
#include "DockingFramework.h"
class CTabbedMDIFrameWnd : public CDockingMDIFrameWnd
{
DECLARE_DYNCREATE(CTabbedMDIFrameWnd)
protected:
virtual HMENU GetWindowMenuPopup(HMENU hMenuBar);
virtual BOOL CreateClient(LPCREATESTRUCT lpCreateStruct, CMenu* pWindowMenu);
virtual BOOL PreTranslateMessage(MSG* pMsg);
class CMDIClientHooker : public WTL::DockSplitTab::SplitPane
{
virtual BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
LRESULT& lResult, DWORD dwMsgMapID = 0);
std::vector<HWND> m_ZOrder;
HWND m_hWndCurActive;
HMENU m_hSubMenu;
int m_iOriginalMenuItemCount;
void ClearMenu();
void RefreshMenu();
void SetActiveChild(HWND hWndChild);
void HighlightChild(HWND hWndChild, bool blHighlight);
virtual void clientActivate(HWND childWnd, HWND clientViewWnd);
virtual void clientCloseClick(HWND childWnd, HWND clientViewWnd);
public:
size_t GetChildCount() const { return m_ZOrder.size(); }
void SetActiveChildByMenuId(UINT_PTR nMenuID);
CMDIClientHooker()
: WTL::DockSplitTab::SplitPane(NULL, true)
, m_hWndCurActive(NULL)
, m_hSubMenu(NULL)
, m_iOriginalMenuItemCount(0)
{}
};
public:
CMDIClientHooker m_wndMDIClient;
public:
DECLARE_MESSAGE_MAP()
afx_msg void OnUpdateMDIWindowCmd(CCmdUI* pCmdUI);
};
class CTabbedMDIChildWnd : public CMDIChildWnd
{
DECLARE_DYNCREATE(CTabbedMDIChildWnd)
public:
CTabbedMDIChildWnd();
protected:
HWND ChangeParent(HWND hWndNewParent);
virtual CWnd* GetMessageBar();
virtual void ActivateFrame(int nCmdShow);
virtual void OnUpdateFrameTitle(BOOL bAddToTitle);
virtual void OnUpdateFrameMenu(BOOL bActive, CWnd* pActivateWnd, HMENU hMenuAlt);
virtual LRESULT DefWindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
virtual BOOL DestroyWindow();
virtual LRESULT WindowProc(UINT nMsg, WPARAM wParam, LPARAM lParam);
HWND m_hWndMDIClient;
BOOL m_blInChangeParent;
public:
DECLARE_MESSAGE_MAP()
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message);
afx_msg void OnDestroy();
afx_msg void OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd);
afx_msg BOOL OnNcCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg LRESULT OnSetText(WPARAM, LPARAM);
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -