tglbtn.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/tglbtn.h
  3. // Purpose: Declaration of the wxToggleButton class, which implements a
  4. // toggle button under wxMotif.
  5. // Author: Mattia Barbon
  6. // Modified by:
  7. // Created: 10.02.03
  8. // Copyright: (c) 2003 Mattia Barbon
  9. // Licence: wxWindows licence
  10. /////////////////////////////////////////////////////////////////////////////
  11. #ifndef _WX_TOGGLEBUTTON_H_
  12. #define _WX_TOGGLEBUTTON_H_
  13. #include "wx/checkbox.h"
  14. class WXDLLIMPEXP_CORE wxToggleButton : public wxCheckBox
  15. {
  16. public:
  17. wxToggleButton() { Init(); }
  18. wxToggleButton( wxWindow* parent, wxWindowID id, const wxString& label,
  19. const wxPoint& pos = wxDefaultPosition,
  20. const wxSize& size = wxDefaultSize,
  21. long style = 0,
  22. const wxValidator& val = wxDefaultValidator,
  23. const wxString& name = wxCheckBoxNameStr )
  24. {
  25. Init();
  26. Create( parent, id, label, pos, size, style, val, name );
  27. }
  28. bool Create( wxWindow* parent, wxWindowID id, const wxString& label,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = 0,
  32. const wxValidator& val = wxDefaultValidator,
  33. const wxString &name = wxCheckBoxNameStr );
  34. protected:
  35. virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
  36. private:
  37. DECLARE_DYNAMIC_CLASS(wxToggleButton)
  38. // common part of all constructors
  39. void Init()
  40. {
  41. m_evtType = wxEVT_TOGGLEBUTTON;
  42. }
  43. };
  44. #endif // _WX_TOGGLEBUTTON_H_