checkbox.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/checkbox.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKCHECKBOXH__
  9. #define __GTKCHECKBOXH__
  10. // ----------------------------------------------------------------------------
  11. // wxCheckBox
  12. // ----------------------------------------------------------------------------
  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,
  26. wxWindowID id,
  27. const wxString& label,
  28. const wxPoint& pos = wxDefaultPosition,
  29. const wxSize& size = wxDefaultSize,
  30. long style = 0,
  31. const wxValidator& validator = wxDefaultValidator,
  32. const wxString& name = wxCheckBoxNameStr );
  33. void SetValue( bool state );
  34. bool GetValue() const;
  35. virtual void SetLabel( const wxString& label );
  36. virtual bool Enable( bool enable = TRUE );
  37. static wxVisualAttributes
  38. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  39. // implementation
  40. // --------------
  41. void DoApplyWidgetStyle(GtkRcStyle *style);
  42. bool IsOwnGtkWindow( GdkWindow *window );
  43. void OnInternalIdle();
  44. GtkWidget *m_widgetCheckbox;
  45. GtkWidget *m_widgetLabel;
  46. bool m_blockEvent;
  47. protected:
  48. virtual wxSize DoGetBestSize() const;
  49. private:
  50. DECLARE_DYNAMIC_CLASS(wxCheckBox)
  51. };
  52. #endif // __GTKCHECKBOXH__