checkbox.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/checkbox.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef _WX_GTKCHECKBOX_H_
  9. #define _WX_GTKCHECKBOX_H_
  10. // ----------------------------------------------------------------------------
  11. // wxCheckBox
  12. // ----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
  14. {
  15. public:
  16. wxCheckBox();
  17. ~wxCheckBox();
  18. wxCheckBox( wxWindow *parent, wxWindowID id, const wxString& label,
  19. const wxPoint& pos = wxDefaultPosition,
  20. const wxSize& size = wxDefaultSize, long style = 0,
  21. const wxValidator& validator = wxDefaultValidator,
  22. const wxString& name = wxCheckBoxNameStr)
  23. {
  24. Create(parent, id, label, pos, size, style, validator, name);
  25. }
  26. bool Create(wxWindow *parent,
  27. wxWindowID id,
  28. const wxString& label,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = 0,
  32. const wxValidator& validator = wxDefaultValidator,
  33. const wxString& name = wxCheckBoxNameStr );
  34. void SetValue( bool state );
  35. bool GetValue() const;
  36. virtual void SetLabel( const wxString& label );
  37. virtual bool Enable( bool enable = true );
  38. static wxVisualAttributes
  39. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  40. // implementation
  41. void GTKDisableEvents();
  42. void GTKEnableEvents();
  43. protected:
  44. virtual void DoApplyWidgetStyle(GtkRcStyle *style);
  45. virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
  46. void DoSet3StateValue(wxCheckBoxState state);
  47. wxCheckBoxState DoGet3StateValue() const;
  48. private:
  49. typedef wxCheckBoxBase base_type;
  50. GtkWidget *m_widgetCheckbox;
  51. GtkWidget *m_widgetLabel;
  52. DECLARE_DYNAMIC_CLASS(wxCheckBox)
  53. };
  54. #endif // _WX_GTKCHECKBOX_H_