radiobut.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/radiobut.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKRADIOBUTTONH__
  9. #define __GTKRADIOBUTTONH__
  10. //-----------------------------------------------------------------------------
  11. // wxRadioButton
  12. //-----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_CORE wxRadioButton: public wxControl
  14. {
  15. public:
  16. wxRadioButton() { }
  17. wxRadioButton( 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 = wxRadioButtonNameStr )
  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 = wxRadioButtonNameStr );
  36. virtual void SetLabel(const wxString& label);
  37. virtual void SetValue(bool val);
  38. virtual bool GetValue() const;
  39. virtual bool Enable( bool enable = TRUE );
  40. static wxVisualAttributes
  41. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  42. // implementation
  43. virtual bool IsRadioButton() const { return TRUE; }
  44. void DoApplyWidgetStyle(GtkRcStyle *style);
  45. bool IsOwnGtkWindow( GdkWindow *window );
  46. void OnInternalIdle();
  47. bool m_blockEvent;
  48. protected:
  49. virtual wxSize DoGetBestSize() const;
  50. private:
  51. DECLARE_DYNAMIC_CLASS(wxRadioButton)
  52. };
  53. #endif // __GTKRADIOBUTTONH__