RadioButton.cs 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // System.Windows.Forms.Frame
  3. //
  4. // Author:
  5. // Joel Basson ([email protected])
  6. //
  7. //
  8. using System;
  9. namespace System.Windows.Forms {
  10. /// <summary>
  11. /// Represents a Windows RadioButton control.
  12. ///
  13. /// </summary>
  14. public class RadioButton : CheckBox {
  15. private static int initialized;
  16. static Gtk.RadioButton first_radio_button;
  17. public RadioButton(){
  18. }
  19. internal override Gtk.Widget CreateWidget() {
  20. initialized = initialized + 1;
  21. if ( initialized == 1 ) {
  22. first_radio_button = new Gtk.RadioButton(null, "");
  23. return first_radio_button;
  24. }
  25. else {
  26. return Gtk.RadioButton.NewWithLabelFromWidget(first_radio_button, "");
  27. }
  28. }
  29. public override string Text {
  30. get {
  31. return ((Gtk.RadioButton)Widget).Label;
  32. }
  33. set {
  34. ((Gtk.RadioButton)Widget).Label = value;
  35. }
  36. }
  37. }
  38. }