Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

RmMFCColorButton.h

00001 //============================================================================//
00002 // filename: RmMFCColorButton.h                                               //
00003 //                                                                            //
00004 //           ATI Research, Inc.                                               //
00005 //           3D Application Research Group                                    //
00006 //                                                                            //
00007 // description: declaration for a custom-colored button. Allows you to change //
00008 //              the color of the button at run-time                           //
00009 //                                                                            //
00010 //============================================================================//
00011 //   (C) 2004 ATI Research, Inc.  All rights reserved.                        //
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 // Overrides
00030         // ClassWizard generated virtual function overrides
00031         //{{AFX_VIRTUAL(CColorButton)
00032         public:
00033         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
00034         //}}AFX_VIRTUAL
00035 
00036         // Generated message map functions
00037 protected:
00038         //{{AFX_MSG(CColorButton)
00039                 // NOTE - the ClassWizard will add and remove member functions here.
00040         //}}AFX_MSG
00041 
00042    // Draws the frame of the button depending on the state of the button (pressed up/down, etc):
00043         void DrawButtonFrame( CDC* pDC, CRect rect, int nState );
00044 
00045    // Draws the rectangle inside the button in the specified color:
00046         void DrawFilledRect( CDC* pDC, CRect rect, COLORREF color );
00047 
00048    // Draws a line between specified 2D points in a given color:
00049         void DrawLine( CDC* pDC, long lStartX, long lStartY, long lEndX, long lEndY, COLORREF color );
00050 
00051    // Draws the text on the button in the specified color:
00052         void DrawButtonText( CDC* pDC, CRect rect, const RM_TCHAR* pBuffer, COLORREF textColor );
00053 
00054         DECLARE_MESSAGE_MAP()
00055 
00056       
00057 private:
00058 
00059    // Color values for the button (pretty self-explanatory):
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 //{{AFX_INSERT_LOCATION}}
00073 
00074 #endif 

Generated on Fri Feb 25 16:08:37 2005 for RenderMonkey SDK by doxygen 1.3.6