Ribbon Style Menu is an alternative to the PowerBuilder menu. It gives users a ribbon style UI.
With a few tweaks to your PB menu you can:
PowerMenu Pro takes the ribbon style menu one step further, and gives you a custom windows caption bar. The significant enhancements include a more advanced tooltip, better scrolling for the items to fit in the control, a new Office 365 style, and an enhanced flyout program tab menu (as you would see in MS Word).
PowerMenu Pro is the only ribbon for PB applications that will do the following :
A new DLL is required to allow for ALT shortcut keys in PowerMenu. Deploy the following with your application:
- PBUSExternal.dll
NOTE: For PowerMenu Pro, inherit your window from w_ribbonwindow_advanced. PowerMenu Pro gives you a custom windows caption with quick access icons in the caption.
Application setup:
Change Inheritance of your Existing Frame:
If you have a frame ancestor:
Right click on w_ribbonwindow in your PBL and select Edit Source from the context menu. You will find two instances of the following:
global type w_ribbonwindow from window
Modify both by changing the reference to "window" with the name of your PFC or ancestor window that your current main frame window is inherited from. Next, open your main frame window and find the two identical references from the above step. E.g.:
global type w_myframe from pfc_frame
Change the reference to the PFC or ancestor window to be w_ribbonwindow (or w_ribbonwindow_advanced if you want the custom Windows caption bar). End result should look like this:
global type w_myframe from w_ribbonwindow
Next, open your copy of w_ribbonwindow. Go to each event that has code in the ancestor and make sure to extend the event. Open your main frame window and do the same. This last part if very important. You may also notice that your frame window doesn't have some of the w_ribbonwindow controls on them. Make a small change to your frame window then save and close. Re-open your frame window; you should see the w_ribbonwindow controls.
Do a full build.
Configure Menu:
All top level menu items will display as tabs in the ribbon. If you don't want one to, make it invisible.
Adding the Program Tab:
of_DisplayProgramTab("properties.ico") of_RibbonMenu().of_AddCommandButton("New", "new.png", "m_new") of_RibbonMenu().of_AddCommandButton("Open", "menuopen.bmp", "m_open") of_RibbonMenu().of_AddSeperator() of_RibbonMenu().of_AddCommandButton("Save", "menusave.bmp", "m_save") of_RibbonMenu().of_AddCommandButton("Save as", "saveas!", "m_saveas") of_RibbonMenu().of_AddSeperator() of_RibbonMenu().of_AddCommandButton("Print", "menuprint.bmp", "m_print") of_RibbonMenu().of_AddCommandButton("Send in email", "menuemail.bmp", "m_email") of_RibbonMenu().of_AddSeperator() of_RibbonMenu().of_AddCommandButton("Exit", "exit.png", "m_exit")
See the detailed USPB DOCUMENTATION for implementing more such controls like advanced fly-out menu as seen in Word.
Changing Ribbon for Sheet or Child Windows:
If you open sheet windows with their own menu's, you'll have to refresh the ribbon to reflect that:
In the activate event of your sheet (or sheet ancestor) add the following code (w_frame is a reference to your main window that contains the ribbon control):
w_frame.of_RebuildRibbon(THIS.MenuID)
In the close event of your sheet, add the following code to rebuild the ribbon back to what's used in the frame window:
w_frame.of_RebuildRibbon(w_frame.MenuID)
PowerMenu Pro Options:
Set the window icon using the of_SetWindowIcon function.