gauge.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/gauge.h
  3. // Purpose: wxGauge class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/06/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_GAUGE_H_
  11. #define _WX_GAUGE_H_
  12. class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase
  13. {
  14. public:
  15. inline wxGauge() { m_nRangeMax = 0; m_nGaugePos = 0; }
  16. inline wxGauge( wxWindow* pParent
  17. ,wxWindowID vId
  18. ,int nRange
  19. ,const wxPoint& rPos = wxDefaultPosition
  20. ,const wxSize& rSize = wxDefaultSize
  21. ,long lStyle = wxGA_HORIZONTAL
  22. ,const wxValidator& rValidator = wxDefaultValidator
  23. ,const wxString& rsName = wxGaugeNameStr
  24. )
  25. {
  26. Create( pParent
  27. ,vId
  28. ,nRange
  29. ,rPos
  30. ,rSize
  31. ,lStyle
  32. ,rValidator
  33. ,rsName
  34. );
  35. }
  36. bool Create( wxWindow* pParent
  37. ,wxWindowID vId
  38. ,int nRange
  39. ,const wxPoint& rPos = wxDefaultPosition
  40. ,const wxSize& rSize = wxDefaultSize
  41. ,long lStyle = wxGA_HORIZONTAL
  42. ,const wxValidator& rValidator = wxDefaultValidator
  43. ,const wxString& rsName = wxGaugeNameStr
  44. );
  45. int GetShadowWidth(void) const;
  46. int GetBezelFace(void) const;
  47. int GetRange(void) const;
  48. int GetValue(void) const;
  49. bool SetBackgroundColour(const wxColour& rColour);
  50. void SetBezelFace(int nWidth);
  51. bool SetForegroundColour(const wxColour& rColour);
  52. void SetRange(int nRange);
  53. void SetShadowWidth(int nWidth);
  54. void SetValue(int nPos);
  55. inline virtual bool AcceptsFocus(void) const { return FALSE; }
  56. inline virtual void Command(wxCommandEvent& WXUNUSED(rEvent)) {}
  57. protected:
  58. int m_nRangeMax;
  59. int m_nGaugePos;
  60. int m_nWidth;
  61. int m_nHeight;
  62. wxSize DoGetBestSize(void) const;
  63. private:
  64. DECLARE_DYNAMIC_CLASS(wxGauge)
  65. }; // end of CLASS wxGauge
  66. #endif // _WX_GAUGE_H_