Control.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. public Control () : this ("")
  21. {
  22. }
  23. public Control (string text) : this (null, text)
  24. {
  25. }
  26. public Control (Control parent, string text)
  27. {
  28. this.parent = parent;
  29. this.text = text;
  30. }
  31. public Control (string text, int left, int top, int width, int height)
  32. {
  33. }
  34. public Control (Control parent, string text, int left, int top, int width, int height)
  35. {
  36. }
  37. internal Widget Widget {
  38. get {
  39. if (widget == null)
  40. widget = CreateWidget ();
  41. return widget;
  42. }
  43. }
  44. internal virtual Widget CreateWidget ()
  45. {
  46. throw new Exception ();
  47. }
  48. public virtual string Text {
  49. get {
  50. return text;
  51. }
  52. set {
  53. text = value;
  54. }
  55. }
  56. public void Show ()
  57. {
  58. Widget.EmitShow ();
  59. }
  60. public void Hide ()
  61. {
  62. Widget.EmitHide ();
  63. }
  64. }
  65. }