GridCellBase.h
资源名称:MyStock.rar [点击查看]
上传用户:wenjimin
上传日期:2014-08-12
资源大小:111k
文件大小:2k
源码类别:
金融证券系统
开发平台:
Visual C++
- // 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_)