📄 containerview.h
字号:
// ContainerView.h : CContainerView 类的接口
//
#pragma once
class CContainerCntrItem;
class CContainerView : public CView
{
protected: // 仅从序列化创建
CContainerView();
DECLARE_DYNCREATE(CContainerView)
// 属性
public:
CContainerDoc* GetDocument() const;
// m_pSelection 将该选定内容保存在当前的 CContainerCntrItem 中。
// 对于许多应用程序,这种成员变量不足以表示某个选择,
// 例如在不属于 CContainerCntrItem 的对象中选定的一个或多个对象。
// 提供这种选择机制的目的只是帮助您入门
// TODO: 用适合于您的应用程序的选择机制替换此选择机制
CContainerCntrItem* m_pSelection;
// 操作
public:
CContainerCntrItem* GetHitItem(CPoint point);
void SetupTracker(CRectTracker* pTracker,CContainerCntrItem* pObject);
void SetAsSelected(CContainerCntrItem* pObject);
// 重写
public:
virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // 构造后第一次调用
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual BOOL IsSelected(const CObject* pDocItem) const;// 容器支持
// 实现
public:
virtual ~CContainerView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// 生成的消息映射函数
protected:
afx_msg void OnDestroy();
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnInsertObject();
afx_msg void OnCancelEditCntr();
afx_msg void OnFilePrint();
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnEditDelete();
afx_msg void OnUpdateEditDelete(CCmdUI *pCmdUI);
};
#ifndef _DEBUG // ContainerView.cpp 的调试版本
inline CContainerDoc* CContainerView::GetDocument() const
{ return reinterpret_cast<CContainerDoc*>(m_pDocument); }
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -