checkbox.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/checkbox.h
  3. // Purpose: wxCheckBox class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_CHECKBOX_H_
  11. #define _WX_CHECKBOX_H_
  12. // Checkbox item (single checkbox)
  13. class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
  14. {
  15. public:
  16. wxCheckBox() { }
  17. wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
  18. const wxPoint& pos = wxDefaultPosition,
  19. const wxSize& size = wxDefaultSize, long style = 0,
  20. const wxValidator& validator = wxDefaultValidator,
  21. const wxString& name = wxCheckBoxNameStr)
  22. {
  23. Create(parent, id, label, pos, size, style, validator, name);
  24. }
  25. bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
  26. const wxPoint& pos = wxDefaultPosition,
  27. const wxSize& size = wxDefaultSize, long style = 0,
  28. const wxValidator& validator = wxDefaultValidator,
  29. const wxString& name = wxCheckBoxNameStr);
  30. virtual void SetValue(bool);
  31. virtual bool GetValue() const;
  32. virtual void Command(wxCommandEvent& event);
  33. // osx specific event handling common for all osx-ports
  34. virtual bool OSXHandleClicked( double timestampsec );
  35. protected:
  36. void DoSet3StateValue(wxCheckBoxState val);
  37. virtual wxCheckBoxState DoGet3StateValue() const;
  38. DECLARE_DYNAMIC_CLASS(wxCheckBox)
  39. };
  40. class WXDLLIMPEXP_FWD_CORE wxBitmap;
  41. class WXDLLIMPEXP_CORE wxBitmapCheckBox: public wxCheckBox
  42. {
  43. public:
  44. int checkWidth;
  45. int checkHeight;
  46. wxBitmapCheckBox()
  47. : checkWidth(-1), checkHeight(-1)
  48. { }
  49. wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
  50. const wxPoint& pos = wxDefaultPosition,
  51. const wxSize& size = wxDefaultSize, long style = 0,
  52. const wxValidator& validator = wxDefaultValidator,
  53. const wxString& name = wxCheckBoxNameStr)
  54. {
  55. Create(parent, id, label, pos, size, style, validator, name);
  56. }
  57. bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
  58. const wxPoint& pos = wxDefaultPosition,
  59. const wxSize& size = wxDefaultSize, long style = 0,
  60. const wxValidator& validator = wxDefaultValidator,
  61. const wxString& name = wxCheckBoxNameStr);
  62. virtual void SetValue(bool);
  63. virtual bool GetValue() const;
  64. virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
  65. virtual void SetLabel(const wxBitmap *bitmap);
  66. virtual void SetLabel( const wxString & WXUNUSED(name) ) {}
  67. DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
  68. };
  69. #endif
  70. // _WX_CHECKBOX_H_