The two 4D Write Pro Interface widgets continue to be enhanced with more abilities and functionalities in each release. For some of your applications, not all the widget pages are useful. For example, you use 4D Write Pro to format your emails, so you only want to display a few pages to simplify the interface and make the user’s work easier.
4D v18 R5 lets you display only the desired pages. Keep reading to learn how!
New component method
Selecting the pages to display is very simple, thanks to the new WP ShowTabPages component method. Just pass the widget name and a collection of pages to display when you call the method. This way 4D displays only the pages mentioned in the collection, in the order of the collection.
WP ShowTabPages($widgetName : Text; $tabs : Collection)
In the documentation tab of the explorer, you have the exhaustive list of the page names.
Example with the sidebar:
To display only the “Fonts”, “Frames”, and “Alignments” pages:
var $tabName : Collection
$tabName:=New collection("Fonts";"Frames";"Alignments")
WP ShowTabPages("WPwidget";$tabName)
Example with the toolbar:
To display only the “Home”, “Borders”, and “Margins” tabs:
var $tabName : Collection
$tabName:=New collection("Home";"Borders";"Margins")
WP ShowTabPages("WPtoolbar";$tabName)
Don’t forget that you can always get the source code from GitHub and adapt it to your own needs.