mycolordlgbar.h
上传用户:cding2008
上传日期:2007-01-03
资源大小:1812k
文件大小:3k
源码类别:

OpenGL

开发平台:

Visual C++

  1. /////////////////////////////////////////////////////////////////////////////
  2. // MyColorDlgBar.h : Header file; interface of the CCMyColorDlgBar class
  3. //
  4. // ModelMagic 3D and 'glOOP' (OpenGL Object Oriented Programming library)
  5. // Copyright (c) Craig Fahrnbach 1997, 1999
  6. //
  7. // OpenGL is a registered trademark of Silicon Graphics
  8. //
  9. //
  10. // This program is provided for educational and personal use only and
  11. // is provided without guarantee or warrantee expressed or implied.
  12. //
  13. // Commercial use is strickly prohibited without written permission
  14. // from ImageWare Development.
  15. //
  16. /////////////////////////////////////////////////////////////////////////////
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CMyColorDlgBar dialog
  19. class CMyColorDlgBar : public CDialogBar
  20. {
  21. // Construction
  22. public:
  23. CMyColorDlgBar();
  24. ~CMyColorDlgBar();
  25. BOOL Create( CWnd* pParentWnd, UINT nIDTemplate, UINT nStyle,
  26.  UINT nID, BOOL bChange);
  27. BOOL Create( CWnd* pParentWnd, LPCTSTR lpszTemplateName,
  28.  UINT nStyle, UINT nID, BOOL bChange);
  29. // Attributes
  30. public:
  31. CMyColorPaletteWnd* m_pColorWnd; // Color palette window
  32. CWnd* m_pLButtonWnd; // Left mouse button color window
  33. // CWnd* m_pRButtonWnd; // Right mouse button color window
  34. CWnd* m_pColorGradientWnd;// Our color gradient window
  35. CSliderCtrl* m_pSliderCtrl; // Slider control
  36. CComboBox* m_pComboBox; // Color combo box
  37. CSize m_sizeDocked; // Docking dialog size
  38. CSize m_sizeFloating; // Floating dialog size
  39. BOOL m_bChangeDockedSize;// Indicates whether to keep
  40. // a default size for docking
  41. C3dColor m_Color;
  42. HFONT m_hFont;
  43. private:
  44. C3dColor m_ColorRef;
  45. int m_iSliderMaxRange;
  46. int m_iInitColorSliderPos;
  47. float m_fRedPlus;
  48. float m_fRedMinus;
  49. float m_fGrnPlus;
  50. float m_fGrnMinus;
  51. float m_fBluPlus;
  52. float m_fBluMinus;
  53. // Operations
  54. public:
  55.  
  56. // Overrides
  57. // ClassWizard generated virtual function overrides
  58. //{{AFX_VIRTUAL(CMyColorDlgBar)
  59. //}}AFX_VIRTUAL
  60. virtual CSize CalcDynamicLayout( int nLength, DWORD dwMode );
  61.  
  62. // Implementation
  63. public:
  64. private:
  65. void PaintSelColorWnd(CWnd* pWnd, C3dColor* pColor);
  66. void PaintRangeWnd(C3dColor* pColor,  int iPosn, int iRange);
  67. void PaintObject(C3dColor* pColor);
  68. void ResetColorSlider();
  69. // Generated message map functions
  70. protected:
  71.     //{{AFX_MSG(CMyColorDlgBar)
  72. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  73. afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
  74. afx_msg BOOL OnQueryNewPalette();
  75. afx_msg void OnDestroy();
  76. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  77. afx_msg void OnPaint();
  78. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  79. afx_msg void OnDropdown();
  80. afx_msg void OnSelchange();
  81. afx_msg void OnParentNotify(UINT message, LPARAM lParam);
  82. afx_msg void OnTimer(UINT nIDEvent);
  83. //}}AFX_MSG
  84.     DECLARE_MESSAGE_MAP()
  85. // User defined messages
  86. long OnColorPaletteLButtonDown(WPARAM wParam, LPARAM lParam);
  87. long OnColorPaletteRButtonDown(WPARAM wParam, LPARAM lParam);
  88. };
  89.  
  90. /////////////////////////////////////////////////////////////////////////////