You want to quickly create a menu bar to manage your 4D Write Pro areas? You want to create your own contextual menu for your end-users ? You would like to create a color mosaic to change the document background? So this feature is made for you – and better, you do not even need to write a single line of code…
We added standard actions to handle 4D Write Pro areas. They can be defined at design phase or by programming. More than 80+ actions are available and to name just some of them: Font style (bold, italic, underline), Font color, Background color, Text alignment (left, center, right, justify…), Borders (style, color, width, radius…), Spellchecker actions…
Something important to notice, when assigned to interface objects, standard actions automatically handle the activation/disabling of the object depending on the context. Easy!
Here is an example of a 4D Write Pro menu using the standard actions:
In addition to menus, a simple action toolbar can be built very easily using a standard action for each button:
Standard actions can also be used to replace the default contextual menu of 4D Write Pro area with your own contextual menu so it perfectly fits your needs:
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, you can see how to use the standard action in each different way:
List of actions
Each action from the (very rich) context menu of 4D Write Pro area is now available as standard actions. It means you can now access all these actions by programming even if a WP command doesn’t exist yet!
Here is non-exhaustive list of standard actions available for 4D Write Pro areas as there is near a hundred of actions:
- fontBold, fontItalic, fontUnderline, fontLinethrough, fontSubscript and fontSuperscript to toggle the bold, italic, underline, line-through, subscript and superscript font attributes
- 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
- borderStyle, borderColor, borderRadius, borderWidth with a parameter to define the document/paragraph/image/text border style, color, radius and width
- margin or padding with a parameter to define the document/paragraph/image/text margin or padding
- bookmark and a parameter to select a given bookmark
- 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, …
- visibleBackground, visibleFooters, visibleHeaders, visibleHiddenChars, visibleHorizontalRuler or visiblePageFrames to show/hide document background, footers, headers, hidden characters, horizontal ruler or page frame
- zoom with a given value passed as parameter to define the view zoom
- merge or split to merge/split paragraphs
- pageMode with a parameter to define the page view mode (draft, embedded, page)
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.