Control.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //
  2. // System.Windows.Forms.Form
  3. //
  4. // Author:
  5. // Miguel de Icaza ([email protected])
  6. //
  7. // (C) 2002 Ximian, Inc
  8. //
  9. using System;
  10. using System.Drawing;
  11. using Gtk;
  12. using GtkSharp;
  13. using System.ComponentModel;
  14. namespace System.Windows.Forms {
  15. public class Control : Component {
  16. internal Widget widget;
  17. Control parent;
  18. string text;
  19. int left, top, width, height;
  20. static int init_me;
  21. static Control ()
  22. {
  23. init_me = 1;
  24. Console.WriteLine ("MEEEEEEEEEEEEEEEEEEEEEE");
  25. }
  26. public Control () : this ("")
  27. {
  28. }
  29. public Control (string text) : this (null, text)
  30. {
  31. }
  32. public Control (Control parent, string text)
  33. {
  34. this.parent = parent;
  35. this.text = text;
  36. }
  37. public Control (string text, int left, int top, int width, int height)
  38. {
  39. }
  40. public Control (Control parent, string text, int left, int top, int width, int height)
  41. {
  42. }
  43. internal Widget Widget {
  44. get {
  45. if (widget == null)
  46. widget = CreateWidget ();
  47. return widget;
  48. }
  49. }
  50. internal virtual Widget CreateWidget ()
  51. {
  52. throw new Exception ();
  53. }
  54. public virtual string Text {
  55. get {
  56. return text;
  57. }
  58. set {
  59. text = value;
  60. }
  61. }
  62. public void Show ()
  63. {
  64. Widget.EmitShow ();
  65. }
  66. public void Hide ()
  67. {
  68. Widget.EmitHide ();
  69. }
  70. public bool Visible {
  71. get {
  72. return Widget.Visible;
  73. }
  74. set {
  75. Widget.Visible = value;
  76. }
  77. }
  78. }
  79. }