Design and create a RibbonBar – PB Docs 2022

Design and create a RibbonBar

As the first step, you shall design the RibbonBar, that is,
deciding what items to contain in the RibbonBar, what modern-looking
image to use for each item, and how to group the items, etc.

Once you know clearly how you want the RibbonBar to look like,
you can start to create it. We recommend you use the RibbonBar Builder
tool to create the RibbonBar XML/JSON file. Alternatively, you can
choose to directly create a RibbonBar via PowerScript.

For PowerScript functions that can be used to create a
RibbonBar, refer to PowerBuilder Help > RibbonBar control. In the
demo application, for better illustration purpose, you will see both
the XML file and PowerScript code are provided for creating the
RibbonBar. When the application initiates the RibbonBar, it uses an
argument in the wf_init_ribbonbar function to decide which way (XML or
PowerScript) to use for creating the RibbonBar (see Initiate the
RibbonBar
).

Creating the XML for the RibbonBar in this
demo (Recommended):

A dedicated tool, RibbonBar Builder, is available in
PowerBuilder to assist you to create the RibbonBar XML (or JSON). In
the tool, you can use a template (RibbonBar.xml) to create your own
XML, and preview the RibbonBar UI while you work. This is the
recommended approach.

In the demo application:

  1. Open Tools > RibbonBar Builder in PowerBuilder IDE, and
    open and edit the file created for the RibbonBar:
    SalesApplicationDemo_RibbonBar.xml.

Creating the PowerScript for the RibbonBar
in this demo:

In the demo application:

  1. Open the function w_mdi.wf_init_ribbonbar, and you will see
    the PowerScript for the RibbonBar in the function. The script is
    different from XML, but shall still be easy to understand.

    For example, the following script inserts File as a
    RibbonBar category, adds an orderview panel in this category, and
    then adds buttons inside the panel.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x