Constructors
Properties
Bar
Gets the toolbar this element is hosted on. This field may be null, but will be assigned by the Bar itself once this element is added to it.
Bounds
public Rectangle Bounds { get; }
Gets the visible bounds for this element. These bounds are set by the BarItem.Bar during layout.
Enabled
Gets or sets whether this element is enabled. Note that if the parent toolbar is disabled, this element is disabled by implication. Thus, use the BarItem.IsEnabled() function to determine the real state.
KeyCode
Gets or sets the shortcut key for this element. Whether or not this is actually used depends on the form hosting this toolbar.
MaximumWidth
Gets the maximum width (in logical pixels) for this element.
MinimumWidth
Gets the minimum width (in logical pixels) for this element.
OffColour
public Color? OffColour { get; set; }
Gets or sets the colour associated with the Off state, whenever meaningful.
OnColour
public Color? OnColour { get; set; }
Gets or sets the colour associated with the On state, whenever meaningful.
Methods
CreateOutline
protected GraphicsPath CreateOutline()
CreateOutline
Create a new graphics path representing the outline of this item.
Parameters:
| context (Context) |
DrawIcon
Draw the icon (if any) into the given frame. An automatical 2-pixel paddding is created inside the frame.
DrawIcon
Draw the icon (if any) into the given frame. An automatical 2-pixel paddding is created inside the frame.
Parameters:
| context (Context) | |
| frame (Rectangle) | |
| background (Color) |
Returns: True if an icon was drawn.
DrawIconAndText
Parameters:
| context (Context) | |
| style (IconTextStyle) | |
| text (string) | |
| background (Color) |
DrawText
Draw a string into the frame.
FindGroupByChapter<T>
protected T[] FindGroupByChapter<T>()
Collect all toolbar elements which share the same nomen chapter as this element. If there is only a single element (i.e. this one) then an empty array is returned.
FindGroupBySection<T>
protected T[] FindGroupBySection<T>()
Collect all toolbar elements which share the same nomen section as this element, across every bar in the same Bar.Bundle. If there is only a single element (i.e. this one) then an empty array is returned.
HasNeighbourToTheLeft
Gets whether the item directly to the left of this item has an outline shape adjacent to this item.
HasNeighbourToTheRight
Gets whether the item directly to the right of this item has an outline shape adjacent to this item.
IsEnabled
Gets whether both this element and the bar it belongs to are enabled.
KeyDown
Parameters:
| e (KeyEventArgs) |
Parameters:
| e (KeyEventArgs) |
Layout
protected virtual void Layout()
Layout the element. This method is called automatically whenever the BarItem.Bounds changes.
MouseDoubleClick
Parameters:
| e (MouseEventArgs) |
NeighbourToTheLeft
Gets whether this toolbar element has a neighbour directly to its left.
Parameters:
| skipSpacers (bool = false) |
NeighbourToTheRight
Gets whether this toolbar element has a neighbour directly to its right.
Parameters:
| skipSpacers (bool = false) |
Parameters:
| newInfo (string) | New info to assign. |
Parameters:
| newName (string) | New name to assign. |
SetSizeLimits
Set the minimum and maximum width limits.
TextInput
Parameters:
| e (TextInputEventArgs) |