olecontainview.h
来自「Visual_C++.NET实用编程百例」· C头文件 代码 · 共 79 行
H
79 行
// oleContainView.h : ColeContainView 类的接口
//
#pragma once
class ColeContainCntrItem;
class ColeContainView : public CView
{
protected: // 仅从序列化创建
ColeContainView();
DECLARE_DYNCREATE(ColeContainView)
// 属性
public:
ColeContainDoc* GetDocument() const;
// m_pSelection 将该选定内容保存在当前的 ColeContainCntrItem 中。
// 对于许多应用程序,这种成员变量不足以
// 表示某个选择,例如在不属于 ColeContainCntrItem 的对象中
// 选定的一个或多个对象。提供这种选择
// 机制的目的只是帮助您入门
// TODO: 用适合于您的应用程序的选择机制替换此选择机制
ColeContainCntrItem* m_pSelection;
// 操作
public:
// 重写
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 ~ColeContainView();
#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:
void SetupTracker(ColeContainCntrItem* pItem, CRectTracker* pTrack);
ColeContainCntrItem* Hit(CPoint point);
void SetSelect(ColeContainCntrItem* pItem);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMButtonDblClk(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 OnEditCopy();
afx_msg void OnEditPaste();
afx_msg void OnEditCut();
afx_msg void OnEditClear();
};
#ifndef _DEBUG // oleContainView.cpp 的调试版本
inline ColeContainDoc* ColeContainView::GetDocument() const
{ return reinterpret_cast<ColeContainDoc*>(m_pDocument); }
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?