radiobut.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/univ/radiobut.h
  3. // Purpose: wxRadioButton declaration
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 10.09.00
  7. // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_UNIV_RADIOBUT_H_
  11. #define _WX_UNIV_RADIOBUT_H_
  12. #include "wx/checkbox.h"
  13. // ----------------------------------------------------------------------------
  14. // wxRadioButton
  15. // ----------------------------------------------------------------------------
  16. class WXDLLIMPEXP_CORE wxRadioButton : public wxCheckBox
  17. {
  18. public:
  19. // constructors
  20. wxRadioButton() { Init(); }
  21. wxRadioButton(wxWindow *parent,
  22. wxWindowID id,
  23. const wxString& label,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = 0,
  27. const wxValidator& validator = wxDefaultValidator,
  28. const wxString& name = wxRadioButtonNameStr)
  29. {
  30. Init();
  31. Create(parent, id, label, pos, size, style, validator, name);
  32. }
  33. bool Create(wxWindow *parent,
  34. wxWindowID id,
  35. const wxString& label,
  36. const wxPoint& pos = wxDefaultPosition,
  37. const wxSize& size = wxDefaultSize,
  38. long style = 0,
  39. const wxValidator& validator = wxDefaultValidator,
  40. const wxString& name = wxRadioButtonNameStr);
  41. // override some base class methods
  42. virtual void ChangeValue(bool value);
  43. protected:
  44. virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
  45. // implement our own drawing
  46. virtual void DoDraw(wxControlRenderer *renderer);
  47. // we use the radio button bitmaps for size calculation
  48. virtual wxSize GetBitmapSize() const;
  49. // the radio button can only be cleared using this method, not
  50. // ChangeValue() above - and it is protected as it can only be called by
  51. // another radiobutton
  52. void ClearValue();
  53. // called when the radio button becomes checked: we clear all the buttons
  54. // in the same group with us here
  55. virtual void OnCheck();
  56. // send event about radio button selection
  57. virtual void SendEvent();
  58. private:
  59. DECLARE_DYNAMIC_CLASS(wxRadioButton)
  60. };
  61. #endif // _WX_UNIV_RADIOBUT_H_