To complete the UI modernization solution, PowerBuilder 2025 introduces the DisplayMenuAsRibbonBar property. With the DisplayMenuAsRibbonBar property, users can instantly convert their existing menus into a RibbonBar style, enhancing the UI without needing to rewrite menu logic. This feature provides two main approaches for customization:
-
RibbonView for quick and straightforward UI improvements with basic customization.
-
RibbonBar Converter for advanced users who need full control over the RibbonBar design and functionality.
This dual approach allows users to modernize their application’s navigation in a way that best fits their needs, from basic visual enhancements to deep customization of the RibbonBar's behavior and style.
RibbonView is designed for users who want a quick and easy way to modernize their existing menus into a RibbonBar without extensive changes to their application's logic. It offers essential customization options that allow you to update the look and feel of your application's navigation with minimal effort.
-
When to Use
RibbonView is ideal for projects that require a fast transformation of existing menus into a modern interface, without the need for deep customization. It is perfect for users who are content with maintaining the original menu structure while applying a fresh visual style.
-
Key Features
-
Uses properties such as PanelText, PanelImage, ButtonImageSize, and ButtonImage to control the appearance of the RibbonBar.
-
Automatically maps menu items to their corresponding RibbonBar 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.
-
By choosing RibbonView, you can modernize your UI faster and with fewer headaches, making it the most practical solution for most projects.
The RibbonBar Converter exports the menu structure to an XML file, allowing users to perform advanced customizations far beyond what RibbonView offers.
With this approach, you have full control over the design and behavior of the RibbonBar, making it ideal for complex projects with specific UI/UX requirements.
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.
No matter which approach you take to display the menu as a RibbonBar, every RibbonBar item (button, category, PowerTip, etc.) are automatically bound and 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 converted and displayed as a RibbonBar.
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 items are enabled.
lm_current.m_action.m_add.Enabled = lb_flag
Here are some general guidelines for how to reduce the cost of renovating old applications and make modifications more quickly:
-
It is recommended to use the RibbonView feature. Set the relevant properties directly in the Menu to achieve the desired UI effect without the need to modify any code that depends on the properties of the MenuItem.
If additional code is needed to optimize the UI effect, try to avoid directly manipulating the properties of specific elements of the RibbonBar to reduce code dependencies.
(Using an XML export solution may increase maintenance costs when adding new MenuItem in the future. Therefore, it is suggested to prioritize adjusting the RibbonBar directly in the Menu.)
-
Focus on adding custom logic in the MenuChanged event of the MDI window. Whenever possible, use a generic script for various menus to make UI micro-adjustments.
-
If you were originally using a traditional style menu, it is suggested to consider converting to the contemporary style first.
-
Consider adding personalized preference configurations in the application, allowing users to choose certain options to fine-tune the RibbonBar UI effects. This can reduce the risks associated with upgrades. If users dislike the solution, they can revert back easily.
-
Compatibility with existing UI controls in the old application needs to be considered. For example, using third-party UI frameworks or using the Win API for custom drawing.
We have specifically designed a demo app GitHub - Appeon/PowerBuilder-Menu2RibbonBar-Example to show you how to convert and display the MDI menu as a RibbonBar.
The demo uses the TabbedView, UI theme, and the RibbonView approach to modernize the UI of a legacy MDI application. Note that the MDI window in this demo uses Contemporary Menu Style by default, in which the MenuImage has been pre-set.
The demo also shows how to add personalized preference configurations in the application, allowing users to choose certain options to fine-tune the RibbonBar UI effects.
Please use PowerBuilder 2025 to open and run the demo and follow the instructions on the screen to play with the demo.