Make a ribbon in your application
ExeOutput for PHP lets you create ribbons for your PHP application.
To create a ribbon, add a Ribbon to the "Components Used" list and then click Edit Ribbon.
The UI editor is shown and displays a ready-to-use ribbon that you can modify.
Add a new toolbar in the ribbon¶
We create another toolbar by cloning an existing one.
- Select the original toolbar named "scPanel2":
- Click Copy
- Select the entire page (named scToolPagerPage1 here) and then click Paste to create the new toolbar
The new toolbar is created. Just remove the controls you don't want, change buttons (see below)...
- You can change the toolbar's description by selecting the description panel and modifying the Caption property
Add a new page to the ribbon¶
- Select the entire ribbon (select scToolPager1 here) in the editor
- Scroll down and double-click the "Tabs" property to show the Collection Editor. Click Add and a new page will be added.
- Modify its Caption and close the window
- Select the new page then add a toolbar as explained above by copying and pasting an existing one.
For the Caption
property, you can use Resource Strings for easier localization. To insert a resource string, use %RESID%
and replace RESID
with the name of the resource string.
Modify a button or the entire ribbon at runtime¶
It's possible to change any property of any button (or even the ribbon itself) at runtime.
Refer to the dedicated topic "How To Modify Controls At Runtime".
How to change the name of a ribbon page at runtime?¶
Use the following HEScript code:
SetUIProp("ribbon1scToolPager1", "Tabs.items[0].Caption", "My new caption");
[0]
means we will change the caption of the first page. [1]
means we will change the caption of the second page. And so on.