4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 // Copyright (c) 2006 Jonathan Pobst
26 // Jonathan Pobst (monkey@jpobst.com)
32 using System
.ComponentModel
;
34 namespace System
.Windows
.Forms
36 [DefaultEvent ("Click")]
37 [DefaultProperty ("Text")]
38 [DesignTimeVisible (false)]
40 [Designer ("System.Windows.Forms.Design.ToolStripItemDesigner, " + Consts
.AssemblySystem_Design
, "System.ComponentModel.Design.IDesigner")]
41 public abstract class ToolStripItem
: Component
, IDropTarget
, IComponent
, IDisposable
43 #region Private Variables
44 private AccessibleObject accessibility_object
;
45 private string accessible_default_action_description
;
46 private bool allow_drop
;
47 private ToolStripItemAlignment alignment
;
48 private AnchorStyles anchor
;
49 private bool available
;
50 private bool auto_size
;
51 private bool auto_tool_tip
;
52 private Color back_color
;
53 private Image background_image
;
54 private ImageLayout background_image_layout
;
55 private Rectangle bounds
;
56 private bool can_select
;
57 private ToolStripItemDisplayStyle display_style
;
58 private DockStyle dock
;
59 private bool double_click_enabled
;
61 private Size explicit_size
;
63 private Color fore_color
;
65 private ContentAlignment image_align
;
66 private int image_index
;
67 private string image_key
;
68 private ToolStripItemImageScaling image_scaling
;
69 private Color image_transparent_color
;
70 private bool is_disposed
;
71 internal bool is_pressed
;
72 private bool is_selected
;
73 private Padding margin
;
74 private MergeAction merge_action
;
75 private int merge_index
;
77 private ToolStripItemOverflow overflow
;
78 private ToolStrip owner
;
79 internal ToolStripItem owner_item
;
80 private Padding padding
;
81 private ToolStripItemPlacement placement
;
82 private RightToLeft right_to_left
;
83 private bool right_to_left_auto_mirror_image
;
86 private ContentAlignment text_align
;
87 private TextImageRelation text_image_relation
;
88 private string tool_tip_text
;
91 private ToolStrip parent
;
92 private Size text_size
;
95 #region Public Constructors
96 protected ToolStripItem ()
97 : this (String
.Empty
, null, null, String
.Empty
)
101 protected ToolStripItem (string text
, Image image
, EventHandler onClick
)
102 : this (text
, image
, onClick
, String
.Empty
)
106 protected ToolStripItem (string text
, Image image
, EventHandler onClick
, string name
)
108 this.alignment
= ToolStripItemAlignment
.Left
;
109 this.anchor
= AnchorStyles
.Left
| AnchorStyles
.Top
;
110 this.auto_size
= true;
111 this.auto_tool_tip
= this.DefaultAutoToolTip
;
112 this.available
= true;
113 this.back_color
= Control
.DefaultBackColor
;
114 this.background_image_layout
= ImageLayout
.Tile
;
115 this.can_select
= true;
116 this.display_style
= this.DefaultDisplayStyle
;
117 this.dock
= DockStyle
.None
;
119 this.font
= new Font ("Tahoma", 8.25f
);
120 this.fore_color
= Control
.DefaultForeColor
;
122 this.image_align
= ContentAlignment
.MiddleCenter
;
123 this.image_index
= -1;
124 this.image_key
= string.Empty
;
125 this.image_scaling
= ToolStripItemImageScaling
.SizeToFit
;
126 this.image_transparent_color
= Color
.Empty
;
127 this.margin
= this.DefaultMargin
;
128 this.merge_action
= MergeAction
.Append
;
129 this.merge_index
= -1;
131 this.overflow
= ToolStripItemOverflow
.AsNeeded
;
132 this.padding
= this.DefaultPadding
;
133 this.placement
= ToolStripItemPlacement
.None
;
134 this.right_to_left
= RightToLeft
.Inherit
;
135 this.bounds
.Size
= this.DefaultSize
;
137 this.text_align
= ContentAlignment
.MiddleCenter
;
138 this.text_image_relation
= TextImageRelation
.ImageBeforeText
;
141 this.Click
+= onClick
;
142 OnLayout (new LayoutEventArgs (null, string.Empty
));
146 #region Public Properties
148 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
149 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
150 public AccessibleObject AccessibilityObject
{
152 if (this.accessibility_object
== null)
153 this.accessibility_object
= CreateAccessibilityInstance ();
155 return this.accessibility_object
;
160 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
161 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
162 public string AccessibleDefaultActionDescription
{
164 if (this.accessibility_object
== null)
167 return this.accessible_default_action_description
;
169 set { this.accessible_default_action_description = value; }
173 [DefaultValue (null)]
174 public string AccessibleDescription
{
176 if (this.accessibility_object
== null)
179 return this.AccessibilityObject
.Description
;
181 set { this.AccessibilityObject.description = value; }
185 [DefaultValue (null)]
186 public string AccessibleName
{
188 if (this.accessibility_object
== null)
191 return this.AccessibilityObject
.Name
;
193 set { this.AccessibilityObject.Name = value; }
196 [DefaultValue (AccessibleRole
.Default
)]
197 public AccessibleRole AccessibleRole
{
200 if (this.accessibility_object
== null)
201 return AccessibleRole
.Default
;
203 return this.AccessibilityObject
.Role
;
205 set { this.AccessibilityObject.role = value; }
208 [DefaultValue (ToolStripItemAlignment
.Left
)]
209 public ToolStripItemAlignment Alignment
{
210 get { return this.alignment; }
212 if (!Enum
.IsDefined (typeof (ToolStripItemAlignment
), value))
213 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for ToolStripItemAlignment", value));
215 this.alignment
= value;
221 [DefaultValue (false)]
222 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
223 public virtual bool AllowDrop
{
224 get { return this.allow_drop; }
225 set { this.allow_drop = value; }
229 [DefaultValue (AnchorStyles
.Top
| AnchorStyles
.Left
)]
230 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
231 public AnchorStyles Anchor
{
232 get { return this.anchor; }
233 set { this.anchor = value; }
237 [DefaultValue (true)]
238 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Visible
)]
239 [RefreshProperties (RefreshProperties
.All
)]
240 public bool AutoSize
{
241 get { return this.auto_size; }
243 this.auto_size
= value;
244 this.CalculateAutoSize ();
248 [DefaultValue (false)]
249 public bool AutoToolTip
{
250 get { return this.auto_tool_tip; }
251 set { this.auto_tool_tip = value; }
255 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
256 public bool Available
{
257 get { return this.available; }
259 if (this.available
!= value) {
263 if (this.parent
!= null)
264 parent
.PerformLayout ();
266 OnAvailableChanged (EventArgs
.Empty
);
267 OnVisibleChanged (EventArgs
.Empty
);
272 public virtual Color BackColor
{
273 get { return this.back_color; }
275 if (this.back_color
!= value) {
277 OnBackColorChanged (EventArgs
.Empty
);
284 [DefaultValue (null)]
285 public virtual Image BackgroundImage
{
286 get { return this.background_image; }
288 if (this.background_image
!= value) {
289 this.background_image
= value;
296 [DefaultValue (ImageLayout
.Tile
)]
297 public virtual ImageLayout BackgroundImageLayout
{
298 get { return this.background_image_layout; }
300 if (this.background_image_layout
!= value) {
301 this.background_image_layout
= value;
308 public virtual Rectangle Bounds
{
309 get { return this.bounds; }
313 public virtual bool CanSelect
{
314 get { return this.can_select; }
318 public Rectangle ContentRectangle
{
320 // ToolStripLabels don't have a border
321 if (this is ToolStripLabel
|| this is ToolStripStatusLabel
)
322 return new Rectangle (0, 0, this.bounds
.Width
, this.bounds
.Height
);
324 if (this is ToolStripDropDownButton
&& (this as ToolStripDropDownButton
).ShowDropDownArrow
)
325 return new Rectangle (2, 2, this.bounds
.Width
- 13, this.bounds
.Height
- 4);
327 return new Rectangle (2, 2, this.bounds
.Width
- 4, this.bounds
.Height
- 4);
331 public virtual ToolStripItemDisplayStyle DisplayStyle
{
332 get { return this.display_style; }
334 if (this.display_style
!= value) {
335 this.display_style
= value;
336 this.CalculateAutoSize ();
337 OnDisplayStyleChanged (EventArgs
.Empty
);
338 if (this.Parent
!= null)
339 this.Parent
.PerformLayout ();
345 public bool IsDisposed
{
346 get { return this.is_disposed; }
350 [DefaultValue (DockStyle
.None
)]
351 public DockStyle Dock
{
352 get { return this.dock; }
354 if (this.dock
!= value) {
355 if (!Enum
.IsDefined (typeof (DockStyle
), value))
356 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for DockStyle", value));
359 this.CalculateAutoSize ();
364 [DefaultValue (false)]
365 public bool DoubleClickEnabled
{
366 get { return this.double_click_enabled; }
367 set { this.double_click_enabled = value; }
371 [DefaultValue (true)]
372 public virtual bool Enabled
{
373 get { return enabled; }
375 if (this.enabled
!= value) {
376 this.enabled
= value;
377 OnEnabledChanged (EventArgs
.Empty
);
384 public virtual Font Font
386 get { return this.font; }
388 if (this.font
!= value) {
390 this.CalculateAutoSize ();
391 this.OnFontChanged (EventArgs
.Empty
);
397 public virtual Color ForeColor
{
398 get { return this.fore_color; }
400 if (this.fore_color
!= value) {
401 this.fore_color
= value;
402 this.OnForeColorChanged (EventArgs
.Empty
);
409 [EditorBrowsable (EditorBrowsableState
.Always
)]
410 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
412 get { return this.Size.Height; }
414 this.bounds
.Height
= value;
415 this.explicit_size
.Height
= value;
418 this.CalculateAutoSize ();
419 this.OnBoundsChanged ();
426 public virtual Image Image
{
428 if (this.image
!= null)
431 if (this.image_index
>= 0)
432 if (this.owner
!= null && this.owner
.ImageList
!= null)
433 return this.owner
.ImageList
.Images
[this.image_index
];
436 if (!string.IsNullOrEmpty (this.image_key
))
437 if (this.owner
!= null && this.owner
.ImageList
!= null)
438 return this.owner
.ImageList
.Images
[this.image_key
];
443 if (this.image
!= value) {
445 this.image_index
= -1;
446 this.image_key
= string.Empty
;
447 this.CalculateAutoSize ();
454 [DefaultValue (ContentAlignment
.MiddleCenter
)]
455 public ContentAlignment ImageAlign
{
456 get { return this.image_align; }
458 if (!Enum
.IsDefined (typeof (ContentAlignment
), value))
459 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for ContentAlignment", value));
461 this.image_align
= value;
468 [RelatedImageList ("Owner.ImageList")]
469 //[TypeConverter (typeof (NoneExcludedImageIndexConverter))]
470 [RefreshProperties (RefreshProperties
.Repaint
)]
471 [Editor ("System.Windows.Forms.Design.ToolStripImageIndexEditor, " + Consts
.AssemblySystem_Design
, typeof (System
.Drawing
.Design
.UITypeEditor
))]
472 public int ImageIndex
{
473 get { return this.image_index; }
475 if (this.image_index
!= value) {
476 // Lamespec: MSDN says ArgumentException, tests say otherwise
478 throw new ArgumentOutOfRangeException ("ImageIndex cannot be less than -1");
480 this.image_index
= value;
482 this.image_key
= string.Empty
;
483 this.CalculateAutoSize ();
491 [RelatedImageList ("Owner.ImageList")]
492 [RefreshProperties (RefreshProperties
.Repaint
)]
493 [Editor ("System.Windows.Forms.Design.ToolStripImageIndexEditor, " + Consts
.AssemblySystem_Design
, typeof (System
.Drawing
.Design
.UITypeEditor
))]
494 public string ImageKey
{
495 get { return this.image_key; }
497 if (this.image_key
!= value) {
499 this.image_index
= -1;
500 this.image_key
= value;
501 this.CalculateAutoSize ();
508 [DefaultValue (ToolStripItemImageScaling
.SizeToFit
)]
509 public ToolStripItemImageScaling ImageScaling
{
510 get { return this.image_scaling; }
512 this.image_scaling
= value;
513 this.CalculateAutoSize ();
519 public Color ImageTransparentColor
{
520 get { return this.image_transparent_color; }
521 set { this.image_transparent_color = value; }
525 public bool IsOnDropDown
{
527 if (this.parent
!= null && this.parent
is ToolStripDropDown
)
535 public bool IsOnOverflow
{
536 get { return this.placement == ToolStripItemPlacement.Overflow; }
539 public Padding Margin
{
540 get { return this.margin; }
543 this.CalculateAutoSize ();
547 [DefaultValue (MergeAction
.Append
)]
548 public MergeAction MergeAction
{
549 get { return this.merge_action; }
551 if (!Enum
.IsDefined (typeof (MergeAction
), value))
552 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for MergeAction", value));
554 this.merge_action
= value;
559 public int MergeIndex
{
560 get { return this.merge_index; }
561 set { this.merge_index = value; }
564 [DefaultValue (null)]
567 get { return this.name; }
568 set { this.name = value; }
571 [DefaultValue (ToolStripItemOverflow
.AsNeeded
)]
572 public ToolStripItemOverflow Overflow
{
573 get { return this.overflow; }
575 if (this.overflow
!= value) {
576 if (!Enum
.IsDefined (typeof (ToolStripItemOverflow
), value))
577 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for ToolStripItemOverflow", value));
579 this.overflow
= value;
582 owner
.PerformLayout ();
588 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
589 public ToolStrip Owner
{
590 get { return this.owner; }
592 if (this.owner
!= value) {
594 this.CalculateAutoSize ();
595 OnOwnerChanged (EventArgs
.Empty
);
601 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
602 public ToolStripItem OwnerItem
{
603 get { return this.owner_item; }
606 public virtual Padding Padding
{
607 get { return this.padding; }
609 this.padding
= value;
610 this.CalculateAutoSize ();
616 public ToolStripItemPlacement Placement
{
617 get { return this.placement; }
621 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
622 public virtual bool Pressed { get { return this.is_pressed; }
}
624 [MonoTODO ("Stub, not implemented")]
626 public virtual RightToLeft RightToLeft
{
627 get { return this.right_to_left; }
629 if (this.right_to_left
!= value) {
630 this.right_to_left
= value;
631 this.OnRightToLeftChanged (EventArgs
.Empty
);
637 [DefaultValue (false)]
638 public bool RightToLeftAutoMirrorImage
{
639 get { return this.right_to_left_auto_mirror_image; }
641 if (this.right_to_left_auto_mirror_image
!= value) {
642 this.right_to_left_auto_mirror_image
= value;
649 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
650 public virtual bool Selected { get { return this.is_selected; }
}
653 public virtual Size Size
{
655 if (!this.AutoSize
&& this.explicit_size
!= Size
.Empty
)
656 return this.explicit_size
;
658 return this.bounds
.Size
;
661 this.bounds
.Size
= value;
662 this.explicit_size
= value;
665 this.CalculateAutoSize ();
666 this.OnBoundsChanged ();
671 [Localizable (false)]
673 [DefaultValue (null)]
674 [TypeConverter (typeof (StringConverter
))]
676 get { return this.tag; }
677 set { this.tag = value; }
682 public virtual string Text
684 get { return this.text; }
686 if (this.text
!= value) {
688 this.CalculateAutoSize ();
689 this.OnTextChanged (EventArgs
.Empty
);
696 [DefaultValue (ContentAlignment
.MiddleCenter
)]
697 public virtual ContentAlignment TextAlign
{
698 get { return this.text_align; }
700 if (!Enum
.IsDefined (typeof (ContentAlignment
), value))
701 throw new InvalidEnumArgumentException (string.Format ("Enum argument value '{0}' is not valid for ContentAlignment", value));
702 this.text_align
= value;
708 [DefaultValue (TextImageRelation
.ImageBeforeText
)]
709 public TextImageRelation TextImageRelation
{
710 get { return this.text_image_relation; }
712 this.text_image_relation
= value;
713 this.CalculateAutoSize ();
719 [Editor ("System.ComponentModel.Design.MultilineStringEditor, " + Consts
.AssemblySystem_Design
,
720 "System.Drawing.Design.UITypeEditor, " + Consts
.AssemblySystem_Drawing
)]
721 public string ToolTipText
{
722 get { return this.tool_tip_text; }
723 set { this.tool_tip_text = value; }
727 public bool Visible
{
729 if (this.parent
== null)
732 return this.visible
&& this.parent
.Visible
;
735 if (this.visible
!= value) {
736 this.available
= value;
737 this.SetVisibleCore (value);
743 [EditorBrowsable (EditorBrowsableState
.Always
)]
744 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
746 get { return this.Size.Width; }
748 this.bounds
.Width
= value;
749 this.explicit_size
.Width
= value;
752 this.CalculateAutoSize ();
753 this.OnBoundsChanged ();
760 #region Protected Properties
761 protected virtual bool DefaultAutoToolTip { get { return false; }
}
762 protected virtual ToolStripItemDisplayStyle DefaultDisplayStyle { get { return ToolStripItemDisplayStyle.ImageAndText; }
}
763 protected internal virtual Padding DefaultMargin { get { return new Padding (0, 1, 0, 2); }
}
764 protected virtual Padding DefaultPadding { get { return new Padding (); }
}
765 protected virtual Size DefaultSize { get { return new Size (23, 23); }
}
766 protected internal virtual bool DismissWhenClicked { get { return true; }
}
768 [DesignerSerializationVisibility (DesignerSerializationVisibility
.Hidden
)]
769 protected internal ToolStrip Parent
{
770 get { return this.parent; }
772 if (this.parent
!= value) {
773 ToolStrip old_parent
= this.parent
;
775 OnParentChanged(old_parent
, this.parent
);
779 protected internal virtual bool ShowKeyboardCues { get { return false; }
}
782 #region Public Methods
783 public ToolStrip
GetCurrentParent ()
788 public virtual Size
GetPreferredSize (Size constrainingSize
)
790 return this.CalculatePreferredSize (constrainingSize
);
793 public void Invalidate ()
796 parent
.Invalidate (this.bounds
);
799 public void Invalidate (Rectangle r
)
802 parent
.Invalidate (r
);
805 public void PerformClick ()
807 this.OnClick (EventArgs
.Empty
);
810 [EditorBrowsable (EditorBrowsableState
.Never
)]
811 public virtual void ResetBackColor () { this.BackColor = Control.DefaultBackColor; }
813 [EditorBrowsable (EditorBrowsableState
.Never
)]
814 public virtual void ResetDisplayStyle () { this.display_style = this.DefaultDisplayStyle; }
816 [EditorBrowsable (EditorBrowsableState
.Never
)]
817 public virtual void ResetFont () { this.font = new Font ("Tahoma", 8.25f); }
819 [EditorBrowsable (EditorBrowsableState
.Never
)]
820 public virtual void ResetForeColor () { this.ForeColor = Control.DefaultForeColor; }
822 [EditorBrowsable (EditorBrowsableState
.Never
)]
823 public virtual void ResetImage () { this.image = null; }
825 [EditorBrowsable (EditorBrowsableState
.Never
)]
826 public void ResetMargin () { this.margin = this.DefaultMargin; }
828 [EditorBrowsable (EditorBrowsableState
.Never
)]
829 public void ResetPadding () { this.padding = this.DefaultPadding; }
831 public void Select ()
833 if (!this.is_selected
&& this.CanSelect
) {
834 this.is_selected
= true;
836 this.Parent
.NotifySelectedChanged (this);
840 public override string ToString ()
846 #region Protected Methods
847 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
848 protected virtual AccessibleObject
CreateAccessibilityInstance ()
850 return new ToolStripItemAccessibleObject (this);
853 protected override void Dispose (bool disposing
)
855 if (!is_disposed
&& disposing
)
858 base.Dispose (disposing
);
861 protected internal virtual bool IsInputChar (char charCode
)
866 protected internal virtual bool IsInputKey (Keys keyData
)
871 protected virtual void OnAvailableChanged (EventArgs e
)
873 EventHandler eh
= (EventHandler
)(Events
[AvailableChangedEvent
]);
878 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
879 protected virtual void OnBackColorChanged (EventArgs e
)
881 EventHandler eh
= (EventHandler
)(Events
[BackColorChangedEvent
]);
886 protected virtual void OnBoundsChanged ()
888 OnLayout (new LayoutEventArgs(null, string.Empty
));
891 protected virtual void OnClick (EventArgs e
)
893 EventHandler eh
= (EventHandler
)(Events
[ClickEvent
]);
898 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
899 protected virtual void OnDisplayStyleChanged (EventArgs e
)
901 EventHandler eh
= (EventHandler
)(Events
[DisplayStyleChangedEvent
]);
906 protected virtual void OnDoubleClick (EventArgs e
)
908 EventHandler eh
= (EventHandler
)(Events
[DoubleClickEvent
]);
912 if (!double_click_enabled
)
916 void IDropTarget
.OnDragDrop (DragEventArgs e
)
921 void IDropTarget
.OnDragEnter (DragEventArgs e
)
926 void IDropTarget
.OnDragLeave (EventArgs e
)
931 void IDropTarget
.OnDragOver (DragEventArgs e
)
936 protected virtual void OnEnabledChanged (EventArgs e
)
938 EventHandler eh
= (EventHandler
)(Events
[EnabledChangedEvent
]);
943 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
944 protected virtual void OnFontChanged (EventArgs e
)
948 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
949 protected virtual void OnForeColorChanged (EventArgs e
)
951 EventHandler eh
= (EventHandler
)(Events
[ForeColorChangedEvent
]);
956 protected virtual void OnLayout (LayoutEventArgs e
)
960 protected virtual void OnLocationChanged (EventArgs e
)
962 EventHandler eh
= (EventHandler
)(Events
[LocationChangedEvent
]);
967 protected virtual void OnMouseDown (MouseEventArgs e
)
970 this.is_pressed
= true;
973 MouseEventHandler eh
= (MouseEventHandler
)(Events
[MouseDownEvent
]);
979 protected virtual void OnMouseEnter (EventArgs e
)
983 EventHandler eh
= (EventHandler
)(Events
[MouseEnterEvent
]);
988 protected virtual void OnMouseHover (EventArgs e
)
991 EventHandler eh
= (EventHandler
)(Events
[MouseHoverEvent
]);
997 protected virtual void OnMouseLeave (EventArgs e
)
999 if (this.CanSelect
) {
1000 this.is_selected
= false;
1001 this.is_pressed
= false;
1005 EventHandler eh
= (EventHandler
)(Events
[MouseLeaveEvent
]);
1010 protected virtual void OnMouseMove (MouseEventArgs e
)
1013 MouseEventHandler eh
= (MouseEventHandler
)(Events
[MouseMoveEvent
]);
1019 protected virtual void OnMouseUp (MouseEventArgs e
)
1022 this.is_pressed
= false;
1025 if (this.IsOnDropDown
)
1026 if (!(this is ToolStripDropDownItem
) || !(this as ToolStripDropDownItem
).HasDropDownItems
|| (this as ToolStripDropDownItem
).DropDown
.Visible
== false) {
1027 if ((this.Parent
as ToolStripDropDown
).OwnerItem
!= null)
1028 ((this.Parent
as ToolStripDropDown
).OwnerItem
as ToolStripDropDownItem
).HideDropDown ();
1030 (this.Parent
as ToolStripDropDown
).Hide ();
1034 MouseEventHandler eh
= (MouseEventHandler
)(Events
[MouseUpEvent
]);
1040 protected virtual void OnOwnerChanged (EventArgs e
)
1042 EventHandler eh
= (EventHandler
)(Events
[OwnerChangedEvent
]);
1047 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
1048 protected internal virtual void OnOwnerFontChanged (EventArgs e
)
1052 protected virtual void OnPaint (PaintEventArgs e
)
1054 if (this.parent
!= null)
1055 this.parent
.Renderer
.DrawItemBackground (new ToolStripItemRenderEventArgs (e
.Graphics
, this));
1057 PaintEventHandler eh
= (PaintEventHandler
)(Events
[PaintEvent
]);
1062 // This is never called.
1063 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
1064 protected virtual void OnParentBackColorChanged (EventArgs e
)
1068 protected virtual void OnParentChanged (ToolStrip oldParent
, ToolStrip newParent
)
1070 if (oldParent
!= null)
1071 oldParent
.PerformLayout ();
1073 if (newParent
!= null)
1074 newParent
.PerformLayout ();
1077 protected internal virtual void OnParentEnabledChanged (EventArgs e
)
1079 this.OnEnabledChanged (e
);
1082 // This is never called.
1083 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
1084 protected virtual void OnParentForeColorChanged (EventArgs e
)
1088 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
1089 protected internal virtual void OnParentRightToLeftChanged (EventArgs e
)
1091 this.OnRightToLeftChanged (e
);
1094 protected virtual void OnRightToLeftChanged (EventArgs e
)
1096 EventHandler eh
= (EventHandler
)(Events
[RightToLeftChangedEvent
]);
1101 [EditorBrowsable (EditorBrowsableState
.Advanced
)]
1102 protected virtual void OnTextChanged (EventArgs e
)
1104 EventHandler eh
= (EventHandler
)(Events
[TextChangedEvent
]);
1109 protected virtual void OnVisibleChanged (EventArgs e
)
1111 EventHandler eh
= (EventHandler
)(Events
[VisibleChangedEvent
]);
1116 protected internal virtual bool ProcessCmdKey (ref Message m
, Keys keyData
)
1121 protected internal virtual bool ProcessDialogKey (Keys keyData
)
1123 if (this.Selected
&& keyData
== Keys
.Enter
) {
1124 this.FireEvent (EventArgs
.Empty
, ToolStripItemEventType
.Click
);
1131 // ProcessMnemonic will only be called if we are supposed to handle
1132 // it. None of that fancy "thinking" needed!
1133 protected internal virtual bool ProcessMnemonic (char charCode
)
1135 this.PerformClick ();
1139 protected internal virtual void SetBounds (Rectangle bounds
)
1141 if (this.bounds
!= bounds
) {
1142 this.bounds
= bounds
;
1147 protected virtual void SetVisibleCore (bool visible
)
1149 this.visible
= visible
;
1150 this.OnVisibleChanged (EventArgs
.Empty
);
1155 #region Public Events
1156 static object AvailableChangedEvent
= new object ();
1157 static object BackColorChangedEvent
= new object ();
1158 static object ClickEvent
= new object ();
1159 static object DisplayStyleChangedEvent
= new object ();
1160 static object DoubleClickEvent
= new object ();
1161 static object EnabledChangedEvent
= new object ();
1162 static object ForeColorChangedEvent
= new object ();
1163 static object LocationChangedEvent
= new object ();
1164 static object MouseDownEvent
= new object ();
1165 static object MouseEnterEvent
= new object ();
1166 static object MouseHoverEvent
= new object ();
1167 static object MouseLeaveEvent
= new object ();
1168 static object MouseMoveEvent
= new object ();
1169 static object MouseUpEvent
= new object ();
1170 static object OwnerChangedEvent
= new object ();
1171 static object PaintEvent
= new object ();
1172 static object RightToLeftChangedEvent
= new object ();
1173 static object TextChangedEvent
= new object ();
1174 static object VisibleChangedEvent
= new object ();
1177 public event EventHandler AvailableChanged
{
1178 add { Events.AddHandler (AvailableChangedEvent, value); }
1179 remove {Events.RemoveHandler (AvailableChangedEvent, value); }
1182 public event EventHandler BackColorChanged
{
1183 add { Events.AddHandler (BackColorChangedEvent, value); }
1184 remove {Events.RemoveHandler (BackColorChangedEvent, value); }
1187 public event EventHandler Click
{
1188 add { Events.AddHandler (ClickEvent, value); }
1189 remove {Events.RemoveHandler (ClickEvent, value); }
1192 public event EventHandler DisplayStyleChanged
{
1193 add { Events.AddHandler (DisplayStyleChangedEvent, value); }
1194 remove {Events.RemoveHandler (DisplayStyleChangedEvent, value); }
1197 public event EventHandler DoubleClick
{
1198 add { Events.AddHandler (DoubleClickEvent, value); }
1199 remove {Events.RemoveHandler (DoubleClickEvent, value); }
1202 public event EventHandler EnabledChanged
{
1203 add { Events.AddHandler (EnabledChangedEvent, value); }
1204 remove {Events.RemoveHandler (EnabledChangedEvent, value); }
1207 public event EventHandler ForeColorChanged
{
1208 add { Events.AddHandler (ForeColorChangedEvent, value); }
1209 remove {Events.RemoveHandler (ForeColorChangedEvent, value); }
1212 public event EventHandler LocationChanged
{
1213 add { Events.AddHandler (LocationChangedEvent, value); }
1214 remove {Events.RemoveHandler (LocationChangedEvent, value); }
1217 public event MouseEventHandler MouseDown
{
1218 add { Events.AddHandler (MouseDownEvent, value); }
1219 remove {Events.RemoveHandler (MouseDownEvent, value); }
1222 public event EventHandler MouseEnter
{
1223 add { Events.AddHandler (MouseEnterEvent, value); }
1224 remove {Events.RemoveHandler (MouseEnterEvent, value); }
1227 public event EventHandler MouseHover
{
1228 add { Events.AddHandler (MouseHoverEvent, value); }
1229 remove {Events.RemoveHandler (MouseHoverEvent, value); }
1232 public event EventHandler MouseLeave
{
1233 add { Events.AddHandler (MouseLeaveEvent, value); }
1234 remove {Events.RemoveHandler (MouseLeaveEvent, value); }
1237 public event MouseEventHandler MouseMove
{
1238 add { Events.AddHandler (MouseMoveEvent, value); }
1239 remove {Events.RemoveHandler (MouseMoveEvent, value); }
1242 public event MouseEventHandler MouseUp
{
1243 add { Events.AddHandler (MouseUpEvent, value); }
1244 remove {Events.RemoveHandler (MouseUpEvent, value); }
1247 public event EventHandler OwnerChanged
{
1248 add { Events.AddHandler (OwnerChangedEvent, value); }
1249 remove {Events.RemoveHandler (OwnerChangedEvent, value); }
1252 public event PaintEventHandler Paint
{
1253 add { Events.AddHandler (PaintEvent, value); }
1254 remove {Events.RemoveHandler (PaintEvent, value); }
1257 public event EventHandler RightToLeftChanged
{
1258 add { Events.AddHandler (RightToLeftChangedEvent, value); }
1259 remove { Events.RemoveHandler (RightToLeftChangedEvent, value); }
1262 public event EventHandler TextChanged
{
1263 add { Events.AddHandler (TextChangedEvent, value); }
1264 remove {Events.RemoveHandler (TextChangedEvent, value); }
1267 public event EventHandler VisibleChanged
{
1268 add { Events.AddHandler (VisibleChangedEvent, value); }
1269 remove {Events.RemoveHandler (VisibleChangedEvent, value); }
1273 #region Internal Methods
1274 internal Rectangle
AlignInRectangle (Rectangle outer
, Size inner
, ContentAlignment align
)
1279 if (align
== ContentAlignment
.BottomLeft
|| align
== ContentAlignment
.MiddleLeft
|| align
== ContentAlignment
.TopLeft
)
1281 else if (align
== ContentAlignment
.BottomCenter
|| align
== ContentAlignment
.MiddleCenter
|| align
== ContentAlignment
.TopCenter
)
1282 x
= Math
.Max (outer
.X
+ ((outer
.Width
- inner
.Width
) / 2), outer
.Left
);
1283 else if (align
== ContentAlignment
.BottomRight
|| align
== ContentAlignment
.MiddleRight
|| align
== ContentAlignment
.TopRight
)
1284 x
= outer
.Right
- inner
.Width
;
1285 if (align
== ContentAlignment
.TopCenter
|| align
== ContentAlignment
.TopLeft
|| align
== ContentAlignment
.TopRight
)
1287 else if (align
== ContentAlignment
.MiddleCenter
|| align
== ContentAlignment
.MiddleLeft
|| align
== ContentAlignment
.MiddleRight
)
1288 y
= outer
.Y
+ (outer
.Height
- inner
.Height
) / 2;
1289 else if (align
== ContentAlignment
.BottomCenter
|| align
== ContentAlignment
.BottomRight
|| align
== ContentAlignment
.BottomLeft
)
1290 y
= outer
.Bottom
- inner
.Height
;
1292 return new Rectangle (x
, y
, Math
.Min (inner
.Width
, outer
.Width
), Math
.Min (inner
.Height
, outer
.Height
));
1295 internal void CalculateAutoSize ()
1297 this.text_size
= TextRenderer
.MeasureText (this.Text
== null ? string.Empty
: this.text
, this.Font
, Size
.Empty
, TextFormatFlags
.HidePrefix
);
1299 if (!this.auto_size
|| this is ToolStripControlHost
)
1301 //this.text_size.Width += 6;
1303 Size final_size
= this.CalculatePreferredSize (Size
.Empty
);
1305 if (final_size
!= this.Size
) {
1306 this.bounds
.Width
= final_size
.Width
;
1307 if (this.parent
!= null)
1308 this.parent
.PerformLayout ();
1312 internal virtual Size
CalculatePreferredSize (Size constrainingSize
)
1314 if (!this.auto_size
)
1315 return this.explicit_size
;
1317 Size preferred_size
= this.DefaultSize
;
1319 switch (this.display_style
) {
1320 case ToolStripItemDisplayStyle
.Text
:
1321 int width
= text_size
.Width
+ this.padding
.Horizontal
;
1322 int height
= text_size
.Height
+ this.padding
.Vertical
;
1323 preferred_size
= new Size (width
, height
);
1325 case ToolStripItemDisplayStyle
.Image
:
1326 if (this.Image
== null)
1327 preferred_size
= this.DefaultSize
;
1329 switch (this.image_scaling
) {
1330 case ToolStripItemImageScaling
.None
:
1331 preferred_size
= this.Image
.Size
;
1333 case ToolStripItemImageScaling
.SizeToFit
:
1334 if (this.parent
== null)
1335 preferred_size
= this.Image
.Size
;
1337 preferred_size
= this.parent
.ImageScalingSize
;
1342 case ToolStripItemDisplayStyle
.ImageAndText
:
1343 int width2
= text_size
.Width
+ this.padding
.Horizontal
;
1344 int height2
= text_size
.Height
+ this.padding
.Vertical
;
1346 if (this.Image
!= null) {
1347 switch (this.text_image_relation
) {
1348 case TextImageRelation
.Overlay
:
1349 width2
= Math
.Max (width2
, this.Image
.Width
);
1350 height2
= Math
.Max (height2
, this.Image
.Height
);
1352 case TextImageRelation
.ImageAboveText
:
1353 case TextImageRelation
.TextAboveImage
:
1354 width2
= Math
.Max (width2
, this.Image
.Width
);
1355 height2
+= this.Image
.Height
;
1357 case TextImageRelation
.ImageBeforeText
:
1358 case TextImageRelation
.TextBeforeImage
:
1359 height2
= Math
.Max (height2
, this.Image
.Height
);
1360 width2
+= this.Image
.Width
;
1365 preferred_size
= new Size (width2
, height2
);
1369 if (!(this is ToolStripLabel
)) { // Everything but labels have a border
1370 preferred_size
.Height
+= 4;
1371 preferred_size
.Width
+= 4;
1374 // Account for ToolStripDropDownButton's drop down arrow
1375 if (this is ToolStripDropDownButton
&& (this as ToolStripDropDownButton
).ShowDropDownArrow
)
1376 preferred_size
.Width
+= 9;
1378 return preferred_size
;
1381 internal void CalculateTextAndImageRectangles (out Rectangle text_rect
, out Rectangle image_rect
)
1383 this.CalculateTextAndImageRectangles (this.ContentRectangle
, out text_rect
, out image_rect
);
1386 internal void CalculateTextAndImageRectangles (Rectangle contentRectangle
, out Rectangle text_rect
, out Rectangle image_rect
)
1388 text_rect
= Rectangle
.Empty
;
1389 image_rect
= Rectangle
.Empty
;
1391 switch (this.display_style
) {
1392 case ToolStripItemDisplayStyle
.None
:
1394 case ToolStripItemDisplayStyle
.Text
:
1395 if (this.text
!= string.Empty
)
1396 text_rect
= AlignInRectangle (contentRectangle
, this.text_size
, this.text_align
);
1398 case ToolStripItemDisplayStyle
.Image
:
1399 if (this.Image
!= null)
1400 image_rect
= AlignInRectangle (contentRectangle
, GetImageSize (), this.image_align
);
1402 case ToolStripItemDisplayStyle
.ImageAndText
:
1403 if (this.text
!= string.Empty
&& this.Image
== null)
1404 text_rect
= AlignInRectangle (contentRectangle
, this.text_size
, this.text_align
);
1405 else if (this.text
== string.Empty
&& this.Image
!= null)
1406 image_rect
= AlignInRectangle (contentRectangle
, GetImageSize (), this.image_align
);
1407 else if (this.text
== string.Empty
&& this.Image
== null)
1410 Rectangle text_area
;
1411 Rectangle image_area
;
1413 switch (this.text_image_relation
) {
1414 case TextImageRelation
.Overlay
:
1415 text_rect
= AlignInRectangle (contentRectangle
, this.text_size
, this.text_align
);
1416 image_rect
= AlignInRectangle (contentRectangle
, GetImageSize (), this.image_align
);
1418 case TextImageRelation
.ImageAboveText
:
1419 text_area
= new Rectangle (contentRectangle
.Left
, contentRectangle
.Bottom
- (text_size
.Height
- 4), contentRectangle
.Width
, text_size
.Height
- 4);
1420 image_area
= new Rectangle (contentRectangle
.Left
, contentRectangle
.Top
, contentRectangle
.Width
, contentRectangle
.Height
- text_area
.Height
);
1422 text_rect
= AlignInRectangle (text_area
, this.text_size
, this.text_align
);
1423 image_rect
= AlignInRectangle (image_area
, GetImageSize (), this.image_align
);
1425 case TextImageRelation
.TextAboveImage
:
1426 text_area
= new Rectangle (contentRectangle
.Left
, contentRectangle
.Top
, contentRectangle
.Width
, text_size
.Height
- 4);
1427 image_area
= new Rectangle (contentRectangle
.Left
, text_area
.Bottom
, contentRectangle
.Width
, contentRectangle
.Height
- text_area
.Height
);
1429 text_rect
= AlignInRectangle (text_area
, this.text_size
, this.text_align
);
1430 image_rect
= AlignInRectangle (image_area
, GetImageSize (), this.image_align
);
1432 case TextImageRelation
.ImageBeforeText
:
1433 LayoutTextBeforeOrAfterImage (contentRectangle
, false, text_size
, GetImageSize (), text_align
, image_align
, out text_rect
, out image_rect
);
1435 case TextImageRelation
.TextBeforeImage
:
1436 LayoutTextBeforeOrAfterImage (contentRectangle
, true, text_size
, GetImageSize (), text_align
, image_align
, out text_rect
, out image_rect
);
1444 internal virtual void Dismiss (ToolStripDropDownCloseReason reason
)
1447 this.is_selected
= false;
1452 internal virtual ToolStrip
GetTopLevelToolStrip ()
1454 if (this.Parent
!= null)
1455 return this.Parent
.GetTopLevelToolStrip ();
1460 private void LayoutTextBeforeOrAfterImage (Rectangle totalArea
, bool textFirst
, Size textSize
, Size imageSize
, ContentAlignment textAlign
, ContentAlignment imageAlign
, out Rectangle textRect
, out Rectangle imageRect
)
1462 int element_spacing
= 0; // Spacing between the Text and the Image
1463 int total_width
= textSize
.Width
+ element_spacing
+ imageSize
.Width
;
1464 int excess_width
= totalArea
.Width
- total_width
;
1467 Rectangle final_text_rect
;
1468 Rectangle final_image_rect
;
1470 HorizontalAlignment h_text
= GetHorizontalAlignment (textAlign
);
1471 HorizontalAlignment h_image
= GetHorizontalAlignment (imageAlign
);
1473 if (h_image
== HorizontalAlignment
.Left
)
1475 else if (h_image
== HorizontalAlignment
.Right
&& h_text
== HorizontalAlignment
.Right
)
1476 offset
= excess_width
;
1477 else if (h_image
== HorizontalAlignment
.Center
&& (h_text
== HorizontalAlignment
.Left
|| h_text
== HorizontalAlignment
.Center
))
1478 offset
+= (int)(excess_width
/ 3);
1480 offset
+= (int)(2 * (excess_width
/ 3));
1483 final_text_rect
= new Rectangle (totalArea
.Left
+ offset
, AlignInRectangle (totalArea
, textSize
, textAlign
).Top
, textSize
.Width
, textSize
.Height
);
1484 final_image_rect
= new Rectangle (final_text_rect
.Right
+ element_spacing
, AlignInRectangle (totalArea
, imageSize
, imageAlign
).Top
, imageSize
.Width
, imageSize
.Height
);
1486 final_image_rect
= new Rectangle (totalArea
.Left
+ offset
, AlignInRectangle (totalArea
, imageSize
, imageAlign
).Top
, imageSize
.Width
, imageSize
.Height
);
1487 final_text_rect
= new Rectangle (final_image_rect
.Right
+ element_spacing
, AlignInRectangle (totalArea
, textSize
, textAlign
).Top
, textSize
.Width
, textSize
.Height
);
1490 textRect
= final_text_rect
;
1491 imageRect
= final_image_rect
;
1494 private HorizontalAlignment
GetHorizontalAlignment (ContentAlignment align
)
1497 case ContentAlignment
.BottomLeft
:
1498 case ContentAlignment
.MiddleLeft
:
1499 case ContentAlignment
.TopLeft
:
1500 return HorizontalAlignment
.Left
;
1501 case ContentAlignment
.BottomCenter
:
1502 case ContentAlignment
.MiddleCenter
:
1503 case ContentAlignment
.TopCenter
:
1504 return HorizontalAlignment
.Center
;
1505 case ContentAlignment
.BottomRight
:
1506 case ContentAlignment
.MiddleRight
:
1507 case ContentAlignment
.TopRight
:
1508 return HorizontalAlignment
.Right
;
1511 return HorizontalAlignment
.Left
;
1514 internal Size
GetImageSize ()
1516 if (this.Image
== null)
1519 if (this.image_scaling
== ToolStripItemImageScaling
.None
)
1520 return this.Image
.Size
;
1522 if (this.Parent
== null)
1525 return this.Parent
.ImageScalingSize
;
1528 internal string GetToolTip ()
1530 if (this.auto_tool_tip
&& string.IsNullOrEmpty (this.tool_tip_text
))
1533 return this.tool_tip_text
;
1536 internal void FireEvent (EventArgs e
, ToolStripItemEventType met
)
1538 // If we're disabled, don't fire any of these events, except Paint
1539 if (!this.Enabled
&& met
!= ToolStripItemEventType
.Paint
)
1543 case ToolStripItemEventType
.MouseUp
:
1544 this.OnMouseUp ((MouseEventArgs
)e
);
1545 this.HandleClick (e
);
1547 case ToolStripItemEventType
.MouseDown
:
1548 this.OnMouseDown ((MouseEventArgs
)e
);
1550 case ToolStripItemEventType
.MouseEnter
:
1551 this.OnMouseEnter (e
);
1553 case ToolStripItemEventType
.MouseHover
:
1554 this.OnMouseHover (e
);
1556 case ToolStripItemEventType
.MouseLeave
:
1557 this.OnMouseLeave (e
);
1559 case ToolStripItemEventType
.MouseMove
:
1560 this.OnMouseMove ((MouseEventArgs
)e
);
1562 case ToolStripItemEventType
.Paint
:
1563 this.OnPaint ((PaintEventArgs
)e
);
1565 case ToolStripItemEventType
.Click
:
1566 this.HandleClick (e
);
1571 internal virtual void HandleClick (EventArgs e
)
1573 this.Parent
.HandleItemClick (this);
1577 internal virtual void SetPlacement (ToolStripItemPlacement placement
)
1579 this.placement
= placement
;
1582 internal bool InternalVisible
{
1583 get { return this.visible; }
1584 set { this.visible = value; }
1587 internal Point Location
{
1588 get { return this.bounds.Location; }
1590 if (this.bounds
.Location
!= value) {
1591 this.bounds
.Location
= value;
1592 this.OnLocationChanged (EventArgs
.Empty
);
1598 get { return this.bounds.Y; }
1600 if (this.bounds
.Y
!= value) {
1601 this.bounds
.Y
= value;
1602 this.OnLocationChanged (EventArgs
.Empty
);
1608 get { return this.bounds.X; }
1610 if (this.bounds
.X
!= value) {
1611 this.bounds
.X
= value;
1612 this.OnLocationChanged (EventArgs
.Empty
);
1617 internal int Right { get { return this.bounds.Right; }
}
1618 internal int Bottom { get { return this.bounds.Bottom; }
}
1621 public class ToolStripItemAccessibleObject
: AccessibleObject
1623 private ToolStripItem owner_item
;
1625 public ToolStripItemAccessibleObject (ToolStripItem ownerItem
)
1627 if (ownerItem
== null)
1628 throw new ArgumentNullException ("ownerItem");
1630 this.owner_item
= ownerItem
;
1631 base.default_action
= string.Empty
;
1632 base.keyboard_shortcut
= string.Empty
;
1633 base.name
= string.Empty
;
1634 base.value = string.Empty
;
1637 #region Public Properties
1638 public override Rectangle Bounds
{
1640 return owner_item
.Visible
? owner_item
.Bounds
: Rectangle
.Empty
;
1644 public override string DefaultAction
{
1645 get { return base.DefaultAction; }
1648 public override string Description
{
1649 get { return base.Description; }
1652 public override string Help
{
1653 get { return base.Help; }
1656 public override string KeyboardShortcut
{
1657 get { return base.KeyboardShortcut; }
1660 public override string Name
{
1662 if (base.name
== string.Empty
)
1663 return owner_item
.Text
;
1667 set { base.Name = value; }
1670 public override AccessibleObject Parent
{
1671 get { return base.Parent; }
1674 public override AccessibleRole Role
{
1675 get { return base.Role; }
1678 public override AccessibleStates State
{
1679 get { return base.State; }
1683 #region Public Methods
1684 public void AddState (AccessibleStates state
)
1689 public override void DoDefaultAction ()
1691 base.DoDefaultAction ();
1694 public override int GetHelpTopic (out string FileName
)
1696 return base.GetHelpTopic (out FileName
);
1699 public override AccessibleObject
Navigate (AccessibleNavigation navdir
)
1701 return base.Navigate (navdir
);
1704 public override string ToString ()
1706 return string.Format ("ToolStripItemAccessibleObject: Owner = {0}", owner_item
.ToString());