GameBtn.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:3k
- #ifndef _CGAMEBTN_H
- #define _CGAMEBTN_H
- class CGameBtn
- {
- public:
- RECT m_rcBtn;
- CWHWilImageData* m_pxBtnImage;
- INT m_nFocusImgIdx; // 捞固瘤 包访 函荐甸.
- INT m_nClickImgIdx;
- BYTE m_bBtnType; // 0 : 器目胶 惑怕甫 啊瘤瘤 臼绰促. 1: 器目胶 乐澜.
- BYTE m_bBtnState; // 0 : 弊措肺... 1: 付快胶 器目胶惑怕. 2: 付快胶 努腐惑怕.
- public:
- __inline RECT GetGameBtnRect()
- {
- return m_rcBtn;
- }
- __inline VOID SetBtnState(BYTE bState)
- {
- m_bBtnState = bState;
- if ( m_bBtnType == _BTN_TYPE_NOFOCUS && m_bBtnState == _BTN_STATE_FOCUS )
- {
- m_bBtnState = _BTN_STATE_NORMAL;
- }
- }
- __inline BYTE GetGameBtnState()
- {
- return m_bBtnState;
- }
- __inline CGameBtn()
- {
- Init();
- }
- ~CGameBtn()
- {
- Destroy();
- }
- VOID Init();
- VOID Destroy();
- VOID ChangeRect(INT nStartX, INT nStartY);
- VOID CreateGameBtn(CWHWilImageData* pxBtnImage, INT nFocusImgIdx, INT nClickImgIdx, INT nStartX, INT nStartY, BYTE bBtnType = _BTN_TYPE_FOCUS);
- virtual VOID ShowGameBtn();
- VOID ResetGameBtn(INT nFocusImgIdx, INT nClickImgIdx);
-
- virtual VOID OnMouseMove(POINT ptMouse);
- virtual BOOL OnLButtonDown(POINT ptMouse);
- virtual BOOL OnLButtonUp(POINT ptMouse);
- };
- class CMsgBoxBtn : public CGameBtn
- {
- public:
- CMsgBoxBtn();
- ~CMsgBoxBtn();
- virtual VOID ShowGameBtn();
- };
- class CScrlBar
- {
- public:
- CScrlBar();
- ~CScrlBar();
- public:
- CWHWilImageData* m_pxScrlImage; // 胶农费官 捞固瘤颇老 器牢磐.
- INT m_nScrlImgIdx; // 胶农费官 捞固瘤.
- FLOAT m_fScrlRate; // 0.0f~1.0f荤捞. 胶农费官狼 厚啦.
- FLOAT m_fPageRate;
- INT m_nPageLine;
- BOOL m_bGrapsed; // 胶农费 滚瓢康开俊辑 Mouse LButtonDown俊 狼秦辑 喘妨柳惑怕牢瘤甫 魄窜茄促.
- WORD m_wScrlWidth;
- WORD m_wScrlHeight;
- WORD m_wScrlBtnHeight;
- RECT m_rcScrlRgn; // 胶农费官狼 康开.
- RECT m_rcScrlBtnRgn; // 胶农费官俊辑 滚瓢狼 康开.
- __inline FLOAT GetScrlRate()
- {
- return m_fScrlRate;
- }
- __inline VOID Init()
- {
- m_pxScrlImage = NULL;
- m_nScrlImgIdx = 0;
- m_fPageRate = 0.0f;
- m_fScrlRate = 0.0f;
- m_nPageLine = 0;
- m_bGrapsed = FALSE;
- m_wScrlWidth = 0;
- m_wScrlHeight = 0;
- m_wScrlBtnHeight = 0;
- SetRect(&m_rcScrlRgn, 0, 0, 0, 0);
- SetRect(&m_rcScrlBtnRgn, 0, 0, 0, 0);
- }
- VOID CreateScrlBar(CWHWilImageData* pxImage, INT ImgIdx, INT nPageLine, WORD wScrlWidth, WORD wScrlHeight, WORD wScrlBtnHeight);
- VOID ShowScrlBar(INT nX, INT nY, INT nFstPos, INT nCounter);
- BOOL OnMouseMove(POINT ptMouse);
- BOOL OnLButtonDown(POINT ptMouse);
- BOOL OnLButtonUp(POINT ptMouse);
- };
- #endif // _CGAMEBTN_H