Commands

abstract class Commands(var icons: NamedImages?)

GUI applications can get messy, the classes in this package help reduce the messiness when defining Buttons, ToggleButtons, PropertyRadioButtons, Menus, MenuItems, SubMenus, ToggleMenuItem. It also simplifies keyboard shortcuts.

Create a subclass of Commands, and define the text, graphic, keyboard shortcut (KeyCombination), for each Button, ToggleButton, PropertyRadioButton, Menu, MenuItem, SubMenu, ToggleMenuItem within your application.

Then create an instance of Actions using these definitions, adding the code to be executed when the Action is performed.

See the DemoAction application for an example of how to use Commands, Actions etc.

Here's the latest version of the demos

Inheritors

Constructors

Link copied to clipboard
constructor(icons: NamedImages?)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun define(name: String, text: String, keyCombination: KeyCombination? = null, tooltip: String? = null): Command

Adds a single Command to the map (commands).

fun define(name: String, text: String, keyCombination: KeyCombination? = null, tooltip: String? = null, block: Command.() -> Unit): Command