FloatingButtonCollection
ReferencesUtility class for storing and maintaining collections of floating buttons. You don't technically need this class but it's a lot easier than doing all the maintenance/bookkeeping yourself.
Properties
Names
#Enumerate over all button names. This method ignores those buttons which are in states FloatingState.Closing or FloatingState.Closed.
Indexers
Methods
Add
#public void Add(FloatingPosition position, string name, string info = null, Color? colour = null, IIcon icon = null, FloatingButtonHandler click = null, FloatingButtonHandler mouseDown = null, FloatingButtonHandler mouseUp = null)
Add a fixed button to this collection.
Parameters:
| position (FloatingPosition) | Position, may not be FloatingPosition.Anchored. |
| name (string) | Name of button. |
| info (string = null) | Info text for button. |
| colour (Color? = null) | Fill colour of button. |
| icon (IIcon = null) | Icon of button. |
| click (FloatingButtonHandler = null) | Event handler for clicks. |
| mouseDown (FloatingButtonHandler = null) | Mouse down handler. |
| mouseUp (FloatingButtonHandler = null) | Mouse up handler. |
AddAnchored
#public void AddAnchored(PointF anchor, string name, string info = null, Color? colour = null, IIcon icon = null, FloatingButtonHandler click = null, FloatingButtonHandler mouseDown = null, FloatingButtonHandler mouseUp = null)
Add an anchored button to this collection.
Parameters:
| anchor (PointF) | Location of button. |
| name (string) | Name of button. |
| info (string = null) | Info text for button. |
| colour (Color? = null) | Fill colour of button. |
| icon (IIcon = null) | Icon of button. |
| click (FloatingButtonHandler = null) | Event handler for clicks. |
| mouseDown (FloatingButtonHandler = null) | Mouse down handler. |
| mouseUp (FloatingButtonHandler = null) | Mouse up handler. |
Close
#Close some specific buttons. This will also remove the button from this collection.
Parameters:
| names (params string[]) | Names of buttons. |
FindByName
#Try and retrieve a specific button by name.
Parameters:
| name (string) | Name of button to retrieve. |
Returns: Button or null.
FindByPoint
#Try and retrieve a button underneath a specific point.
Parameters:
| point (PointF) | Point in control coordinates (NOT! content coordinates). |
Returns: Button underneath point.
IsDefined
#Gets whether a specific name has been defined.
Parameters:
| name (string) | Name to test for. |
Returns: True if name if defined.
ModifyAnchor
#Assign a new anchor to a button.
ModifyColour
#Assign a new colour to a button.
Parameters:
| name (string) | Name of button. |
| colour (Color) | New colour. |
ModifyIcon
#Assign a new icon to a button.
ModifyInfo
#Change the Info field on a button.
StateCount
#Count the number of buttons in a specific state.
Parameters:
| state (FloatingState) | State. |
Returns: Number of buttons currently in that state.