tglbtn.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/tglbtn.h
  3. // Purpose: Declaration of the wxToggleButton class, which implements a
  4. // toggle button under wxOS2.
  5. // Author: Dave Webster
  6. // Modified by:
  7. // Created: 08.02.01
  8. // Copyright: (c) 2005 David A Webster
  9. // Licence: wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_TOGGLEBUTTON_H_
  12. #define _WX_TOGGLEBUTTON_H_
  13. // Checkbox item (single checkbox)
  14. class WXDLLIMPEXP_CORE wxToggleButton : public wxToggleButtonBase
  15. {
  16. public:
  17. wxToggleButton() {}
  18. wxToggleButton(wxWindow *parent,
  19. wxWindowID id,
  20. const wxString& label,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = 0,
  24. const wxValidator& validator = wxDefaultValidator,
  25. const wxString& name = wxCheckBoxNameStr)
  26. {
  27. Create(parent, id, label, pos, size, style, validator, name);
  28. }
  29. bool Create(wxWindow *parent,
  30. wxWindowID id,
  31. const wxString& label,
  32. const wxPoint& pos = wxDefaultPosition,
  33. const wxSize& size = wxDefaultSize,
  34. long style = 0,
  35. const wxValidator& validator = wxDefaultValidator,
  36. const wxString& name = wxCheckBoxNameStr);
  37. virtual void SetValue(bool value);
  38. virtual bool GetValue() const ;
  39. virtual bool OS2Command(WXUINT param, WXWORD id);
  40. virtual void Command(wxCommandEvent& event);
  41. protected:
  42. virtual wxSize DoGetBestSize() const;
  43. virtual wxBorder GetDefaultBorder() const;
  44. virtual WXDWORD OS2GetStyle(long flags, WXDWORD *exstyle = NULL) const;
  45. private:
  46. DECLARE_DYNAMIC_CLASS_NO_COPY(wxToggleButton)
  47. };
  48. #endif // _WX_TOGGLEBUTTON_H_