| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- //
- // System.Windows.Forms.ButtonBase.cs
- //
- // Author:
- // stubbed out by Jaak Simm ([email protected])
- // implemented for Gtk+ by Rachel Hestilow ([email protected])
- //
- // (C) Ximian, Inc., 2002
- //
- using System.ComponentModel;
- using System.Drawing;
- namespace System.Windows.Forms
- {
- /// <summary>
- /// Implements the basic functionality common to button controls.
- /// ToDo note:
- /// - no methods are implemented
- /// </summary>
- public abstract class ButtonBase : Control
- {
- // private fields
- // FlatStyle flatStyle;
- // Image image;
- // ContentAlignment imageAlign;
- // int imageIndex;
- ContentAlignment textAlign;
- internal protected Label label;
- //
- // // --- Constructor ---
- protected ButtonBase() : base() {
- // flatStyle = FlatStyle.Standard;
- // image = null;
- // imageAlign = ContentAlignment.MiddleCenter;
- // imageIndex = -1;
- textAlign = ContentAlignment.MiddleCenter;
- label = new Label ();
- label.Text = Text;
- label.Visible = true;
- ConnectToClicked ();
- }
-
- internal protected void clicked_cb (object o, EventArgs args)
- {
- OnClick (EventArgs.Empty);
- }
-
- internal protected void ConnectToClicked ()
- {
- ((Gtk.Button) Widget).Clicked += new EventHandler (clicked_cb);
- }
-
- // --- Properties ---
- // [MonoTODO]
- // protected override CreateParams CreateParams {
- // get { throw new NotImplementedException (); }
- // }
- //
- // [MonoTODO]
- // protected override ImeMode DefaultImeMode {
- // get { throw new NotImplementedException (); }
- // }
- //
- // [MonoTODO]
- // protected override Size DefaultSize {
- // get { throw new NotImplementedException (); }
- // }
- //
- // public FlatStyle FlatStyle {
- // get { return flatStyle; }
- // set { flatStyle=value; }
- // }
- //
- // public Image Image {
- // get { return image; }
- // set { image=value; }
- // }
- //
- // public ContentAlignment ImageAlign {
- // get { return imageAlign; }
- // set { imageAlign=value; }
- // }
- //
- // public int ImageIndex {
- // get { return imageIndex; }
- // set { imageIndex=value; }
- // }
- //
- // [MonoTODO]
- // public new ImeMode ImeMode {
- // get { throw new NotImplementedException (); }
- // set { throw new NotImplementedException (); }
- // }
- //
- // protected bool IsDefault {
- // get { throw new NotImplementedException (); }
- // set { throw new NotImplementedException (); }
- // }
-
- public virtual ContentAlignment TextAlign {
- get { return label.TextAlign; }
- set { label.TextAlign=value; }
- }
- //
- //
- //
- //
- //
- // /// --- Methods ---
- // /// internal .NET framework supporting methods, not stubbed out:
- // /// - protected override void Dispose(bool);
- // /// - protected void ResetFlagsandPaint();
- // [MonoTODO]
- // protected override AccessibleObject CreateAccessibilityInstance() {
- // throw new NotImplementedException ();
- // }
- //
- // /// [methods for events]
- // [MonoTODO]
- // protected override void OnEnabledChanged(EventArgs e) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnGotFocus(EventArgs e) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnKeyDown(KeyEventArgs kevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnKeyUp(KeyEventArgs kevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnLostFocus(EventArgs e) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnMouseDown(MouseEventArgs mevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnMouseEnter(EventArgs eventargs) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnMouseLeave(EventArgs eventargs) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnMouseMove(MouseEventArgs mevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnMouseUp(MouseEventArgs mevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnPaint(PaintEventArgs pevent) {
- // throw new NotImplementedException ();
- // }
- //
- // [MonoTODO]
- // protected override void OnParentChanged(EventArgs e) {
- // throw new NotImplementedException ();
- // }
- //
- protected override void OnTextChanged(EventArgs e) {
- label.Text = Text;
- }
- //
- // [MonoTODO]
- // protected override void OnVisibleChanged(EventArgs e) {
- // throw new NotImplementedException ();
- // }
- // /// end of [methods for events]
- //
- // [MonoTODO]
- // protected override void WndProc(ref Message m) {
- // throw new NotImplementedException ();
- // }
- //
- //
- //
- // /// --- ButtonBase.ButtonBaseAccessibleObject ---
- // /// the class is not stubbed, cause it's only used for .NET framework
- //
- //
- }
- }
|