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

RmMFCColorPickerCtrl.h

00001 //=================================================================================================//
00002 // filename: RmMFCColorPickerCtrl.h                                                                //
00003 //                                                                                                 //
00004 //           ATI Research, Inc.                                                                    //
00005 //           3D Application Research Group                                                         //
00006 //                                                                                                 //
00007 // description: Defines the CRmColorPickerCtrl class.                                              //
00008 //                                                                                                 //
00009 //=================================================================================================//
00010 //   (C) 2004 ATI Research, Inc.  All rights reserved.                                             //
00011 //=================================================================================================//
00012 
00013 #ifndef _RM_MFC_UTILITIES_COLOR_PICKER_WND_H_
00014 #define _RM_MFC_UTILITIES_COLOR_PICKER_WND_H_
00015 
00016 #if _MSC_VER > 1000
00017 #pragma once
00018 #endif // _MSC_VER > 1000
00019 
00020 #include <Utilities/RmUtilControlPlacement.h>
00021 #include <MFCUtilities/RmMFCTypes.h>
00022 #include <MFCUtilities/RmMFCNumericEdit.h>
00023 #include <MFCUtilities/RmMFCColorSlider.h>
00024 #include <MFCUtilities/RmMFCColorWheel.h>
00025 #include <MFCUtilities/RmMFCUtilitiesResource.h>
00026 
00027 //=================================================================================================//
00028 // Class:         CRmColorPickerCtrl                                                               //
00029 //                                                                                                 //
00030 // Description:   Definition for CRmColorPickerCtrl control                                        //
00031 //=================================================================================================//
00032 class RMMFCUTIL_API CRmColorPickerCtrl : public CDialog
00033 {
00034 public: // Public Definitions
00035 
00036    typedef enum
00037    {
00038       COLOR_PICKER_TYPE_RGB,
00039       COLOR_PICKER_TYPE_HSV
00040 
00041    } RmColorPickerCtrlType;
00042 
00043 protected: // Protected Definitions
00044 
00045    //==============================================================================================//
00046    // Class:         CRmColorButton                                                                //
00047    //                                                                                              //
00048    // Description:   Class definition for CRmColorButton                                           //
00049    //                Derived from CButton, this class                                              //
00050    //                creates a simple color button control                                         //
00051    //==============================================================================================//
00052    class CRmColorButton : public CButton
00053    {
00054       public: // Public member functions
00055       
00056          CRmColorButton()
00057          {
00058             m_bCheck       = false;
00059             m_fColorArray  = NULL;
00060             
00061          } // end CRmColorButton()
00062          
00063          virtual void DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct );
00064          
00065          virtual bool GetCheck()                            { return( m_bCheck ); }
00066          virtual void SetCheck( bool bCheck )               { m_bCheck = bCheck; }
00067          virtual void SetColorArray( float *fColorArray )   { m_fColorArray = fColorArray; }
00068       
00069       protected: // Protected member variables
00070       
00071          bool  m_bCheck;
00072          float *m_fColorArray;
00073          
00074    }; // end class CRmColorButton : public CButton
00075    
00076 public: // Public Member Functions
00077 
00078    // Construction / Destruction
00079         CRmColorPickerCtrl();
00080    virtual ~CRmColorPickerCtrl();
00081 
00082    BOOL Create(   HWND        hwndParent,
00083                   RECT        *pRect                  = NULL,
00084                   float       *pColorData             = NULL,
00085                   COLORREF    *pColorRef              = NULL,
00086                   RmNode      *pRmNode                = NULL,
00087                   RmPlugInID  *pRmPlugInID            = NULL,
00088                   bool        bInitialFloatingPoint   = false,
00089                   int         nInitialColorType       = COLOR_PICKER_TYPE_RGB,
00090                   bool        bLargeSize              = true,
00091                   bool        bLogChanges             = true );
00092 
00093    bool GetIsLargeSize() { return( m_bLargeSize ); }
00094 
00095         //{{AFX_DATA(CRmColorPickerCtrl)
00096         enum { IDD = IDD_RM_COLOR_PICKER_WINDOW };
00097         CButton          m_chkFloatingPoint;
00098         CRmColorButton    m_btnColor;
00099         CRmNumericEdit     m_edit4;
00100         CRmNumericEdit     m_edit3;
00101         CRmNumericEdit    m_edit2;
00102         CRmNumericEdit    m_edit1;
00103         CStatic          m_static4;
00104         CStatic          m_static3;
00105         CStatic          m_static2;
00106         CStatic          m_static1;
00107         CComboBox             m_colorTypeCombo;
00108         CRmColorSlider     m_colorSlider5;
00109         CRmColorSlider     m_colorSlider4;
00110         CRmColorSlider     m_colorSlider3;
00111         CRmColorSlider     m_colorSlider2;
00112         CRmColorSlider    m_colorSlider1;
00113         CRmColorWheel     m_colorWheel;
00114         //}}AFX_DATA
00115 
00116         // ClassWizard generated virtual function overrides
00117         //{{AFX_VIRTUAL(CRmColorPickerCtrl)
00118         protected:
00119         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00120         virtual BOOL OnInitDialog();
00121    virtual BOOL PreTranslateMessage(MSG* pMsg);
00122    virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
00123         //}}AFX_VIRTUAL
00124 
00125 protected: // Protected Member Functions
00126 
00127    void UpdateControls( HWND hWnd );
00128    void UpdateTextControls();
00129    void UpdateCtrlSize( bool bNotifyParent );
00130    
00131         // Generated message map functions
00132         //{{AFX_MSG(CRmColorPickerCtrl)
00133         afx_msg void      OnSelchangeColorTypeCombo();
00134         afx_msg void      OnKillfocusEdit1();
00135         afx_msg void      OnKillfocusEdit2();
00136         afx_msg void      OnKillfocusEdit3();
00137         afx_msg void      OnKillfocusEdit4();
00138         afx_msg BOOL      OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00139         afx_msg void      OnFloatingPointCheck();
00140    afx_msg void      OnSize(UINT nType, int cx, int cy);
00141    afx_msg void      OnBnClickedRmColorButton();   
00142    afx_msg void      OnGetMinMaxInfo(MINMAXINFO* lpMMI);
00143    afx_msg LRESULT   OnColorChanged( WPARAM wParam, LPARAM lParam );
00144    afx_msg LRESULT   OnValueChanged( WPARAM wParam, LPARAM lParam );
00145    afx_msg LRESULT   OnValueChangeStart( WPARAM wParam, LPARAM lParam );
00146    afx_msg LRESULT   OnValueChangeEnd( WPARAM wParam, LPARAM lParam );
00147         //}}AFX_MSG
00148 
00149 
00150         DECLARE_MESSAGE_MAP()
00151 
00152 private: // Private Member Variables
00153 
00154    RmNode      *m_pRmNode;
00155    RmPlugInID  *m_pRmPlugInID;
00156    HWND        m_hwndParent;
00157    bool        m_bLogChanges;
00158 
00159    float       *m_pColorData;
00160    COLORREF    *m_pColorRef;
00161    HBRUSH      m_hColorBrush;
00162 
00163    float       m_fColorArray[ 3 ];
00164    float       m_fAlpha;
00165 
00166    float       m_fHue;
00167    float       m_fSaturation;
00168    float       m_fValue;
00169 
00170    float       m_fStandardColorMultiplier;
00171    int         m_nNumericPrecesion;
00172    
00173    RmControlPlacementContainer m_colorControlPlacementContainerBig;
00174    RmControlPlacementContainer m_colorControlPlacementContainerSmall;
00175    
00176    bool        m_bInternalResize;
00177    bool        m_bInitialized;
00178    CRect       m_largeClientRect;
00179    CRect       m_smallClientRect;
00180    
00181 protected: // Protected Member Variables
00182 
00183    bool           m_bInitialFloatingPoint;
00184    int            m_nInitialColorType;
00185    bool           m_bLargeSize;
00186 
00187    CToolTipCtrl   m_toolTipCtrl;
00188 
00189 }; // end class RMMFCUTIL_API CRmColorPickerCtrl : public CDialog
00190 
00191 #endif

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