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.
Optional
#Gets or sets whether this textfield is optional. I.e. whether the user can toggle the Active state.
Prefix
#Gets or sets a label drawn against the left edge of the field, faded, outside the editable text. Unlike the Suffix - which belongs to the value and travels with it - a prefix holds still, which is what makes it usable as a caption ("min", "max") in place of a separate label on the panel.
Suffix
#Optional annotation drawn immediately after the text in a faded version of the text colour, typically a unit, i.e. " seconds". Include the leading space for breathing room.
This is decoration, not content: it is never typed into, selected, measured for the caret, or handed to Validator. It says what the value means, and it is not drawn at all while the Placeholder is showing.
Text
#Methods
ClearSquiggle
#public void ClearSquiggle()
Remove the squiggle previously set by SetSquiggle(MessageLevel, string, string).
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.
Parameters:
| e (KeyEventArgs) |
MakeOptional
#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.
SetSquiggle
#Underline the text with a coloured squiggle and replace the tooltip with an explanation. This flags a problem with the *content* of the field rather than with the field itself, in the manner of a spellchecker.
Parameters:
| level (MessageLevel) | Severity, which picks the colour of the squiggle. |
| caption (string) | Short description, shown as the tooltip title. |
| message (string) | Long description, shown as the tooltip body. |