BarItem

References
public abstract class BarItem
Abstract bar element implementation. Derive from this class rather than implementing IBarElement directly.

Constructors

BarItem

#
Base class constructor.
protected BarItem(
icon,
nomen
)

Fields

StandardMaximum

#
Default maximum width of bar elements such as buttons, options and toggles.
public const int StandardMaximum = 1073741823

StandardMinimum

#
Default minimum width of bar elements such as buttons, options and toggles.
public const int StandardMinimum = 24

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.
public abstract bool AdjacentOnLeftSide { get; }

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.
public abstract bool AdjacentOnRightSide { get; }

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.
public Bar Bar { get; }

Bounds

#
Gets the visible bounds for this element. These bounds are set by the Bar during layout.
public Rectangle Bounds { get; }

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.
public bool Enabled { get; set; }

Icon

#
Gets the icon, if any, associated with this element.
public IIcon Icon { get; }

KeyCode

#
Gets or sets the shortcut key for this element. Whether or not this is actually used depends on the form hosting this toolbar.
public BarShortcut KeyCode { get; set; }

MaximumWidth

#
Gets the maximum width (in logical pixels) for this element.
public int MaximumWidth { get; }

MinimumWidth

#
Gets the minimum width (in logical pixels) for this element.
public int MinimumWidth { get; }

Nomen

#
Gets the nomen describing this element.
public Nomen Nomen { get; }

OffColour

#
Gets or sets the colour associated with the Off state, whenever meaningful.
public Color? OffColour { get; set; }

OnColour

#
Gets or sets the colour associated with the On state, whenever meaningful.
public Color? OnColour { get; set; }

Methods

CreateOutline

#
protected GraphicsPath CreateOutline()

CreateOutline

#
Create a new graphics path representing the outline of this item.
protected GraphicsPath CreateOutline(
roundedOnLeft,
True if path ought to have rounded corners on the left.
roundedOnRight
True if the path ought to have rounded corners on the right.
)

Draw

#
public void Draw(
context
)

DrawDisabled

#
Draw this element when disabled.
protected abstract void DrawDisabled(
context
)

DrawFocus

#
Draw this element when enabled and focused.
protected abstract void DrawFocus(
context
)

DrawHover

#
Draw this element when enabled and hovered but not focused.
protected abstract void DrawHover(
context
)

DrawIcon

#
Draw the icon (if any) into the given frame. An automatical 2-pixel paddding is created inside the frame.
protected bool DrawIcon(
context,
icon,
Rectangle
frame,
Color
background
)
True if an icon was drawn.

DrawIcon

#
Draw the icon (if any) into the given frame. An automatical 2-pixel paddding is created inside the frame.
protected bool DrawIcon(
context,
Rectangle
frame,
Color
background
)
True if an icon was drawn.

DrawIconAndText

#
protected bool DrawIconAndText(
context,
style,
text,
Color
background
)

DrawNormal

#
Draw this element when enabled and not hovered and not focused.
protected abstract void DrawNormal(
context
)

DrawText

#
Draw a string into the frame.
protected bool DrawText(
context,
Rectangle
frame,
text,
Color
background
)

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.
protected T[] FindGroupByChapter<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.
protected T[] FindGroupBySection<T>()

HasNeighbourToTheLeft

#
Gets whether the item directly to the left of this item has an outline shape adjacent to this item.
protected bool HasNeighbourToTheLeft()

HasNeighbourToTheRight

#
Gets whether the item directly to the right of this item has an outline shape adjacent to this item.
protected bool HasNeighbourToTheRight()

IsEnabled

#
Gets whether both this element and the bar it belongs to are enabled.
public bool IsEnabled()

KeyDown

#
public virtual Response KeyDown(
KeyEventArgs
e
)

KeyUp

#
public virtual Response KeyUp(
KeyEventArgs
e
)

Layout

#
Layout the element. This method is called automatically whenever the Bounds changes.
protected virtual void Layout()

MouseDoubleClick

#
public virtual Response MouseDoubleClick(
MouseEventArgs
e
)

MouseDown

#
public virtual Response MouseDown(
MouseEventArgs
e
)

MouseLeave

#
public virtual Response MouseLeave(
MouseEventArgs
e
)

MouseMove

#
public virtual Response MouseMove(
MouseEventArgs
e
)

MouseUp

#
public virtual Response MouseUp(
MouseEventArgs
e
)

NeighbourToTheLeft

#
Gets whether this toolbar element has a neighbour directly to its left.
protected BarItem NeighbourToTheLeft(
skipSpacers = false
)

NeighbourToTheRight

#
Gets whether this toolbar element has a neighbour directly to its right.
protected BarItem NeighbourToTheRight(
skipSpacers = false
)

OverrideInfo

#
Override the info of the Nomen field.
public void OverrideInfo(
newInfo
New info to assign.
)

OverrideText

#
Override the name of the Nomen field.
public void OverrideText(
newName
New name to assign.
)

SetSizeLimits

#
Set the minimum and maximum width limits.
public void SetSizeLimits(
minimum,
maximum
)

ShowTooltipAt

#
public abstract bool ShowTooltipAt(
PointF
location
)

TextInput

#
public virtual Response TextInput(
TextInputEventArgs
e
)