tglbtn.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/tglbtn.h
  3. // Purpose: Declaration of the wxToggleButton class, which implements a
  4. // toggle button under wxMac.
  5. // Author: Stefan Csomor
  6. // Modified by:
  7. // Created: 08.02.01
  8. // Copyright: (c) 2004 Stefan Csomor
  9. // Licence: wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_TOGGLEBUTTON_H_
  12. #define _WX_TOGGLEBUTTON_H_
  13. class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
  14. {
  15. public:
  16. wxToggleButton() {}
  17. wxToggleButton(wxWindow *parent,
  18. wxWindowID id,
  19. const wxString& label,
  20. const wxPoint& pos = wxDefaultPosition,
  21. const wxSize& size = wxDefaultSize,
  22. long style = 0,
  23. const wxValidator& validator = wxDefaultValidator,
  24. const wxString& name = wxCheckBoxNameStr)
  25. {
  26. Create(parent, id, label, pos, size, style, validator, name);
  27. }
  28. bool Create(wxWindow *parent,
  29. wxWindowID id,
  30. const wxString& label,
  31. const wxPoint& pos = wxDefaultPosition,
  32. const wxSize& size = wxDefaultSize,
  33. long style = 0,
  34. const wxValidator& validator = wxDefaultValidator,
  35. const wxString& name = wxCheckBoxNameStr);
  36. virtual void SetValue(bool value);
  37. virtual bool GetValue() const ;
  38. virtual bool OSXHandleClicked( double timestampsec );
  39. virtual void Command(wxCommandEvent& event);
  40. protected:
  41. virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
  42. private:
  43. DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
  44. };
  45. class WXDLLIMPEXP_CORE wxBitmapToggleButton : public wxToggleButton
  46. {
  47. public:
  48. wxBitmapToggleButton() {}
  49. wxBitmapToggleButton(wxWindow *parent,
  50. wxWindowID id,
  51. const wxBitmap& label,
  52. const wxPoint& pos = wxDefaultPosition,
  53. const wxSize& size = wxDefaultSize,
  54. long style = 0,
  55. const wxValidator& validator = wxDefaultValidator,
  56. const wxString& name = wxCheckBoxNameStr)
  57. {
  58. Create(parent, id, label, pos, size, style, validator, name);
  59. }
  60. bool Create(wxWindow *parent,
  61. wxWindowID id,
  62. const wxBitmap& label,
  63. const wxPoint& pos = wxDefaultPosition,
  64. const wxSize& size = wxDefaultSize,
  65. long style = 0,
  66. const wxValidator& validator = wxDefaultValidator,
  67. const wxString& name = wxCheckBoxNameStr);
  68. private:
  69. DECLARE_DYNAMIC_CLASS_NO_COPY(wxBitmapToggleButton)
  70. };
  71. #endif // _WX_TOGGLEBUTTON_H_