checkbox.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/cocoa/checkbox.h
  3. // Purpose: wxCheckBox class
  4. // Author: David Elliott
  5. // Modified by:
  6. // Created: 2003/03/16
  7. // Copyright: (c) 2003 David Elliott
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __WX_COCOA_CHECKBOX_H__
  11. #define __WX_COCOA_CHECKBOX_H__
  12. #include "wx/cocoa/NSButton.h"
  13. // ========================================================================
  14. // wxCheckBox
  15. // ========================================================================
  16. class WXDLLIMPEXP_CORE wxCheckBox: public wxCheckBoxBase , protected wxCocoaNSButton
  17. {
  18. DECLARE_DYNAMIC_CLASS(wxCheckBox)
  19. DECLARE_EVENT_TABLE()
  20. WX_DECLARE_COCOA_OWNER(NSButton,NSControl,NSView)
  21. // ------------------------------------------------------------------------
  22. // initialization
  23. // ------------------------------------------------------------------------
  24. public:
  25. wxCheckBox() { }
  26. wxCheckBox(wxWindow *parent, wxWindowID winid,
  27. const wxString& label,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize,
  30. long style = 0,
  31. const wxValidator& validator = wxDefaultValidator,
  32. const wxString& name = wxCheckBoxNameStr)
  33. {
  34. Create(parent, winid, label, pos, size, style, validator, name);
  35. }
  36. bool Create(wxWindow *parent, wxWindowID winid,
  37. const wxString& label,
  38. const wxPoint& pos = wxDefaultPosition,
  39. const wxSize& size = wxDefaultSize,
  40. long style = 0,
  41. const wxValidator& validator = wxDefaultValidator,
  42. const wxString& name = wxCheckBoxNameStr);
  43. virtual ~wxCheckBox();
  44. // ------------------------------------------------------------------------
  45. // Cocoa callbacks
  46. // ------------------------------------------------------------------------
  47. protected:
  48. virtual void Cocoa_wxNSButtonAction(void);
  49. // ------------------------------------------------------------------------
  50. // Implementation
  51. // ------------------------------------------------------------------------
  52. public:
  53. virtual void SetValue(bool);
  54. virtual bool GetValue() const;
  55. virtual void SetLabel(const wxString& label);
  56. virtual wxString GetLabel() const;
  57. protected:
  58. virtual void DoSet3StateValue(wxCheckBoxState state);
  59. virtual wxCheckBoxState DoGet3StateValue() const;
  60. };
  61. #endif // __WX_COCOA_CHECKBOX_H__