public sealed class PushButton : BarItem
A button on a tool bar.

Constructors

PushButton

#
Create a new tool bar button.
public PushButton(
icon,
Icon for button.
nomen,
Nomen.
callback = null
Callback method for state changes.
)

Properties

AdjacentOnLeftSide

#
public override bool AdjacentOnLeftSide { get; }

AdjacentOnRightSide

#
public override 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; }
inherited fromBarItem

Bounds

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

CloseOnActivate

#
Gets whether clicking this button should close any temporary form it is on.
public bool CloseOnActivate { get; set; }

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

Icon

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

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; }
inherited fromBarItem

MaximumWidth

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

MinimumWidth

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

Nomen

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

OffColour

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

OnColour

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

Style

#
Gets or sets the icon+text drawing style.
public IconTextStyle Style { get; set; }

Methods

CreateOutline

protected GraphicsPath CreateOutline()
inherited fromBarItem

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.
)
inherited fromBarItem

Draw

public void Draw(
context
)
inherited fromBarItem

DrawDisabled

#
protected override void DrawDisabled(
context
)

DrawFocus

#
protected override void DrawFocus(
context
)

DrawHover

#
protected override 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
)
inherited fromBarItem
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
)
inherited fromBarItem
True if an icon was drawn.

DrawIconAndText

protected bool DrawIconAndText(
context,
style,
text,
Color
background
)
inherited fromBarItem

DrawNormal

#
protected override void DrawNormal(
context
)

DrawText

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

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>()
inherited fromBarItem

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>()
inherited fromBarItem

HasNeighbourToTheLeft

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

HasNeighbourToTheRight

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

IsEnabled

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

KeyDown

public virtual Response KeyDown(
KeyEventArgs
e
)
inherited fromBarItem

KeyUp

public virtual Response KeyUp(
KeyEventArgs
e
)
inherited fromBarItem

Layout

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

MouseDoubleClick

public virtual Response MouseDoubleClick(
MouseEventArgs
e
)
inherited fromBarItem

MouseDown

#
public override Response MouseDown(
MouseEventArgs
e
)

MouseLeave

#
public override Response MouseLeave(
MouseEventArgs
e
)

MouseMove

#
public override Response MouseMove(
MouseEventArgs
e
)

MouseUp

#
public override Response MouseUp(
MouseEventArgs
e
)
BarItem.MouseUp

NeighbourToTheLeft

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

NeighbourToTheRight

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

OverrideInfo

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

OverrideText

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

SetSizeLimits

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

ShowTooltipAt

#
public override bool ShowTooltipAt(
PointF
location
)

TextInput

public virtual Response TextInput(
TextInputEventArgs
e
)
inherited fromBarItem

Trigger

#
Trigger this button.
public void Trigger()

Events

ButtonPressed

#
Event raised on button presses.
public event EventHandler ButtonPressed