A checkbox or radio toggle on a tool bar. Other toggles which share the same Nomen.Section will automatically untoggle when a toggle is pressed.
Constructors
RadioToggle
#Create a new tool bar option button.
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.
OffText
#Gets or sets the text to display in the OFF state, assuming no icon is present. By default, the Nomen.Name of the Nomen is copied into this field.
OnColour
public Color? OnColour { get; set; }
Gets or sets the colour associated with the On state, whenever meaningful.
OnText
#Gets or sets the text to display in the ON state, assuming no icon is present. By default, the Nomen.Name of the Nomen is copied into this field.
Optional
#An optional option can be toggled off when it's toggled on, leaving all options in the same group unchecked.
RadioGroup
#Gets the complete group of radio buttons this option belongs to. An option is part of a radio group if any other Options on any toolbar in the same Bar.Bundle share the same Nomen.Section string.
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.
SetState
#Method for setting the state of this option externally. If this option acts as a radio-button then it cannot be unset.
Parameters:
| state (bool) |
TextInput
Parameters:
| e (TextInputEventArgs) |
Toggle
#public void Toggle()
Toggle this state and cause associated options to toggle off appropriately.