BarItem
ReferencesAbstract bar element implementation. Derive from this class rather than implementing IBarElement directly.
Constructors
Fields
Properties
AdjacentOnLeftSide
#Gets whether this element is treated as an adjacent one on the left side. This state is used when the layout code of the neighbouring element needs to decide whether to put small or large radii on its own shapes.
AdjacentOnRightSide
#Gets whether this element is treated as an adjacent one on the right side. This state is used when the layout code of the neighbouring element needs to decide whether to put small or large radii on its own shapes.
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 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 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.
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.
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.
DrawNormal
#Draw this element when enabled and not hovered and not focused.
Parameters:
| context (Context) |
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.
Layout
#protected virtual void Layout()
Layout the element. This method is called automatically whenever the Bounds changes.
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) |
SetSizeLimits
#Set the minimum and maximum width limits.