00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _RM_MFC_UTILITIES_COLOR_BUTTON_H_
00015 #define _RM_MFC_UTILITIES_COLOR_BUTTON_H_
00016
00017 #include <MFCUtilities/RmMFCTypes.h>
00018
00019 class RMMFCUTIL_API CColorButton : public CButton
00020 {
00021 public:
00022 CColorButton();
00023 virtual ~CColorButton() {};
00024
00025 void SetColor( COLORREF textColor, COLORREF bkgndColor );
00026 void SetColor( COLORREF textColor, COLORREF bkgndColor, COLORREF disabledBkgndColor );
00027 void ResetColor();
00028
00029
00030
00031
00032 public:
00033 virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00034
00035
00036
00037 protected:
00038
00039
00040
00041
00042
00043 void DrawButtonFrame( CDC* pDC, CRect rect, int nState );
00044
00045
00046 void DrawFilledRect( CDC* pDC, CRect rect, COLORREF color );
00047
00048
00049 void DrawLine( CDC* pDC, long lStartX, long lStartY, long lEndX, long lEndY, COLORREF color );
00050
00051
00052 void DrawButtonText( CDC* pDC, CRect rect, const RM_TCHAR* pBuffer, COLORREF textColor );
00053
00054 DECLARE_MESSAGE_MAP()
00055
00056
00057 private:
00058
00059
00060 COLORREF m_textColor;
00061 COLORREF m_backgroundColor;
00062 COLORREF m_disabledBackgroundColor;
00063 COLORREF m_lightColor;
00064 COLORREF m_highlightColor;
00065 COLORREF m_shadowColor;
00066 COLORREF m_darkShadowColor;
00067
00068 };
00069
00071
00072
00073
00074 #endif