OptionTreeItemColor.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 3k
Category:

Graph program

Development Platform:

Visual C++

  1. // COptionTree
  2. //
  3. // License
  4. // -------
  5. // This code is provided "as is" with no expressed or implied warranty.
  6. // 
  7. // You may use this code in a commercial product with or without acknowledgement.
  8. // However you may not sell this code or any modification of this code, this includes 
  9. // commercial libraries and anything else for profit.
  10. //
  11. // I would appreciate a notification of any bugs or bug fixes to help the control grow.
  12. //
  13. // History:
  14. // --------
  15. // See License.txt for full history information.
  16. //
  17. //
  18. // Copyright (c) 1999-2002 
  19. // ComputerSmarts.net 
  20. // mattrmiller@computersmarts.net
  21. #ifndef OT_ITEMCOLOR
  22. #define OT_ITEMCOLOR
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // OptionTreeItemColor.h : header file
  27. //
  28. // Added Headers
  29. //#include "CommonRes.h"
  30. #include "OptionTreeDef.h"
  31. #include "OptionTreeItem.h"
  32. #include "OptionTreeColorPopUp.h"
  33. // Classes
  34. class COptionTree;
  35. /////////////////////////////////////////////////////////////////////////////
  36. // COptionTreeItemColor window
  37. class COptionTreeItemColor : public CWnd, public COptionTreeItem
  38. {
  39. // Construction
  40. public:
  41. COptionTreeItemColor();
  42. virtual void OnMove();
  43. virtual void OnRefresh();
  44. virtual void OnCommit();
  45. virtual void OnActivate();
  46. virtual void CleanDestroyWindow();
  47. virtual void OnDeSelect();
  48. virtual void OnSelect();
  49. virtual void DrawAttribute(CDC *pDC, const RECT &rcRect);
  50. // Attributes
  51. public:   
  52. // Operations
  53. public:
  54. // Overrides
  55. // ClassWizard generated virtual function overrides
  56. //{{AFX_VIRTUAL(COptionTreeItemColor)
  57. //}}AFX_VIRTUAL
  58. // Implementation
  59. public:
  60. BOOL GetOption(DWORD dwOption);
  61. void SetOption(DWORD dwOption, BOOL bSet);
  62. COLORREF GetAutomaticColor();
  63. void SetAutomaticColor(COLORREF crAutomatic);
  64. BOOL CreateColorItem(DWORD dwOptions, COLORREF rcColor, COLORREF rcAutomatic);
  65. void SetColor(COLORREF rcColor);
  66. COLORREF GetColor();
  67. virtual ~COptionTreeItemColor();
  68. void           LostFocus() {m_bFocus=FALSE;};
  69. // Generated message map functions
  70. protected:
  71. void DrawControl(CDC *pDC, const RECT &rcRect);
  72. BOOL m_bFocus;
  73. COLORREF m_crColor;
  74. COLORREF m_crAutomatic;
  75. DWORD m_dwOptions;
  76. //{{AFX_MSG(COptionTreeItemColor)
  77. afx_msg void OnKillFocus(CWnd* pNewWnd);
  78. afx_msg void OnSetFocus(CWnd* pOldWnd);
  79. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  80. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  81. afx_msg void OnPaint();
  82. //}}AFX_MSG
  83. afx_msg long OnSelEndOK(UINT lParam, long wParam);
  84.     afx_msg long OnSelEndCancel(UINT lParam, long wParam);
  85.     afx_msg long OnSelChange(UINT lParam, long wParam);
  86. afx_msg long OnCloseColorPopUp(UINT lParam, long wParam);
  87. DECLARE_MESSAGE_MAP()
  88. };
  89. /////////////////////////////////////////////////////////////////////////////
  90. //{{AFX_INSERT_LOCATION}}
  91. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  92. #endif // !OT_ITEMCOLOR