2 // System.Windows.Forms.ButtonBase.cs
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // implemented for Gtk+ by Rachel Hestilow (hestilow@ximian.com)
7 // Dennis Hayes (dennish@Raytek.com)
8 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
10 // (C) Ximian, Inc., 2002
13 using System
.ComponentModel
;
16 namespace System
.Windows
.Forms
{
19 /// Implements the basic functionality common to button controls.
21 /// - no methods are implemented
24 public abstract class ButtonBase
: Control
{
29 ContentAlignment imageAlign
;
31 ContentAlignment textAlign
;
34 CreateParams createParams
;
36 // // --- Constructor ---
37 protected ButtonBase() : base()
39 flatStyle
= FlatStyle
.Standard
;
41 imageAlign
= ContentAlignment
.MiddleCenter
;
43 textAlign
= ContentAlignment
.MiddleCenter
;
44 imeMode
= ImeMode
.Inherit
;
49 protected override CreateParams CreateParams
{
50 get { return createParams; }
53 protected override ImeMode DefaultImeMode
{
55 return ImeMode
.Inherit
;
59 protected override Size DefaultSize
{
60 get { return base.DefaultSize; }
63 public FlatStyle FlatStyle
{
64 get { return flatStyle; }
65 set { flatStyle=value; }
73 public ContentAlignment ImageAlign
{
74 get { return imageAlign; }
75 set { imageAlign=value; }
78 public int ImageIndex
{
79 get { return imageIndex; }
80 set { imageIndex=value; }
83 public new ImeMode ImeMode
{
91 protected bool IsDefault
{
101 //public virtual ContentAlignment TextAlign {
102 // get { return label.TextAlign; }
103 // set { label.TextAlign = value; }
107 /// internal .NET framework supporting methods, not stubbed out:
108 /// - protected override void Dispose(bool);
109 /// - protected void ResetFlagsandPaint();
112 // I do not think this is part of the spec.
113 //protected override AccessibleObject CreateAccessibilityInstance()
115 // throw new NotImplementedException ();
118 /// [methods for events]
119 protected override void OnEnabledChanged (EventArgs e
)
121 base.OnEnabledChanged (e
);
124 protected override void OnGotFocus (EventArgs e
)
129 protected override void OnKeyDown (KeyEventArgs kevent
)
131 base.OnKeyDown (kevent
);
134 protected override void OnKeyUp (KeyEventArgs kevent
)
136 base.OnKeyUp (kevent
);
139 protected override void OnLostFocus (EventArgs e
)
141 base.OnLostFocus (e
);
144 protected override void OnMouseDown (MouseEventArgs e
)
146 base.OnMouseDown (e
);
149 protected override void OnMouseEnter (EventArgs e
)
151 base.OnMouseEnter (e
);
154 protected override void OnMouseLeave (EventArgs e
)
156 base.OnMouseLeave (e
);
159 protected override void OnMouseMove (MouseEventArgs e
)
161 base.OnMouseMove (e
);
164 protected override void OnMouseUp (MouseEventArgs e
)
169 protected override void OnPaint (PaintEventArgs e
)
174 protected override void OnParentChanged (EventArgs e
)
176 base.OnParentChanged (e
);
179 protected override void OnTextChanged (EventArgs e
)
181 base.OnTextChanged (e
);
184 protected override void OnVisibleChanged (EventArgs e
)
186 base.OnVisibleChanged (e
);
188 /// end of [methods for events]
190 protected override void WndProc (ref Message m
)
192 base.WndProc (ref m
);
195 /// --- ButtonBase.ButtonBaseAccessibleObject ---
196 /// the class is not stubbed, cause it's only used for .NET framework