00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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
00021
00022 #include <Utilities/RmUtilControlPlacement.h>
00023 #include <MFCUtilities/RmMFCTypes.h>
00024 #include <MFCUtilities/RmMFCNumericEdit.h>
00025 #include <MFCUtilities/RmMFCColorSlider.h>
00026 #include <MFCUtilities/RmMFCColorWheel.h>
00027 #include <MFCUtilities/RmMFCUtilitiesResource.h>
00028
00029
00030
00031
00032
00033
00034 class RMMFCUTIL_API CRmColorPickerWnd : public CDialog
00035 {
00036 public:
00037
00038 typedef enum
00039 {
00040 COLOR_PICKER_TYPE_RGB,
00041 COLOR_PICKER_TYPE_HSV
00042
00043 } ColorPickerWndType;
00044
00045 public:
00046
00047
00048 CRmColorPickerWnd();
00049
00050
00051 BOOL Create( const RM_TCHAR *pStrName,
00052 float *pColorData = NULL,
00053 COLORREF *pColorRef = NULL,
00054 HWND hwndParent = NULL,
00055 RmNode *pRmNode = NULL,
00056 bool bInitialFloatingPoint = false,
00057 int nInitialColorType = COLOR_PICKER_TYPE_RGB );
00058
00059
00060 enum { IDD = IDD_COLOR_PICKER_WINDOW };
00061 CButton m_chkFloatingPoint;
00062 CRmNumericEdit m_edit4;
00063 CRmNumericEdit m_edit3;
00064 CRmNumericEdit m_edit2;
00065 CRmNumericEdit m_edit1;
00066 CStatic m_static4;
00067 CStatic m_static3;
00068 CStatic m_static2;
00069 CStatic m_static1;
00070 CComboBox m_colorTypeCombo;
00071 CColorSlider m_colorSlider5;
00072 CColorSlider m_colorSlider4;
00073 CColorSlider m_colorSlider3;
00074 CColorSlider m_colorSlider2;
00075 CColorSlider m_colorSlider1;
00076 CColorWheel m_colorWheel;
00077
00078
00079
00080
00081 protected:
00082 virtual void DoDataExchange(CDataExchange* pDX);
00083
00084
00085 protected:
00086
00087 void UpdateControls( HWND hWnd );
00088 void UpdateTextControls();
00089
00090
00091
00092 virtual BOOL OnInitDialog();
00093 afx_msg void OnSelchangeColorTypeCombo();
00094 afx_msg void OnKillfocusEdit1();
00095 afx_msg void OnKillfocusEdit2();
00096 afx_msg void OnKillfocusEdit3();
00097 afx_msg void OnKillfocusEdit4();
00098 afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
00099 afx_msg void OnFloatingPointCheck();
00100 afx_msg void OnSize(UINT nType, int cx, int cy);
00101 afx_msg LRESULT OnColorChanged( WPARAM wParam, LPARAM lParam );
00102 afx_msg LRESULT OnValueChanged( WPARAM wParam, LPARAM lParam );
00103
00104
00105
00106 DECLARE_MESSAGE_MAP()
00107
00108 private:
00109
00110 RmNode *m_pRmNode;
00111 CString m_strDialogName;
00112
00113 float *m_pColorData;
00114 COLORREF *m_pColorRef;
00115
00116 float m_fColorArray[ 3 ];
00117 float m_fAlpha;
00118
00119 float m_fHue;
00120 float m_fSaturation;
00121 float m_fValue;
00122
00123 float m_fStandardColorMultiplier;
00124 int m_nNumericPrecesion;
00125
00126 RmControlPlacementContainer m_controlPlacementContainer;
00127
00128 bool m_bInitialFloatingPoint;
00129 int m_nInitialColorType;
00130
00131 };
00132
00133 #endif