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 RibbonBar item.
If no image is specified, for the contemporary style menu, the MenuImage property (if specified) 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 RibbonBar and its QuickAccessToolbar sub-controls, 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 RibbonBar items require the image at the appropriate size: the image for RibbonTabButtonItem, RibbonPanelItem, RibbonSmallButtonItem, and RibbonComboBoxItem is 16*16 pixels, for RibbonLargeButtonItem is 32*32 pixels, for RibbonMenuItem in RibbonMenu is 16*16 pixels, and for RibbonMenuItem in RibbonApplicationMenu 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 RibbonView tab for each 2nd-level menu item.
If you have not set the ButtonImage property in the RibbonView tab in the menu painter, a default system image will be automatically applied when converting to RibbonBar. If your MenuItem already has a MenuImage set, that image will be used as the default.
-
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 RibbonBar control.
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 converted RibbonBar.
Solution: To ensure system icons display in the converted RibbonBar, 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.