OptionTreeSpinnerButton.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_SPINNERBUTTON
  22. #define OT_SPINNERBUTTON
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // OptionTreeSpinnerButton.h : header file
  27. //
  28. // Added Headers
  29. //#include "CommonRes.h"
  30. #include "OptionTreeDef.h"
  31. #include "OptionTreeItem.h"
  32. #include "OptionTreeSpinnerEdit.h"
  33. // Classes
  34. class COptionTree;
  35. /////////////////////////////////////////////////////////////////////////////
  36. // COptionTreeSpinnerButton window
  37. class COptionTreeSpinnerButton : public CWnd
  38. {
  39. // Construction
  40. public:
  41. COptionTreeSpinnerButton();
  42. // Attributes
  43. public:
  44. // Operations
  45. public:
  46. // Overrides
  47. // ClassWizard generated virtual function overrides
  48. //{{AFX_VIRTUAL(COptionTreeSpinnerButton)
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. public:
  52. BOOL GetOption(DWORD dwOption);
  53. void SetOption(DWORD dwOption, BOOL bSet);
  54. CString GetEditText();
  55. BOOL IsStringNumeric(CString strString);
  56. CEdit* GetEdit();
  57. void ResizeEdit();
  58. BOOL GetEditDword(DWORD &dwReturn);
  59. BOOL GetEditInt(int &nReturn);
  60. BOOL GetEditLong(long &lReturn);
  61. BOOL GetEditDouble(double &dReturn);
  62. BOOL GetEditFloat(float &fReturn);
  63. void SetEditLong(long lValue);
  64. void SetEditDword(DWORD dwValue);
  65. void SetEditFloat(float fValue);
  66. void SetEditInt(int nValue);
  67. void SetEditDouble(double dValue);
  68. void GetRange(double &dBottom, double &dTop);
  69. void SetRange(double dBottom, double dTop);
  70. void SetSpinnerOptionsOwner(COptionTree *otOption);
  71. virtual ~COptionTreeSpinnerButton();
  72. protected:
  73. LRESULT WM_ForceRedraw(WPARAM wParam, LPARAM lParam);
  74. LRESULT WM_EditUp(WPARAM wParam, LPARAM lParam);
  75. LRESULT WM_EditDown(WPARAM wParam, LPARAM lParam);
  76. double _GetValue();
  77. // Generated message map functions
  78. protected:
  79. void RepeatButton();
  80. COptionTree *m_otSpinnerOption;
  81. double m_dRangeTop;
  82. double m_dRangeBottom;
  83. CRect m_rcButtonTop;
  84. CRect m_rcButtonBottom;
  85. BOOL m_bBottomPressed;
  86. BOOL m_bTopPressed;
  87. CPoint m_ptSavePoint;
  88. BOOL m_bFirstRepeat;
  89. COptionTreeSpinnerEdit m_ctlEdit;
  90. int m_nRepeatDelay;
  91. int m_nRepeatRate;
  92. DWORD m_dwOptions;
  93. //{{AFX_MSG(COptionTreeSpinnerButton)
  94. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  95. afx_msg void OnPaint();
  96. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  97. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  98. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  99. afx_msg void OnDestroy();
  100. afx_msg void OnMove(int x, int y);
  101. afx_msg void OnSize(UINT nType, int cx, int cy);
  102. afx_msg void OnTimer(UINT nIDEvent);
  103. //}}AFX_MSG
  104. DECLARE_MESSAGE_MAP()
  105. };
  106. /////////////////////////////////////////////////////////////////////////////
  107. //{{AFX_INSERT_LOCATION}}
  108. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  109. #endif // !OT_SPINNERBUTTON