home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / beaversweeper_v101.zip / src / RoundSliderCtrl.h < prev    next >
C/C++ Source or Header  |  2003-01-06  |  3KB  |  103 lines

  1. #if !defined(AFX_ROUNDSLIDERCTRL_H__21E63D43_D1CD_4FE6_84AB_D805D4AB576D__INCLUDED_)
  2. #define AFX_ROUNDSLIDERCTRL_H__21E63D43_D1CD_4FE6_84AB_D805D4AB576D__INCLUDED_
  3.  
  4. #if _MSC_VER > 1000
  5. #pragma once
  6. #endif // _MSC_VER > 1000
  7. // RoundSliderCtrl.h : header file
  8. //
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CRoundSliderCtrl window
  12.  
  13. class CRoundSliderCtrl : public CSliderCtrl
  14. {
  15. protected:
  16.     CPoint    m_ptCenter;
  17.     int        m_nRadius;
  18.     CRgn    m_rgn;
  19.  
  20.     int        m_nZero;
  21.     bool    m_bInverted;
  22.  
  23.     CString m_strText;
  24.     int        m_nKnobRadius;
  25.   float m_scale;
  26.  
  27.     bool    m_bDragging;
  28.     bool    m_bDragChanged;
  29.     bool    m_bDrawRadioButton;
  30. // Construction
  31. public:
  32.     DECLARE_DYNAMIC(CRoundSliderCtrl)
  33.     CRoundSliderCtrl();
  34.  
  35. // Attributes
  36. public:
  37.     // You may use '%ld' to show the slider value. Default: "%ld░"
  38.   virtual void SetScale (const float scale);
  39.   virtual float GetScale (void) const;
  40.     virtual void SetText(const CString& strNewText);
  41.     virtual CString GetText() const;
  42.  
  43.     // Override this function for customized output
  44.     virtual CString OnFormatText();
  45.  
  46.     // Default: 7, Minimum: 5
  47.     virtual void SetKnobRadius(const int nNewKnobRadius);
  48.     virtual int GetKnobRadius() const;
  49.  
  50.     // 0-359, 0 = Top, 90 = Right, 180 = Bottom, 270 = Left
  51.     virtual void SetZero(const int nZero);
  52.     virtual int GetZero() const;
  53.  
  54.     virtual void SetInverted(const bool bNewInverted = true);
  55.     virtual bool GetInverted();
  56.     
  57.     void SetDrawRadioButton(const bool nDrawRadioButton);
  58. // Operations
  59. public:
  60.  
  61. // Overrides
  62.     // ClassWizard generated virtual function overrides
  63.     //{{AFX_VIRTUAL(CRoundSliderCtrl)
  64.     protected:
  65.     virtual void PreSubclassWindow();
  66.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  67.     //}}AFX_VIRTUAL
  68.  
  69. // Implementation
  70. public:
  71.     virtual ~CRoundSliderCtrl();
  72.  
  73.     // Generated message map functions
  74. protected:
  75.     virtual void Init();
  76.     virtual bool SetKnob(const CPoint& pt);
  77.     virtual void PostMessageToParent(const int nTBCode) const;
  78.     //{{AFX_MSG(CRoundSliderCtrl)
  79.         // NOTE - the ClassWizard will add and remove member functions here.
  80.     afx_msg void OnSize(UINT nType, int cx, int cy);
  81.     afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  82.     afx_msg void OnPaint();
  83.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  84.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  85.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  86.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  87.     afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  88.     //}}AFX_MSG
  89.     DECLARE_MESSAGE_MAP()
  90. #ifdef _DEBUG
  91. public:
  92.     virtual void AssertValid() const;
  93.     virtual void Dump(CDumpContext& dc) const;
  94. #endif // _DEBUG
  95. };
  96.  
  97. /////////////////////////////////////////////////////////////////////////////
  98.  
  99. //{{AFX_INSERT_LOCATION}}
  100. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  101.  
  102. #endif // !defined(AFX_ROUNDSLIDERCTRL_H__21E63D43_D1CD_4FE6_84AB_D805D4AB576D__INCLUDED_)
  103.