ButtonBase.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. // Dennis Hayes ([email protected])
  8. // WINELib implementation started by John Sohn ([email protected])
  9. //
  10. // (C) Ximian, Inc., 2002
  11. //
  12. using System.ComponentModel;
  13. using System.Drawing;
  14. namespace System.Windows.Forms {
  15. /// <summary>
  16. /// Implements the basic functionality common to button controls.
  17. /// ToDo note:
  18. /// - no methods are implemented
  19. /// </summary>
  20. public abstract class ButtonBase : Control {
  21. // private fields
  22. FlatStyle flatStyle;
  23. Image image;
  24. ContentAlignment imageAlign;
  25. int imageIndex;
  26. ContentAlignment textAlign;
  27. ImeMode imeMode;
  28. bool isDefault;
  29. CreateParams createParams;
  30. //
  31. // // --- Constructor ---
  32. protected ButtonBase() : base()
  33. {
  34. flatStyle = FlatStyle.Standard;
  35. image = null;
  36. imageAlign = ContentAlignment.MiddleCenter;
  37. imageIndex = -1;
  38. textAlign = ContentAlignment.MiddleCenter;
  39. imeMode = ImeMode.Inherit;
  40. isDefault = false;
  41. }
  42. // --- Properties ---
  43. protected override CreateParams CreateParams {
  44. get { return createParams; }
  45. }
  46. protected override ImeMode DefaultImeMode {
  47. get {
  48. return ImeMode.Inherit;
  49. }
  50. }
  51. protected override Size DefaultSize {
  52. get { return base.DefaultSize; }
  53. }
  54. public FlatStyle FlatStyle {
  55. get { return flatStyle; }
  56. set { flatStyle=value; }
  57. }
  58. public Image Image {
  59. get { return image; }
  60. set { image=value; }
  61. }
  62. public ContentAlignment ImageAlign {
  63. get { return imageAlign; }
  64. set { imageAlign=value; }
  65. }
  66. public int ImageIndex {
  67. get { return imageIndex; }
  68. set { imageIndex=value; }
  69. }
  70. public new ImeMode ImeMode {
  71. get {
  72. return imeMode; }
  73. set {
  74. imeMode = value;
  75. }
  76. }
  77. protected bool IsDefault {
  78. get {
  79. return isDefault;
  80. }
  81. set {
  82. isDefault = value;
  83. }
  84. }
  85. [MonoTODO]
  86. //public virtual ContentAlignment TextAlign {
  87. // get { return label.TextAlign; }
  88. // set { label.TextAlign = value; }
  89. //}
  90. /// --- Methods ---
  91. /// internal .NET framework supporting methods, not stubbed out:
  92. /// - protected override void Dispose(bool);
  93. /// - protected void ResetFlagsandPaint();
  94. // I do not think this is part of the spec.
  95. //protected override AccessibleObject CreateAccessibilityInstance()
  96. //{
  97. // throw new NotImplementedException ();
  98. //}
  99. /// [methods for events]
  100. protected override void OnEnabledChanged (EventArgs e)
  101. {
  102. base.OnEnabledChanged (e);
  103. }
  104. protected override void OnGotFocus (EventArgs e)
  105. {
  106. base.OnGotFocus (e);
  107. }
  108. protected override void OnKeyDown (KeyEventArgs kevent)
  109. {
  110. base.OnKeyDown (kevent);
  111. }
  112. protected override void OnKeyUp (KeyEventArgs kevent)
  113. {
  114. base.OnKeyUp (kevent);
  115. }
  116. protected override void OnLostFocus (EventArgs e)
  117. {
  118. base.OnLostFocus (e);
  119. }
  120. protected override void OnMouseDown (MouseEventArgs e)
  121. {
  122. base.OnMouseDown (e);
  123. }
  124. protected override void OnMouseEnter (EventArgs e)
  125. {
  126. base.OnMouseEnter (e);
  127. }
  128. protected override void OnMouseLeave (EventArgs e)
  129. {
  130. base.OnMouseLeave (e);
  131. }
  132. protected override void OnMouseMove (MouseEventArgs e)
  133. {
  134. base.OnMouseMove (e);
  135. }
  136. protected override void OnMouseUp (MouseEventArgs e)
  137. {
  138. base.OnMouseUp (e);
  139. }
  140. protected override void OnPaint (PaintEventArgs e)
  141. {
  142. base.OnPaint (e);
  143. }
  144. protected override void OnParentChanged (EventArgs e)
  145. {
  146. base.OnParentChanged (e);
  147. }
  148. protected override void OnTextChanged (EventArgs e)
  149. {
  150. base.OnTextChanged (e);
  151. }
  152. protected override void OnVisibleChanged (EventArgs e)
  153. {
  154. base.OnVisibleChanged (e);
  155. }
  156. /// end of [methods for events]
  157. protected override void WndProc (ref Message m)
  158. {
  159. base.WndProc (ref m);
  160. }
  161. /// --- ButtonBase.ButtonBaseAccessibleObject ---
  162. /// the class is not stubbed, cause it's only used for .NET framework
  163. }
  164. }