* Application.cs: fix compilation errors when debug is enabled.
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / UpDownBase.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 // 
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 // 
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2005 Novell, Inc.
21 //
22 // Authors:
23 //      Jonathan Gilbert        <logic@deltaq.org>
24 //
25 // Integration into MWF:
26 //      Peter Bartok            <pbartok@novell.com>
27 //
28
29 using System;
30 using System.Collections;
31 using System.ComponentModel;
32 using System.Drawing;
33 using System.Runtime.InteropServices;
34 using System.Windows.Forms;
35
36 namespace System.Windows.Forms
37 {
38 #if NET_2_0
39         [ClassInterface (ClassInterfaceType.AutoDispatch)]
40         [ComVisible (true)]
41 #endif
42         [Designer("System.Windows.Forms.Design.UpDownBaseDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
43         public abstract class UpDownBase : System.Windows.Forms.ContainerControl {
44                 #region UpDownSpinner Sub-class
45                 internal sealed class UpDownSpinner : Control {
46                         #region Local Variables
47                         private const int       InitialRepeatDelay = 50;
48                         private UpDownBase      owner;
49                         private Timer           tmrRepeat;
50                         private Rectangle       top_button_rect;
51                         private Rectangle       bottom_button_rect;
52                         private int             mouse_pressed;
53                         private int             mouse_x;
54                         private int             mouse_y;
55                         private int             repeat_delay;
56                         private int             repeat_counter;
57                         #endregion      // Local Variables
58
59                         #region Constructors
60                         public UpDownSpinner(UpDownBase owner) {
61                                 this.owner = owner;
62
63                                 mouse_pressed = 0;
64
65                                 this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
66                                 this.SetStyle(ControlStyles.DoubleBuffer, true);
67                                 this.SetStyle(ControlStyles.Opaque, true);
68                                 this.SetStyle(ControlStyles.ResizeRedraw, true);
69                                 this.SetStyle(ControlStyles.UserPaint, true);
70                                 this.SetStyle(ControlStyles.FixedHeight, true);
71
72                                 tmrRepeat = new Timer();
73
74                                 tmrRepeat.Enabled = false;
75                                 tmrRepeat.Interval = 10;
76                                 tmrRepeat.Tick += new EventHandler(tmrRepeat_Tick);
77
78                                 compute_rects();
79                         }
80                         #endregion      // Constructors
81
82                         #region Private & Internal Methods
83                         private void compute_rects() {
84                                 int top_button_height;
85                                 int bottom_button_height;
86
87                                 top_button_height = ClientSize.Height / 2;
88                                 bottom_button_height = ClientSize.Height - top_button_height;
89
90                                 top_button_rect = new Rectangle(0, 0, ClientSize.Width, top_button_height);
91                                 bottom_button_rect = new Rectangle(0, top_button_height, ClientSize.Width, bottom_button_height);
92                         }
93
94                         private void redraw(Graphics graphics) {
95                                 ButtonState top_button_state;
96                                 ButtonState bottom_button_state;
97
98                                 top_button_state = bottom_button_state = ButtonState.Normal;
99
100                                 if (mouse_pressed != 0) {
101                                         if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y)) {
102                                                 top_button_state = ButtonState.Pushed;
103                                         }
104
105                                         if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y)) {
106                                                 bottom_button_state = ButtonState.Pushed;
107                                         }
108                                 }
109
110                                 ControlPaint.DrawScrollButton(graphics, top_button_rect, ScrollButton.Up, top_button_state);
111                                 ControlPaint.DrawScrollButton(graphics, bottom_button_rect, ScrollButton.Down, bottom_button_state);
112                         }
113
114                         private void tmrRepeat_Tick(object sender, EventArgs e) {
115                                 if (repeat_delay > 1) {
116                                         repeat_counter++;
117
118                                         if (repeat_counter < repeat_delay) {
119                                                 return;
120                                         }
121
122                                         repeat_counter = 0;
123                                         repeat_delay = (repeat_delay * 3 / 4);
124                                 }
125
126                                 if (mouse_pressed == 0) {
127                                         tmrRepeat.Enabled = false;
128                                 }
129
130                                 if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y)) {
131                                         owner.UpButton();
132                                 }
133
134                                 if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y)) {
135                                         owner.DownButton();
136                                 }
137                         }
138                         #endregion      // Private & Internal Methods
139
140                         #region Protected Instance Methods
141                         protected override void OnMouseDown(MouseEventArgs e) {
142                                 if (e.Button != MouseButtons.Left) {
143                                         return;
144                                 }
145
146                                 if (top_button_rect.Contains(e.X, e.Y)) {
147                                         mouse_pressed = 1;
148                                         owner.UpButton();
149                                 } else if (bottom_button_rect.Contains(e.X, e.Y)) {
150                                         mouse_pressed = 2;
151                                         owner.DownButton();
152                                 }
153
154                                 mouse_x = e.X;
155                                 mouse_y = e.Y;
156                                 Capture = true;
157
158                                 tmrRepeat.Enabled = true;
159                                 repeat_counter = 0;
160                                 repeat_delay = InitialRepeatDelay;
161
162                                 Refresh ();
163                         }
164
165                         protected override void OnMouseMove(MouseEventArgs e) {
166                                 ButtonState before, after;
167
168                                 before = ButtonState.Normal;
169                                 if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y))
170                                         before = ButtonState.Pushed;
171                                 if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y))
172                                         before = ButtonState.Pushed;
173
174                                 mouse_x = e.X;
175                                 mouse_y = e.Y;
176
177                                 after = ButtonState.Normal;
178                                 if ((mouse_pressed == 1) && top_button_rect.Contains(mouse_x, mouse_y))
179                                         after = ButtonState.Pushed;
180                                 if ((mouse_pressed == 2) && bottom_button_rect.Contains(mouse_x, mouse_y))
181                                         after = ButtonState.Pushed;
182
183                                 if (before != after) {
184                                         if (after == ButtonState.Pushed) {
185                                                 tmrRepeat.Enabled = true;
186                                                 repeat_counter = 0;
187                                                 repeat_delay = InitialRepeatDelay;
188
189                                                 // fire off one right now too for good luck
190                                                 if (mouse_pressed == 1)
191                                                         owner.UpButton();
192                                                 if (mouse_pressed == 2)
193                                                         owner.DownButton();
194                                         }
195                                         else
196                                                 tmrRepeat.Enabled = false;
197
198                                         Refresh ();
199                                 }
200                         }
201
202                         protected override void OnMouseUp(MouseEventArgs e) {
203                                 mouse_pressed = 0;
204                                 Capture = false;
205
206                                 Refresh ();
207                         }
208
209                         protected override void OnMouseWheel(MouseEventArgs e) {
210                                 if (e.Delta > 0)
211                                         owner.UpButton();
212                                 else if (e.Delta < 0)
213                                         owner.DownButton();
214                         }
215
216                         protected override void OnPaint(PaintEventArgs e) {
217                                 redraw(e.Graphics);
218                         }
219
220                         protected override void OnResize(EventArgs e) {
221                                 base.OnResize(e);
222                                 compute_rects();
223                         }
224                         #endregion      // Protected Instance Methods
225
226                         
227                         internal void SetSelectable (bool selectable)
228                         {
229                                 SetStyle (ControlStyles.Selectable, selectable);
230                         }
231                 }
232                 #endregion      // UpDownSpinner Sub-class
233
234                 internal class UpDownTextBox : TextBox {
235
236                         //private UpDownBase owner;
237
238                         public UpDownTextBox (UpDownBase owner)
239                         {
240                                 //this.owner = owner;
241
242                                 SetStyle (ControlStyles.FixedWidth, false);
243                         }
244
245                         internal void SetSelectable (bool selectable)
246                         {
247                                 SetStyle (ControlStyles.Selectable, selectable);
248                         }
249
250                         internal void ActivateCaret (bool active)
251                         {
252                                 if (active)
253                                         document.CaretHasFocus ();
254                                 else
255                                         document.CaretLostFocus ();
256                         }
257
258                         protected override void OnGotFocus(EventArgs e)
259                         {
260                                 this.Parent.OnGotFocusInternal(e);
261                         }
262
263                         protected override void OnLostFocus(EventArgs e)
264                         {
265                                 this.Parent.OnLostFocusInternal(e);
266                         }
267                 }
268
269                 #region Local Variables
270                 internal UpDownTextBox          txtView;
271                 private UpDownSpinner           spnSpinner;
272                 private bool                    _InterceptArrowKeys = true;
273                 private LeftRightAlignment      _UpDownAlign;
274                 private bool                    changing_text;
275                 private bool                    user_edit;
276                 #endregion      // Local Variables
277
278                 #region Public Constructors
279                 public UpDownBase() {
280                         _UpDownAlign = LeftRightAlignment.Right;
281                         border_style = BorderStyle.Fixed3D;
282
283                         spnSpinner = new UpDownSpinner(this);
284
285                         txtView = new UpDownTextBox (this);
286                         txtView.ModifiedChanged += new EventHandler(OnChanged);
287                         txtView.AcceptsReturn = true;
288                         txtView.AutoSize = false;
289                         txtView.BorderStyle = BorderStyle.None;
290                         txtView.Location = new System.Drawing.Point(17, 17);
291                         txtView.TabIndex = TabIndex;
292
293                         SuspendLayout ();
294                         Controls.Add (spnSpinner);
295                         Controls.Add (txtView);
296                         ResumeLayout ();
297
298                         this.ActiveControl = txtView;
299
300                         Height = PreferredHeight;
301                         base.BackColor = txtView.BackColor;
302
303                         TabIndexChanged += new EventHandler (TabIndexChangedHandler);
304                         
305                         txtView.KeyDown += new KeyEventHandler(OnTextBoxKeyDown);
306                         txtView.KeyPress += new KeyPressEventHandler(OnTextBoxKeyPress);
307 //                      txtView.LostFocus += new EventHandler(OnTextBoxLostFocus);
308                         txtView.Resize += new EventHandler(OnTextBoxResize);
309                         txtView.TextChanged += new EventHandler(OnTextBoxTextChanged);
310
311                         txtView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
312
313                         // So the child controls don't get auto selected when the updown is selected
314                         auto_select_child = false;
315                         SetStyle(ControlStyles.FixedHeight, true);
316 #if NET_2_0
317                         SetStyle (ControlStyles.Opaque | ControlStyles.ResizeRedraw, true);
318                         SetStyle (ControlStyles.StandardClick | ControlStyles.UseTextForAccessibility, false);
319 #endif
320
321                         UpdateEditText ();
322                 }
323                 #endregion
324
325                 #region Private Methods
326                 void reseat_controls() {
327                         int text_displacement = 0;
328
329                         int spinner_width = 16;
330                         //int spinner_width = ClientSize.Height;
331
332                         if (_UpDownAlign == LeftRightAlignment.Left) {
333                                 spnSpinner.Bounds = new Rectangle(0, 0, spinner_width, ClientSize.Height);
334                                 text_displacement = spnSpinner.Width;
335
336                                 spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
337                         } else {
338                                 spnSpinner.Bounds = new Rectangle(ClientSize.Width - spinner_width, 0, spinner_width, ClientSize.Height);
339
340                                 spnSpinner.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
341                         }
342                         
343                         txtView.Bounds = new Rectangle(text_displacement, 0, ClientSize.Width - spinner_width, Height);
344                 }
345
346                 private void TabIndexChangedHandler (object sender, EventArgs e)
347                 {
348                         txtView.TabIndex = TabIndex;
349                 }
350
351                 internal override void OnPaintInternal (PaintEventArgs e) {
352                         e.Graphics.FillRectangle(ThemeEngine.Current.ResPool.GetSolidBrush(BackColor), ClientRectangle);
353                 }
354
355                 internal override void OnGotFocusInternal (EventArgs e)
356                 {
357                         base.OnGotFocusInternal (e);
358                         txtView.ActivateCaret (true);
359                         txtView.SetSelectable (false);
360                         spnSpinner.SetSelectable (false);
361                 }
362
363                 internal override void OnLostFocusInternal (EventArgs e)
364                 {
365                         base.OnLostFocusInternal (e);
366                         txtView.ActivateCaret (false);
367                         txtView.SetSelectable (true);
368                         spnSpinner.SetSelectable (true);
369                 }
370
371                 #endregion      // Private Methods
372
373                 #region Public Instance Properties
374                 [Browsable(false)]
375                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
376                 [EditorBrowsable(EditorBrowsableState.Never)]
377                 public override bool AutoScroll {
378                         get {
379                                 return base.AutoScroll;
380                         }
381
382                         set {
383                                 base.AutoScroll = value;
384                         }
385                 }
386
387                 [Browsable(false)]
388                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
389                 [EditorBrowsable(EditorBrowsableState.Never)]
390                 public new Size AutoScrollMargin {
391                         get { return base.AutoScrollMargin; }
392                         set { base.AutoScrollMargin = value; }
393                 }
394
395                 [Browsable(false)]
396                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
397                 [EditorBrowsable(EditorBrowsableState.Never)]
398                 public new Size AutoScrollMinSize {
399                         get { return base.AutoScrollMinSize; }
400                         set { base.AutoScrollMinSize = value; }
401                 }
402
403                 public override Color BackColor {
404                         get {
405                                 return base.BackColor;
406                         }
407
408                         set {
409                                 base.BackColor = value;
410                                 txtView.BackColor = value;
411                         }
412                 }
413
414                 [Browsable(false)]
415                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
416                 [EditorBrowsable(EditorBrowsableState.Never)]
417                 public override Image BackgroundImage {
418                         get {
419                                 return base.BackgroundImage;
420                         }
421                         set {
422                                 base.BackgroundImage = value;
423                                 txtView.BackgroundImage = value;
424                         }
425                 }
426
427
428                 [DefaultValue(BorderStyle.Fixed3D)]
429                 [DispId(-504)]
430                 public BorderStyle BorderStyle {
431                         get { return InternalBorderStyle; }
432                         set { InternalBorderStyle = value; }
433                 }
434
435                 public override ContextMenu ContextMenu {
436                         get {
437                                 return base.ContextMenu;
438                         }
439                         set {
440                                 base.ContextMenu = value;
441                                 txtView.ContextMenu = value;
442                                 spnSpinner.ContextMenu = value;
443                         }
444                 }
445
446                 [Browsable(false)]
447                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
448                 [EditorBrowsable(EditorBrowsableState.Never)]
449                 public new DockPaddingEdges DockPadding {
450                         get { return base.DockPadding; }
451                 }
452
453                 [Browsable(false)]
454                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
455                 public override bool Focused {
456                         get {
457                                 return base.Focused;
458                         }
459                 }
460
461                 public override Color ForeColor {
462                         get {
463                                 return base.ForeColor;
464                         }
465                         set {
466                                 base.ForeColor = value;
467                                 txtView.ForeColor = value;
468                         }
469                 }
470
471                 [DefaultValue(true)]
472                 public bool InterceptArrowKeys {
473                         get {
474                                 return _InterceptArrowKeys;
475                         }
476                         set {
477                                 _InterceptArrowKeys = value;
478                         }
479                 }
480
481                 [Browsable(false)]
482                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
483                 [EditorBrowsable(EditorBrowsableState.Advanced)]
484                 public int PreferredHeight {
485                         get {
486                                 // For some reason, the TextBox's PreferredHeight does not
487                                 // change when the Font property is assigned. Without a
488                                 // border, it will always be Font.Height anyway.
489                                 //int text_box_preferred_height = (txtView != null) ? txtView.PreferredHeight : Font.Height;
490                                 int text_box_preferred_height = Font.Height;
491
492                                 switch (border_style) {
493                                         case BorderStyle.FixedSingle:
494                                         case BorderStyle.Fixed3D:
495                                                 text_box_preferred_height += 3; // magic number? :-)
496
497                                                 return text_box_preferred_height + 4;
498
499                                         case BorderStyle.None:
500                                         default:
501                                                 return text_box_preferred_height;
502                                 }
503                         }
504                 }
505
506                 [DefaultValue(false)]
507                 public bool ReadOnly {
508                         get {
509                                 return txtView.ReadOnly;
510                         }
511                         set {
512                                 txtView.ReadOnly = value;
513                         }
514                 }
515
516                 [Localizable(true)]
517                 public override string Text {
518                         get {
519                                 if (txtView != null) {
520                                         return txtView.Text;
521                                 }
522                                 return "";
523                         }
524                         set {
525                                 bool suppress_validation = changing_text;
526
527                                 txtView.Text = value;
528
529                                 if (!suppress_validation)
530                                         ValidateEditText();
531                         }
532                 }
533
534                 [DefaultValue(HorizontalAlignment.Left)]
535                 [Localizable(true)]
536                 public HorizontalAlignment TextAlign {
537                         get {
538                                 return txtView.TextAlign;
539                         }
540                         set{
541                                 txtView.TextAlign = value;
542                         }
543                 }
544
545                 [DefaultValue(LeftRightAlignment.Right)]
546                 [Localizable(true)]
547                 public LeftRightAlignment UpDownAlign {
548                         get {
549                                 return _UpDownAlign;
550                         }
551                         set {
552                                 _UpDownAlign = value;
553
554                                 reseat_controls();
555                         }
556                 }
557                 #endregion      // Public Instance Properties
558
559                 #region Protected Instance Properties
560                 protected bool ChangingText {
561                         get {
562                                 return changing_text;
563                         }
564                         set {
565                                 changing_text = value;
566                         }
567                 }
568
569                 protected override CreateParams CreateParams {
570                         get {
571                                 return base.CreateParams;
572                         }
573                 }
574
575                 protected override Size DefaultSize {
576                         get {
577                                 return new Size(120, this.PreferredHeight);
578                         }
579                 }
580
581                 protected bool UserEdit {
582                         get {
583                                 return user_edit;
584                         }
585                         set {
586                                 user_edit = value;
587                         }
588                 }
589                 #endregion      // Protected Instance Properties
590
591                 #region Public Instance Methods
592                 public abstract void DownButton();
593                 public void Select(int start, int length) {
594                         txtView.Select(start, length);
595                 }
596
597                 public abstract void UpButton();
598                 #endregion      // Public Instance Methods
599
600                 #region Protected Instance Methods
601                 protected override void Dispose(bool disposing) {
602                         if (disposing) {
603                                 txtView.Dispose();
604                                 txtView = null;
605
606                                 spnSpinner.Dispose();
607                                 spnSpinner = null;
608                         }
609                         base.Dispose (disposing);
610                 }
611
612                 protected virtual void OnChanged(object source, EventArgs e) {
613                 }
614
615                 protected override void OnFontChanged(EventArgs e) {
616                         txtView.Font = this.Font;
617                         Height = PreferredHeight;
618                 }
619
620                 protected override void OnHandleCreated(EventArgs e) {
621                         base.OnHandleCreated (e);
622                 }
623
624                 protected override void OnLayout(LayoutEventArgs e) {
625                         base.OnLayout(e);
626                 }
627
628                 protected override void OnMouseWheel(MouseEventArgs e) {
629                         if (e.Delta > 0) 
630                         {
631                                 UpButton();
632                         } 
633                         else if (e.Delta < 0) 
634                         {
635                                 DownButton();
636                         }
637                 }
638
639                 protected virtual void OnTextBoxKeyDown(object source, KeyEventArgs e) {
640                         if (_InterceptArrowKeys) {
641                                 if ((e.KeyCode == Keys.Up) || (e.KeyCode == Keys.Down)) {
642                                         e.Handled = true;
643
644                                         if (e.KeyCode == Keys.Up)
645                                                 UpButton();
646                                         if (e.KeyCode == Keys.Down)
647                                                 DownButton();
648                                 }
649                         }
650
651                         OnKeyDown(e);
652                 }
653
654                 protected virtual void OnTextBoxKeyPress(object source, KeyPressEventArgs e) {
655                         if (e.KeyChar == '\r') {
656                                 e.Handled = true;
657                                 ValidateEditText();
658                         }
659                         OnKeyPress(e);
660                 }
661
662                 protected virtual void OnTextBoxLostFocus(object source, EventArgs e) {
663                         if (user_edit) {
664                                 ValidateEditText();
665                         }
666                 }
667
668                 protected virtual void OnTextBoxResize(object source, EventArgs e) {
669                         // compute the new height, taking the border into account
670                         Height = PreferredHeight;
671
672                         // let anchoring reposition the controls
673                 }
674
675                 protected virtual void OnTextBoxTextChanged(object source, EventArgs e) {
676                         if (changing_text) {
677                                 ChangingText = false;
678                         } else {
679                                 UserEdit = true;
680                         }
681
682                         OnTextChanged(e);
683                 }
684
685                 protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified) {
686                         base.SetBoundsCore(x, y, width, height, specified);
687
688                         if ((specified & BoundsSpecified.Size) != BoundsSpecified.None) {
689                                 reseat_controls();
690                         }
691                 }
692
693                 protected abstract void UpdateEditText();
694
695                 protected virtual void ValidateEditText() {
696                         // to be overridden by subclassers
697                 }
698
699                 [EditorBrowsable(EditorBrowsableState.Advanced)]
700                 protected override void WndProc(ref Message m) {
701
702                         switch((Msg) m.Msg) {
703                         case Msg.WM_KEYUP:
704                         case Msg.WM_KEYDOWN:
705                         case Msg.WM_CHAR:
706                                 XplatUI.SendMessage (txtView.Handle, (Msg) m.Msg, m.WParam, m.LParam);
707                                 break;
708                         default:
709                                 base.WndProc (ref m);
710                                 break;
711                         }
712                 }
713                 #endregion      // Protected Instance Methods
714
715                 #region Events
716                 [Browsable(false)]
717                 [EditorBrowsable(EditorBrowsableState.Never)]
718                 public new event EventHandler BackgroundImageChanged {
719                         add { base.BackgroundImageChanged += value; }
720                         remove { base.BackgroundImageChanged -= value; }
721                 }
722
723                 [Browsable(false)]
724                 [EditorBrowsable(EditorBrowsableState.Never)]
725                 public new event EventHandler MouseEnter {
726                         add { base.MouseEnter += value; }
727                         remove { base.MouseEnter -= value; }
728                 }
729
730                 [Browsable(false)]
731                 [EditorBrowsable(EditorBrowsableState.Never)]
732                 public new event EventHandler MouseHover {
733                         add { base.MouseHover += value; }
734                         remove { base.MouseHover -= value; }
735                 }
736
737                 [Browsable(false)]
738                 [EditorBrowsable(EditorBrowsableState.Never)]
739                 public new event EventHandler MouseLeave {
740                         add { base.MouseLeave += value; }
741                         remove { base.MouseLeave -= value; }
742                 }
743
744                 [Browsable(false)]
745                 [EditorBrowsable(EditorBrowsableState.Never)]
746                 public new event MouseEventHandler MouseMove {
747                         add { base.MouseMove += value; }
748                         remove { base.MouseMove -= value; }
749                 }
750                 #endregion      // Events
751         }
752 }