You want to quickly create a toolbar for your Styled text areas. You want to change the font of the text or compute/freeze 4D Expressions without writing a line of code. It is possible using the new standard actions for Styled Text areas.
Just associate a standard action to each button object and 4D will handle everything automatically: action triggering but also the button activation or deactivation if the action is not available in the current context.
Here is an example of a color toolbar where each button has a standard action associated.
To discover all the possibilities and power of the standard actions, and get more details about their usage, we recommend you take a look at this blog post about standard actions.
In the following database, we show you the different possibilities to use standard actions:
List of actions
There are several standard actions available for the Styled text areas:
- fontBold, fontItalic, fontUnderline, fontLinethrough to toggle the bold/italic/underline/line-through font attributes
- fontStyle to display the standard font style sub menu
- fontSize or color with a parameter to set a given font size or font color
- font/showDialog, color/showDialog or backgroundColor/showDialog to display the system font, font color picker or font background color dialog
- visibleReferences, computeExpressions or freezeExpressions to display, update or freeze all dynamic expressions in the area
- all spellchecking related actions. Among others: spell/autoCorrectionEnabled, spell/autoLanguageEnabled, spell/showDialog, …
New commands
The INVOKE ACTION command has been added. It executes a standard action in a defined context.
To know if a standard action is applicable and valid in the current context, you can use the new Get action info command.
Documentation
For more details, please read this article in 4D doc center.
More standard actions are also available for 4D Write Pro areas. There is a lot of different actions available (over 80) for more details you can read this blog post.