www.pudn.com > MFCVista.rar > IRadioButton.h
#pragma once
#include "imagelist.h"
#include "Iontrlpos.h"
//µ¥Ñ¡¿ò¿Ø¼þ
class AFX_EXT_CLASS CIRadioButton : public CButton,public CIontrlPos,private CImageListEx
{
DECLARE_DYNAMIC(CIRadioButton)
public:
CIRadioButton();
virtual ~CIRadioButton();
protected:
DECLARE_MESSAGE_MAP()
public:
void SetAtt(UINT bmp,int *list,int nlist,CIRadioButton *,bool state=0,char *text=0,COLORREF textcolor=0,COLORREF tran=0);
void enable(bool);
void show(bool);
void SetText(CString);
CString GetText();
void SetStateBmp(bool);
void SetTextColor(COLORREF);
void SetCheck(bool);
bool GetCheck();
int GetValue();
void SetValue(int);
void SetCursor(UINT id);
void SetCursor(HCURSOR id);
protected:
void DrawText(CPaintDC *,CString text,COLORREF textcolor);
void CopyValue();
private:
COLORREF m_COLORREFMask,
m_COLORREFText;
bool m_bEnable,
m_bMouseDown,
m_bState,
m_bShow;
CString m_strText;
int m_iIndex,
m_iValue,
m_iOldIndex,
*m_pList,
n_iList;
CPoint m_CPointOldMouse;
CIRadioButton *m_pCtrlList;
HCURSOR m_hCursor;
CPoint m_CPointMouse;
CRect m_CRect;
public:
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnPaint();
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
protected:
virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
};