📄 gridcellbase.h
字号:
// GridCellBase.h: interface for the CGridCellBase class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_GRIDCELLBASE_H__768A7055_3D28_11D8_B617_A69FB0BE0671__INCLUDED_)
#define AFX_GRIDCELLBASE_H__768A7055_3D28_11D8_B617_A69FB0BE0671__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Cell states
#define GVIS_FIXED 0x0010
#define GVIS_FIXEDROW 0x0020
#define GVIS_FIXEDCOL 0x0040
class CGridCtrl;//超前引用,因为这时CGridCtrl类还没有生成,在这里告诉编译器CGridCtrl是一个类名字
//否则,会出现CGridCtrl未定义错误。
class CGridCellBase : public CObject
{
//friend class CGridCtrl;
DECLARE_DYNAMIC(CGridCellBase)
public:
CGridCellBase();
virtual ~CGridCellBase();
// Operators
public:
virtual void operator=(const CGridCellBase& cell);
// Attributes
public:
BOOL Draw(CDC* pDC,int nRow, int nCol, CRect rect, BOOL bEraseBkgnd /*=TRUE*/);
virtual void SetText(LPCTSTR /* szText */) = 0 ;
virtual void SetTextClr(COLORREF /* clr */) = 0 ;
virtual void SetBackClr(COLORREF /* clr */) = 0 ;
virtual void SetFont(const LOGFONT* /* plf */) = 0 ;
virtual void SetGrid(CGridCtrl* /* pGrid */) = 0 ;
virtual void SetState(DWORD nState) { m_nState = nState; }
virtual LPCTSTR GetText() const = 0 ;
virtual COLORREF GetTextClr() const = 0 ;
virtual COLORREF GetBackClr() const = 0 ;
virtual LOGFONT * GetFont() const = 0 ;
virtual CFont * GetFontObject() const = 0 ;
virtual CGridCtrl* GetGrid() const = 0 ;
virtual DWORD GetState() const { return m_nState; }
virtual CGridCellBase* GetDefaultCell() const;
virtual BOOL IsDefaultFont() const = 0 ;
virtual BOOL IsFixed() const { return (m_nState &GVIS_FIXED); }
virtual BOOL IsFixedCol() const { return (m_nState &GVIS_FIXEDCOL); }
virtual BOOL IsFixedRow() const { return (m_nState &GVIS_FIXEDROW); }
protected:
DWORD m_nState; // Cell state (selected/focus etc)
};
#endif // !defined(AFX_GRIDCELLBASE_H__768A7055_3D28_11D8_B617_A69FB0BE0671__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -