gauge.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/gauge.h
  3. // Purpose: wxGauge class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/07/15
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_GAUGE_H__
  11. #define __WX_COCOA_GAUGE_H__
  12. // #include "wx/cocoa/NSProgressIndicator.h"
  13. DECLARE_WXCOCOA_OBJC_CLASS(NSProgressIndicator);
  14. // ========================================================================
  15. // wxGauge
  16. // ========================================================================
  17. class WXDLLIMPEXP_CORE wxGauge: public wxGaugeBase// , protected wxCocoaNSProgressIndicator
  18. {
  19. DECLARE_DYNAMIC_CLASS(wxGauge)
  20. DECLARE_EVENT_TABLE()
  21. // WX_DECLARE_COCOA_OWNER(NSProgressIndicator,NSView,NSView)
  22. // ------------------------------------------------------------------------
  23. // initialization
  24. // ------------------------------------------------------------------------
  25. public:
  26. wxGauge() { }
  27. wxGauge(wxWindow *parent, wxWindowID winid, int range,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize,
  30. long style = wxGA_HORIZONTAL,
  31. const wxValidator& validator = wxDefaultValidator,
  32. const wxString& name = wxGaugeNameStr)
  33. {
  34. Create(parent, winid, range, pos, size, style, validator, name);
  35. }
  36. bool Create(wxWindow *parent, wxWindowID winid, int range,
  37. const wxPoint& pos = wxDefaultPosition,
  38. const wxSize& size = wxDefaultSize,
  39. long style = wxGA_HORIZONTAL,
  40. const wxValidator& validator = wxDefaultValidator,
  41. const wxString& name = wxGaugeNameStr);
  42. virtual ~wxGauge();
  43. // ------------------------------------------------------------------------
  44. // Cocoa callbacks
  45. // ------------------------------------------------------------------------
  46. public:
  47. inline WX_NSProgressIndicator GetNSProgressIndicator() const { return (WX_NSProgressIndicator)m_cocoaNSView; }
  48. protected:
  49. // NSProgressIndicator cannot be enabled/disabled
  50. virtual void CocoaSetEnabled(bool WXUNUSED(enable)) { }
  51. // ------------------------------------------------------------------------
  52. // Implementation
  53. // ------------------------------------------------------------------------
  54. public:
  55. // Pure Virtuals
  56. virtual int GetValue() const;
  57. virtual void SetValue(int value);
  58. // retrieve/change the range
  59. virtual void SetRange(int maxValue);
  60. int GetRange(void) const;
  61. protected:
  62. virtual wxSize DoGetBestSize() const;
  63. };
  64. #endif
  65. // __WX_COCOA_GAUGE_H__