ButtonBase.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. //
  2. // System.Windows.Forms.ButtonBase.cs
  3. //
  4. // Author:
  5. // stubbed out by Jaak Simm ([email protected])
  6. // implemented for Gtk+ by Rachel Hestilow ([email protected])
  7. //
  8. // (C) Ximian, Inc., 2002
  9. //
  10. using System.ComponentModel;
  11. using System.Drawing;
  12. namespace System.Windows.Forms
  13. {
  14. /// <summary>
  15. /// Implements the basic functionality common to button controls.
  16. /// ToDo note:
  17. /// - no methods are implemented
  18. /// </summary>
  19. public abstract class ButtonBase : Control
  20. {
  21. // private fields
  22. // FlatStyle flatStyle;
  23. // Image image;
  24. // ContentAlignment imageAlign;
  25. // int imageIndex;
  26. ContentAlignment textAlign;
  27. internal protected Label label;
  28. //
  29. // // --- Constructor ---
  30. protected ButtonBase() : base() {
  31. // flatStyle = FlatStyle.Standard;
  32. // image = null;
  33. // imageAlign = ContentAlignment.MiddleCenter;
  34. // imageIndex = -1;
  35. textAlign = ContentAlignment.MiddleCenter;
  36. label = new Label ();
  37. label.Text = Text;
  38. label.Visible = true;
  39. ConnectToClicked ();
  40. }
  41. internal protected void clicked_cb (object o, EventArgs args)
  42. {
  43. OnClick (EventArgs.Empty);
  44. }
  45. internal protected void ConnectToClicked ()
  46. {
  47. ((Gtk.Button) Widget).Clicked += new EventHandler (clicked_cb);
  48. }
  49. // --- Properties ---
  50. // [MonoTODO]
  51. // protected override CreateParams CreateParams {
  52. // get { throw new NotImplementedException (); }
  53. // }
  54. //
  55. // [MonoTODO]
  56. // protected override ImeMode DefaultImeMode {
  57. // get { throw new NotImplementedException (); }
  58. // }
  59. //
  60. // [MonoTODO]
  61. // protected override Size DefaultSize {
  62. // get { throw new NotImplementedException (); }
  63. // }
  64. //
  65. // public FlatStyle FlatStyle {
  66. // get { return flatStyle; }
  67. // set { flatStyle=value; }
  68. // }
  69. //
  70. // public Image Image {
  71. // get { return image; }
  72. // set { image=value; }
  73. // }
  74. //
  75. // public ContentAlignment ImageAlign {
  76. // get { return imageAlign; }
  77. // set { imageAlign=value; }
  78. // }
  79. //
  80. // public int ImageIndex {
  81. // get { return imageIndex; }
  82. // set { imageIndex=value; }
  83. // }
  84. //
  85. // [MonoTODO]
  86. // public new ImeMode ImeMode {
  87. // get { throw new NotImplementedException (); }
  88. // set { throw new NotImplementedException (); }
  89. // }
  90. //
  91. // protected bool IsDefault {
  92. // get { throw new NotImplementedException (); }
  93. // set { throw new NotImplementedException (); }
  94. // }
  95. public virtual ContentAlignment TextAlign {
  96. get { return label.TextAlign; }
  97. set { label.TextAlign=value; }
  98. }
  99. //
  100. //
  101. //
  102. //
  103. //
  104. // /// --- Methods ---
  105. // /// internal .NET framework supporting methods, not stubbed out:
  106. // /// - protected override void Dispose(bool);
  107. // /// - protected void ResetFlagsandPaint();
  108. // [MonoTODO]
  109. // protected override AccessibleObject CreateAccessibilityInstance() {
  110. // throw new NotImplementedException ();
  111. // }
  112. //
  113. // /// [methods for events]
  114. // [MonoTODO]
  115. // protected override void OnEnabledChanged(EventArgs e) {
  116. // throw new NotImplementedException ();
  117. // }
  118. //
  119. // [MonoTODO]
  120. // protected override void OnGotFocus(EventArgs e) {
  121. // throw new NotImplementedException ();
  122. // }
  123. //
  124. // [MonoTODO]
  125. // protected override void OnKeyDown(KeyEventArgs kevent) {
  126. // throw new NotImplementedException ();
  127. // }
  128. //
  129. // [MonoTODO]
  130. // protected override void OnKeyUp(KeyEventArgs kevent) {
  131. // throw new NotImplementedException ();
  132. // }
  133. //
  134. // [MonoTODO]
  135. // protected override void OnLostFocus(EventArgs e) {
  136. // throw new NotImplementedException ();
  137. // }
  138. //
  139. // [MonoTODO]
  140. // protected override void OnMouseDown(MouseEventArgs mevent) {
  141. // throw new NotImplementedException ();
  142. // }
  143. //
  144. // [MonoTODO]
  145. // protected override void OnMouseEnter(EventArgs eventargs) {
  146. // throw new NotImplementedException ();
  147. // }
  148. //
  149. // [MonoTODO]
  150. // protected override void OnMouseLeave(EventArgs eventargs) {
  151. // throw new NotImplementedException ();
  152. // }
  153. //
  154. // [MonoTODO]
  155. // protected override void OnMouseMove(MouseEventArgs mevent) {
  156. // throw new NotImplementedException ();
  157. // }
  158. //
  159. // [MonoTODO]
  160. // protected override void OnMouseUp(MouseEventArgs mevent) {
  161. // throw new NotImplementedException ();
  162. // }
  163. //
  164. // [MonoTODO]
  165. // protected override void OnPaint(PaintEventArgs pevent) {
  166. // throw new NotImplementedException ();
  167. // }
  168. //
  169. // [MonoTODO]
  170. // protected override void OnParentChanged(EventArgs e) {
  171. // throw new NotImplementedException ();
  172. // }
  173. //
  174. protected override void OnTextChanged(EventArgs e) {
  175. label.Text = Text;
  176. }
  177. //
  178. // [MonoTODO]
  179. // protected override void OnVisibleChanged(EventArgs e) {
  180. // throw new NotImplementedException ();
  181. // }
  182. // /// end of [methods for events]
  183. //
  184. // [MonoTODO]
  185. // protected override void WndProc(ref Message m) {
  186. // throw new NotImplementedException ();
  187. // }
  188. //
  189. //
  190. //
  191. // /// --- ButtonBase.ButtonBaseAccessibleObject ---
  192. // /// the class is not stubbed, cause it's only used for .NET framework
  193. //
  194. //
  195. }
  196. }