gauge.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/gauge.h
  3. // Purpose: wxGauge implementation for MSW
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_MSW_GAUGE_H_
  11. #define _WX_MSW_GAUGE_H_
  12. #if wxUSE_GAUGE
  13. extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
  14. // Group box
  15. class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
  16. {
  17. public:
  18. wxGauge() { }
  19. wxGauge(wxWindow *parent,
  20. wxWindowID id,
  21. int range,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = wxGA_HORIZONTAL,
  25. const wxValidator& validator = wxDefaultValidator,
  26. const wxString& name = wxGaugeNameStr)
  27. {
  28. (void)Create(parent, id, range, pos, size, style, validator, name);
  29. }
  30. bool Create(wxWindow *parent,
  31. wxWindowID id,
  32. int range,
  33. const wxPoint& pos = wxDefaultPosition,
  34. const wxSize& size = wxDefaultSize,
  35. long style = wxGA_HORIZONTAL,
  36. const wxValidator& validator = wxDefaultValidator,
  37. const wxString& name = wxGaugeNameStr);
  38. // set gauge range/value
  39. virtual void SetRange(int range);
  40. virtual void SetValue(int pos);
  41. // overridden base class virtuals
  42. virtual bool SetForegroundColour(const wxColour& col);
  43. virtual bool SetBackgroundColour(const wxColour& col);
  44. virtual void Pulse();
  45. WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
  46. // returns true if the platform should explicitly apply a theme border
  47. virtual bool CanApplyThemeBorder() const { return false; }
  48. protected:
  49. virtual wxSize DoGetBestSize() const;
  50. private:
  51. // returns true if the control is currently in indeterminate (a.k.a.
  52. // "marquee") mode
  53. bool IsInIndeterminateMode() const;
  54. // switch to/from indeterminate mode
  55. void SetIndeterminateMode();
  56. void SetDeterminateMode();
  57. DECLARE_DYNAMIC_CLASS_NO_COPY(wxGauge)
  58. };
  59. #endif // wxUSE_GAUGE
  60. #endif // _WX_MSW_GAUGE_H_