Adding a New Button
- Last UpdatedJan 28, 2025
- 2 minute read
Buttons and other command tools are described in .NET Customization. Start the system with the new command object loaded and registered. Create a button using the customization tool. Link the button to the command by setting the button command property to the key for that command. The key will be listed on the command browser if the command has been loaded and registered.
The caption, tooltip and icon are set in the button properties.
Add the button to the new group by dragging and dropping the button onto the group. Set the properties of the button in that group by right-clicking on the instance of the button under the group (e.g. with or without caption, small or large ICON). Similarly, a button can be added to a menu by dragging it onto a menu tool in a group.
Once the button and the command are linked the button will appear and clicking on the button will call the execute method in the command object.
Note:
A button can make a direct call to a PML macro if required, although this has some
limitations. If the tool being added is a state button (toggle) or a combo box then
a command must be used to initialize the tool and get the current value of the tool.
Note:
A command can be passed a string argument from the UIC file. This allows a parameterized
command to be shared by several functions. This is particularly useful for a collection
of related functions that have different callbacks but all share a common context
where they are activated or deactivated by the same condition. Arguments are set in
the button Arguments property.