RibbonView is designed for users who want to modernize their existing menus into a ribbon bar without changing their application's logic or scripts.
-
When to Use
RibbonView is ideal for projects that require a fast transformation of existing menus into a modern interface, without needing to make any code changes. It is perfect for users who are content with maintaining the original menu structure while applying a fresh visual style.
-
Key Features
-
Uses the menu or window properties to control the appearance of the ribbon bar.
-
Automatically displays menu items as their corresponding ribbon items.
-
Retains the menu's original functionality and event handling without requiring any code modifications.
-
Maintains the menu structure, including the grouping of menu items, and programmatic adjustments.
-
-
Advantages
-
Quick setup with minimal effort.
-
No need to rewrite logic or events; the existing menu structure is automatically converted.
-
Perfect for applications where a basic UI modernization is sufficient without in-depth customization.
-
The menu changes to RibbonView with zero coding.
-
For future updates or maintenance, simply editing the menu will be sufficient.
-
-
Demo
We have specifically designed a demo app GitHub - Appeon/PowerBuilder-Menu2RibbonBar-Example to show you how to display the MDI menu as a ribbon bar.
The demo uses RibbonView, TabbedView, and UI theme to modernize the UI of a legacy MDI application. Note that the MDI window in this demo uses the contemporary menu style by default, in which images have been pre-set through the MenuImage property.
The demo also shows how to add personalized preference configurations in the application, allowing users to choose certain options to fine-tune the ribbon bar UI.
Please use PowerBuilder 2025 to open and run the demo and follow the instructions on the screen to play with the demo.
By choosing RibbonView, you can modernize your UI faster and with fewer headaches, making it the most practical solution for most projects.
In a large application, it is very likely that a substantial amount of code is used to dynamically set menu properties or is executed in a function, or during specific events.
The ribbon items will be automatically synchronized with the properties, functions and events of the corresponding menu items. This ensures that the original application runs smoothly without requiring any modifications to the existing code.
For example, the following code will still take effect after the menu is displayed in RibbonView.
Example 1: Code that controls whether menu items are hidden.
lm_current.m_report.visible = ab_flag lm_current.m_report.m_categorystatistic.visible = ab_flag lm_current.m_report.m_categorystatistic.toolbaritemvisible = ab_flag
Example 2: Code that enables a menu item.
lm_current.m_action.m_add.Enabled = lb_flag
To use RibbonView, you need to enable the DisplayMenuAsRibbonBar property. The DisplayMenuAsRibbonBar property is only available for MDI and MDIHelp window types.
To enable this property,
-
Navigate to the General tab in the Window control Properties page and select the "DisplayMenuAsRibbonBar (Only for MDI!/MDIHelp!)" property.
-
Or enable the DisplayMenuAsRibbonBar property in the script. For example,
w_main.displaymenuasribbonbar = true
Once DisplayMenuAsRibbonBar is enabled, the original menu style will be displayed in the ribbon bar style, and the toolbar (if any) will be displayed as the QuickAccessToolbar, both at the top of the MDI frame window.
The default layout:
Original menu:
Ribbon bar:
The ribbon bar occupies more space than the original menu, therefore, the MDI client area is smaller than before. For more information about the window size, please refer to section Window size.
Users can configure properties in the menu painter and the window painter to customize the appearance of the ribbon panels, buttons, and sheet list.
To configure properties for the ribbon panel text/image and button text/image:
Step 1: In the Menu painter, expand the menu in the treeview, and then select a sub-menu item (such as a 2nd-level, 3rd-level, or 4th-level menu item).
Step 2: Select the RibbonView tab page in the menu properties view, and then configure the following properties.
Note
The PanelText and PanelImage properties need to be configured only for the first menu item in the panel, that is, the first 2nd-level menu item and the first 2nd-level menu item after the separator line.
-
PanelText -- Specifies the text to be displayed as the panel name. The 2nd-level menu items will be divided and placed into panels according to the menu separator line. You only need to set the the PanelText property for the first menu item in the panel. If not specified, the name of the first menu item in the panel is used as the panel name by default.
-
PanelImage -- Specifies the image to be displayed when the panel is collapsed (the panel is collapsed automatically if the window is resized and there is not enough space to completely display all of the items in the panel).
-
ButtonImageSize -- Specifies whether to display the menu as a large button or a small button (default).
-
ButtonImage -- Specifies the image for the button. The default width and height of the image for the small button is 16 * 16 pixels, and for the large button is 32 * 32 pixels. If no image is specified, for the contemporary style menu, the image specified by the MenuImage property of the menu item will be used, otherwise, the system default image will be displayed.
To configure properties for the sheet list in the ribbon bar:
Step 1: In the Window painter, select the RibbonView tab page in the window properties view.
Step 2: Configure the following properties.
-
SheetListVisible -- When this property is true, and when a sheet list is available, a panel will be automatically added at the position specified by the OpenSheet function, or as the last panel in the first category; and a SheetList button with a dropdown menu that contains a list of opened sheets will be added to that panel.
-
SheetListImageSize -- Specifies whether to display the SheetList button as a large button or a small button (default).
-
SheetListImage -- Specifies the image to be displayed in the SheetList button.
-
SheetListText -- Specifies the text to be displayed in the SheetList button. The default text for the button is "SheetList".
-
SheetListPanelText -- Specifies the text to be displayed in the SheetList panel. The default text for the panel is "SheetList".
The RibbonView will use the same structure as the menu. Currently up to 4 levels of menus can be displayed.
Menus
-
The 1st-level menus will display as categories.
-
The 2nd-level menus will display as buttons, in the panel in the corresponding category.
-
The button can be a small button or a large button depending on the ButtonImageSize property of the menu item. The default value is small button.
-
The buttons will be divided and placed into different panels according to the menu separator line. If no menu separator line is used in the original menu, then only one panel will be added.
-
The panel will use the value of the PanelText property of the first menu item as the panel name and the name will display at the footer area of each panel. If not specified, the name of the first menu item in the panel is used as the panel name by default.
-
The button will display the image specified by the ButtonImage property of that menu item. If no image is specified, for the contemporary style menu, the image specified by the MenuImage property of the menu item will be used, otherwise, the system default image will be displayed.
-
-
If the 2nd-level menu has sub-menus (3rd-level menus), the 3rd-level menu will display as ribbon menu (which is a dropdown menu). The ribbon menu will display the image specified by the ButtonImage property of that submenu item.
-
If the 3rd-level menu has sub-menus (4th-level menus), the 4th-level menu will display as sub menu of the ribbon menu. The sub menu will display the image specified by the ButtonImage property of that submenu item.
-
Currently only up to 4 levels of menus will be automatically displayed in the ribbon bar.
-
When a sheet list is available and the SheetListVisible property is set to true, a panel will be displayed at the position specified by the OpenSheet function, or as the last panel in the first category; and a SheetList button with a dropdown menu that contains a list of opened sheets will be displayed in that panel.
Toolbars
-
Toolbars are displayed as the QuickAccessToolbar. For rules of displaying Toolbar as the QuickAccessToolbar, refer to QuickAccessToolbar.
Font
-
The font face and font size will stay the same as the original menu. If it is a traditional style menu (which has no font settings), the default font face and size will be used, which is Tahoma, 12.
Events and properties
-
The functions, events, and properties of the original menu will still be supported after the menu is displayed as a ribbon bar. For more information, refer to Functions, events, and properties.
Size
-
Supports maximizing and minimizing the ribbon bar, and automatically adjusts the size of the MDIClient area and the ribbon bar position. For more information, refer to section Window size.
Shortcut keys and accelerator keys:
-
If shortcut keys are set in the menu, they are automatically synchronized to the ribbon bar.
-
However, the accelerator keys will not be synchronized and supported in the ribbon bar. If the menu Text property includes an accelerator key, such as "&New", the displayed text will be "New" in the ribbon bar, the N letter will not have an underscore to indicate the accelerator key.
If you have specified the image for the menu item through the ButtonImage property in the RibbonView tab in the menu painter, that image will be displayed in the corresponding ribbon item.
If no image is specified, for the contemporary style menu, the image specified by the MenuImage property of the menu item will be used, otherwise, the system default image will be displayed.
The following is the default image provided by the system.
Note
In ribbon bar and QuickAccessToolbar, GIF format images are not supported. Using GIF images may result in icons displaying with a black background. It is recommended to use other image formats such as BMP, PNG, etc., to avoid this issue.
For the optimal display effect, the ribbon items require the image at the appropriate size: the image for the ribbon panel, small button, and ribbon menu is 16*16 pixels, for large button is 32*32 pixels.
Please make sure the original menu images are at the appropriate size, or prepare new images whenever necessary.
The most recommended approach is to set the ButtonImage property in the menu painter > RibbonView tab for each sub menu item (such as the 2nd-level, 3rd-level, and 4th-level menu items).
If you have not set the ButtonImage property in the RibbonView tab, then if the menu item has an image specified by the MenuImage property, that image will be used as the default, otherwise, a system image will be automatically displayed in RibbonView.
-
It is recommended to use LargeButton for frequently used buttons. Based on the actual display effect and ButtonSize, set the ButtonImage property in the RibbonView tab. The default width and height of the image for the small size button is 16 * 16 pixels, for the large button is 32 * 32 pixels.
-
After setting the images for important menu items, you may need to dynamically set the ButtonImage property for other less important menu items in bulk.
Such as setting the same default image for less important buttons. For example, you can iterate through the menu items that do not have images set in the MenuChange event of the MDI window and assign a default image as needed.
// Set default image for small buttons Long ll_count_level1, ll_index_level1, ll_index_level2, ll_count_level2 Menu lm_current // Loop through the menu items (Categories) ll_count_level1 = UpperBound(am_menu.Item) For ll_index_level1 = 1 To ll_count_level1 // Check if the current menu item has a submenu ll_count_level2 = UpperBound(am_menu.Item[ll_index_level1].Item[]) If ll_count_level2 > 0 Then For ll_index_level2 = 1 To ll_count_level2 // 1. No sub item 2. No Menu Image 3. No Button Image 4. Small Button lm_current = am_menu.Item[ll_index_level1].Item[ll_index_level2] If UpperBound(lm_current.Item[]) = 0 And Trim(lm_current.MenuImage) = "" & And Trim(lm_current.Buttonimage) = "" And lm_current.ButtonImageSize = 0 Then lm_current.MenuImage = as_image End If Next End If
When the DisplayMenuAsRibbonBar feature is enabled, internal system icons from the original menu do not display in the RibbonView.
Cause: The naming conventions for internal system icons in PowerBuilder 2017 were inconsistent -- some names included spaces and hyphens while others did not. In PowerBuilder 2019 R2 (build 2323), these icons were renamed to a standardized format, removing spaces and hyphens. Consequently, the original names cannot be found in the Select Image dialog any more. However, although the original names cannot be located, they remain compatible and visible when used in the application; the only exception is the RibbonView.
Solution: To ensure system icons display in the RibbonView, use either of the following methods:
-
Manually update the internal system icons used in the menu to reflect their new names. If you need a complete list of the changed names, please contact support@appeon.com.
-
To locate the new icon names, perform a fuzzy search using the icon name without spaces and hyphens in the Select Image dialog.
QuickAccessToolbar is an internal sub-control of the RibbonView and cannot be used independently as a standalone control. It can only be used in the RibbonView. When a menu contains a toolbar, the ribbon bar automatically adds a corresponding QuickAccessToolbar. You can use the ShowQuickAccessToolbar property to determine whether to show the QuickAccessToolbar.
In addition to display the shortcut icons of menu items, it also provides a dropdown list to conveniently control the visibility of each shortcut icon and offer simple customization options. For instance, you can control whether a shortcut icon displays in the QuickAccessToolbar by selecting its checkbox , or use the "Show below the Ribbon" option to display the QuickAccessToolbar at the top or bottom of the ribbon bar.
The following is a description of the general rules when displaying the menu toolbar as QuickAccessToolbar:
-
Vertical separators in toolbar are represented as vertical separators in the QuickAccessToolbar (①).
-
When there are multiple toolbars, they are combined and displayed in one single QuickAccessToolbar and separated by two vertical separators between them (②).
-
If the original toolbar contains a drop-down button, the QuickAccessToolbar will also add a corresponding drop-down button.
-
An arrow icon will appear automatically at the end of QuickAccessToolbar (③). Click it and a drop-down list will appear, showing the text content of all currently visible toolbar items (when ToolbarItemVisible is true), including separators (①②). You can customize the QuickAccessToolbar by 1) selecting which items to show in the QuickAccessToolbar (④), 2) selecting "Show below the Ribbon" (⑤) to show the QuickAccessToolbar below the ribbon bar instead of above; 3) selecting "Minimize the Ribbon" (⑥) to minimize the ribbon bar.
-
When ToolbarItemVisible is true in the menu toolbar, the corresponding icon appears in the QuickAccessToolbar, and its text content (ToolBarItemText property value) is automatically displayed and checked in the dropdown list. If ToolBarItemText is not set, an empty value is displayed in the QuickAccessToolbar. Dynamic setting of the ToolbarItemVisible property is also supported at runtime.
-
QuickAccessToolbar item statuses can be saved in the file path specified by the SetQuickAccessToolbarStatusPath. If no file path is specified, the QuickAccessToolbar item status will not be saved.
-
The ToolbarVisible property of the menu toolbar determines the visibility of QuickAccessToolbar when QuickAccessToolbar is initializing. After QuickAccessToolbar is initialized, the ShowQuickAccessToolbar property determines the visibility of QuickAccessToolbar; however, for the QuickAccessToolbar to be visible, the initial value of ToolbarVisible must also be true.
-
The Enable property of the menu toolbar determines the availability of corresponding icons in the QuickAccessToolbar.
-
The ObjectType and ToolbarItemOrder properties from the menu toolbar are also effective in QuickAccessToolbar. For which toolbar properties can be supported, refer to Which properties can be supported.
The following features are not supported in the QuickAccessToolbar:
-
The original menu toolbar can be displayed at the top, bottom, left, or right edge of the window. After displayed as the QuickAccessToolbar, the toolbar can only be displayed at the top.
-
QuickAccessToolbar does not support displaying the text of the MicroHelp of the menu item to the status area at the bottom of the frame.
-
The ToolbarItemDown property of the original menu is not supported.
The "Customize Quick Access Toolbar" dropdown menu in the QuickAccessToolbar only records manual status changes made by users at runtime.
Currently, the following Toolbar properties can be supported by QuickAccessToolbar:
-
ToolbarItemText
-
ToolbarItemName
-
ToolbarItemVisible
-
ToolbarItemOrder
-
ObjectType
-
Enabled
Usages are consistent with the Toolbar property settings. (Properties not listed are not supported)
The following pictures show the effect before and after displaying in RibbonView.
The Clear icon is originally at the last position in the drop-down list, but because its ToolbarITemOrder is set to 2, it is displayed as the second item in the drop-down list.
QuickAccessToolbar supports custom theme.
You can configure the settings under the "quickaccesstoolbar" node (as shown below) in the theme file to customize the display and style of QuickAccessToolbar. QuickAccessToolbar follows the same customization rules of the RibbonBar control. For more information, refer to Theme.
Note: Please make sure that your theme folder has been updated to the latest version. Otherwise, users who have upgraded will find that the QuickAccessToolbar position is displayed in black.
The "quickaccesstoolbar" node contains the following settings:
"quickaccesstoolbar": { "background-color": "#FFFFFF", "moreitem-image": { "file": "moreitem.png" }, "allitemvisible-image": { "file": "allitemvisible.png" }, "item": { "separator-color": "#A0A0A0", "groupseparator-image": { "file": "groupseparator.png" }, "arrow-image": { "file": "dropdown-arrow.png" }, "normal-state": { "background-color": "#FFFFFF", "border-color": "#FFFFFF" }, "hover-state": { "background-color": "#F9E4D2", "border-color": "#F9E4D2" }, "pressed-state": { "background-color": "#F9D2B0", "border-color": "#F9D2B0" }, "disabled-state": { "background-color": "#FFFFFF", "border-color": "#FFFFFF" } }, "menu": { "border-color": "#D9D9D9", "background-color": "#FFFFFF", "separator-color": "#D9D9D9", "item-custom-qat": { "normal-state": { "background-color": "#F8EADF", "text-font": { "color": "#333333" } } }, "item": { "checked-image": { "file": "menucheck.png" }, "normal-state": { "border-color": "#FFFFFF", "background-color": "#FFFFFF", "text-font": { "color": "#333333" } }, "hover-state": { "border-color": "#F9E4D2", "background-color": "#F9E4D2", "text-font": { "color": "#333333" } }, "disabled-state": { "border-color": "#FFFFFF", "background-color": "#FFFFFF", "text-font": { "color": "#999999" } } }, "scroll-spinner": { "normal-state": { "border-color": "#FFFFFF", "background-color": "#FFFFFF", "up-arrow-image": { "file": "scroll-spinner-up.png" }, "down-arrow-image": { "file": "scroll-spinner-down.png" } }, "hover-state": { "border-color": "#F9E4D2", "background-color": "#F9E4D2", "up-arrow-image": { "file": "scroll-spinner-up.png" }, "down-arrow-image": { "file": "scroll-spinner-down.png" } }, "pressed-state": { "border-color": "#F9D2B0", "background-color": "#F9D2B0", "up-arrow-image": { "file": "scroll-spinner-up.png" }, "down-arrow-image": { "file": "scroll-spinner-down.png" } } } } }
If your application is upgraded from an old version and the theme feature is enabled, after upgrading to PowerBuilder 2025 (or later), the QuickAccessToolbar position will be displayed in black because the old version configuration file in the theme folder does not contain the relevant information of QuickAccessToolbar.
Normally, when upgrading or using a new version of PowerBuilder, you need to update the Theme folder. Please make sure to use the latest theme configuration file (usually located in the PowerBuilder installation directory, the default path is C:\Program Files (x86)\Appeon\PowerBuilder [version]\IDE).
The ribbon bar and QuickAccessToolbar are bound to and contained inside the MDI frame window (this is different from the tab bar which is contained inside the MDI client area).
If the MDI/MDIHelp frame window does not adjust the size of the MDIClient area through the resize event, the system will automatically adjust the size of the MDIClient area to ensure that the ribbon bar is displayed in the appropriate position (without the user having to add or modify code).
However, if the MDI/MDIHelp frame window resizes the MDIClient area through the resize event, you need to consider the size of the ribbon bar in the resize event.
For example, you can add the following code to the resize event:
mdi_1.x = this.workspacex () mdi_1.y = this.workspacey() + this.mdirbb_1.getbestheight() mdi_1.height = this.workspaceheight() - this.mdirbb_1.getbestheight() mdi_1.width = this.workspacewidth()
Note
The mdirbb_1 object represents the ribbon bar displayed from the menu. For more information about mdirbb_1, refer to mdirbb_1 object.
Use the GetBestHeight method instead of the height property to get the height of the ribbon bar, because the height property may not accurately get the height of the ribbon bar. For example, when the QuickAccessToolbar feature is dynamically enabled and the AutosizeHeight property is turned on, the height property may not include the height of the QuickAccessToolbar.
In addition, if the current application MDI/MDIHelp frame window has customized the size of the MDIClient area (that is, if the size of the MDIClient area is not the default value), which may cause the ribbon bar area to be displayed but actually occupied by the MDIClient area, resulting in no response when the mouse clicks on that area. The solution is to adjust the size of the MDIClient area to ensure that the ribbon bar has enough space for display and operation. You can refer to the code example mentioned above and adjust the position and size of the MDIClient area as needed to meet the display and operation requirements of the ribbon bar.
Below is a comparison of how the title bar is displayed in the original menu and the ribbon bar.
When using the original menu, and when the sheet window is maximized, the title bar is as shown below.
When the menu is displayed as a ribbon bar and when the MDI/MDIHelp sheet window is maximized, the title bar will disappear. The ControlMenu, Maximize and Minimize functions of the Main type window will be integrated into the tab button area of the ribbon bar, as shown in the following figure:
FYI. If you use the RibbonBar standalone control to redesign the menu and use the same type of sheet window (Main type, with ControlMenu, Maximize, and Minimize enabled), the title bar will be as shown below.
The functions and events of the original menu will be supported in RibbonView.
-
RibbonView supports the events and properties of the original menu, as well as the corresponding scripts.
-
RibbonView supports the triggering of the Clicked and Selected events of menu items. However, if a menu item has a drop-down menu or a cascading menu, clicking on it will not trigger the Clicked event, but expand or collapse the submenu items.
-
In RibbonView, when you move the mouse over a menu item, only the Selected event will be triggered; to trigger the Clicked event, you need to click the menu item (that has no dropdown menu).
The MenuChanged event of the MDI window is triggered automatically when the ribbon bar is initialized.
Long MenuChanged (string oldmenu, string newmenu)
The oldname
parameter indicates the
name of the menu for the MDI frame and the
newname
parameter indicates the name of the
menu associated with the active sheet (the currently opened
sheet), because several sheets can be open at the same time, and
the menu associated with the active sheet will display as the menu
of the frame. Whenever the sheet switches to another one, the menu
and its corresponding ribbon bar of the frame will be initialized
again.
If you want to add scripts to customize the ribbon bar, it is highly recommended to place the scripts in the MenuChanged event. If you place the scripts in the other events such as the MDI window Open event, the scripts may not be executed when the sheet switches to another one.
The following Menu properties can be supported in RibbonView:
Properties of Traditional Style Menu |
Properties of Contemporary Style Menu |
Name |
Name |
Text |
Text |
MicroHelp |
MicroHelp |
Tag |
Tag |
Visible |
Visible |
Enabled |
Enabled |
Checked |
Checked |
Default |
Default |
Shortcut |
Shortcut |
-- |
MenuImage |
-- |
FaceName |
-- |
TextSize |
Usages are consistent with the property settings of Menu. (Properties not listed are not supported)
Note
In RibbonView, the text value of the MicroHelp property of the original menu item will display in the status area at the bottom of the frame as well as in the pop-up when the user moves a cursor over the menu item.
The traditional style menu does not have properties such as FaceName and TextSize, therefore, the default font name and text size (Tahoma 12) will be used.
If you use the Runtime Packager to package the application runtime files, you need to select the "RibbonBar Support" option to automatically package the runtime file required for DisplayMenuAsRibbonBar to work.
If you manually package the PowerBuilder runtime files, please go to the PowerBuilder Runtime location and get the following runtime file required for DisplayMenuAsRibbonBar to work: PBRibbonBar.dll (and its dependent DLLs: PBXerces.dll, xerces-c.dll, pbjson.dll).
The ribbon items (including category, panel, button, and ribbon menu) converted from menu items have the same settings and customization rules as the standard RibbonBar, RibbonCategoryItem, RibbonPanelItem, RibbonLargeButton, RibbonSmallButton, and RibbonMenuItem. For general customization rules, refer to Custom themes.
For example, to customize the ribbon bar mdirbb_1, you can create a custom theme file called "theme-mditbb_1.json", add a "w_mdi.mdirbb_1" node in the custom theme, and copy other sub-control nodes from the system theme.json file in the same directory.
The QuickAccessToolbar has its own node "quickaccesstoolbar" and properties in the theme file. For more information, refer to QuickAccessToolbar.
An example of the custom theme file:
{ "meta-info": { "version":"250" }, "w_mdi.mdirbb_1": { …//copy sub-nodes from the "ribbonbar" node in theme.json file "quickaccesstoolbar": { … } } }