Modernize your PowerBuilder Applications

Ribbon Style Menu

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:

  • Group relevant functions into tabs.
  • Expose more functionality to your users.
  • Move common functions to the Program Tab menu.
  • Organize your menu items with large and small icons or use a drop down menu.
  • Add frequently used functions to a quick access toolbar.
  • Allow users to collapse ribbon to maximize screen size.


PowerMenu Pro

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 :

  • Place quick access icons in the caption bar.
  • Blend the caption bar into the ribbon tab.
  • Provide built in Backstage menu.
  • Provide 41 themes.
Flyout Backstage PowerMenu

Implementation

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:

  • Add advguicontrols.pbl and advguiobjects.pbl to your library list.
  • Backup your main menu.
  • Your main window\frame should inherit from w_ribbonwindow.
  • Resize your main windows content using WorkSpaceY(),WorkSpaceX(), WorkSpaceHeight() and WorkSpaceWidth().

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.

  • Make sure all your menu items have images (toolbar image). For large items, you want good quality 32x32 images.
  • Add your menu items to groups. Make sure the menu Tag property contains "group:MyGroupName;".
    • Copy this tag value to all the menu items you want to appear in that group.
    • Groups are ordered in the same order that they are found when scanning the menu
    • It may be necessary to move items from one top level menu to another. For example, to display Cut, Copy and Paste in the File tab, you will have to move them from the Edit menu to the File menu.
  • If you want the menu item to display in the Quick Access toolbar, add this to your menu's tag: quickaccess:TRUE;
    • E.g. group:MyGroupName;quickaccess:true;
  • If you want the menu item to display as a large item, add this to your menu's tag: size:Large;
    • E.g. group:MyGroupName;size:Large;
  • If you don't want to display text, add this to your menu's tag: displaytext:false;
    • E.g. group:MyGroupName;displaytext:false;
    • E.g. group:MyGroupName;size:Large;displaytext:false;
  • Menu items are ordered in the same order that they are found when scanning the menu.
  • Menu items with sub items are displayed as a group item in the ribbon. An arrow will display next to the text.
    • Note, there is no need to add value to the tags of sub items.
  • If you want to display an image in the top level tab, add an image to your top level menu.
  • If you want more information to display in the tooltip for the menu, add text to the menu items MicroHelp property.
  • You can display the quick access toolbar under your ribbon by checking the DisplayQuickAccesUnderRibbon property on your window.

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.

PowerMenu Pro | Ultimate Suite for PowerBuilder