Modernice sus aplicaciones PowerBuilder

Ribbon Style Menu para PowerBuilder

El Ribbon Style Menu es un remplazo del menú de PowerBuilder. El mismo permite crear interfaces usuario de tipo ribbon (banda o cinta).
Con algunos retoques en su menú PB usted puede:

  • Agrupar funcionalidades importantes en pestañas.
  • Exponer un número mayor de funcionalidades a los usuarios.
  • Mover funciones comunes a la barra de herramientas principal.
  • Organizar los elementos del menú con íconos o utilizar un menú desplegable.
  • Añadir funcionalidades usadas con frequencia a una barra de herramientas de acceso rápido.
  • Permitir a los usuarios minimizar el tamaño del menú de banda para maximizar el tamaño de la pantalla.

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

Implementación

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.

Configuración de la aplicación:

  • Añada advguicontrols.pbl y advguiobjects.pbl a su lista de librerías.
  • Haga una copia de seguridad de su menú principal.
  • Su ventana principal debe heredar de w_ribbonwindow.
  • Cambie el tamaño de su ventana principal utilizando WorkSpaceY(),WorkSpaceX(), WorkSpaceHeight() y 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.

Configuración del menú:

Todos los elementos importantes del menú se desplegarán como pestañas en la banda. Si usted no desea que una de dichas funcionalidades se vea, asegúrese de marcarla como invisible.

  • Asegúrese que todas las opciones del menú tengan imágenes (toolbar image). Para los elementos de gran tamaño usted necesitará imágenes de buena calidad 32x32.
  • Agrupe los elementos de su menú. Asegúrese de que la propiedad menú Tag contenga "group:MyGroupName;".
    • Copie el valor de este tag en todos los elementos del menú si usted desea que aparezcan en un grupo determinado.
    • Los grupos están ordenados en el mismo orden en el que se encuentran cuando se escanea el menú
    • Puede que sea necesario mover los elementos de un menú a otro. Por ejemplo, para desplegar el cortar, copiar y pegar en la pestaña, usted necesita moverlos del menú editar al menú Archivo.
  • Si usted desea desplegar uno de los elementos de su menú en el menú de la barra de herramientas de acceso rápido, añada quickaccess:TRUE; en el tag del menú
    • Ejemplo: group:MyGroupName;quickaccess:true;
  • Si usted desea que un elemento de su menú se despliegue en gran formato, añada size:Large; al tag de su menú
    • Ejemplo: group:MyGroupName;size:Large;
  • Si usted no desea deplegar el texto, añada displaytext:false; al tag del menú
    • Ejemplo: group:MyGroupName;displaytext:false;
    • Ejemplo: group:MyGroupName;size:Large;displaytext:false;
  • Los elementos del menú se ordenan en el mismo orden en el que se encuentran cuando se escanea el menú.
  • Los elementos del menú que cuentan con sub-elementos son desplegados como un grupo de elementos en la banda. Una flecha se desplegará al lado del texto.
    • Nota: no se necesita añadir valores a los tags de los sub elementos.
  • Si desea desplegar una imagen en la pestaña superior, añada una imagen al menú superior.
  • Si usted desea desplegar mayor información en su globo de texto del menú, añada una descripción en el propiedad MicroHelp del menú.
  • Usted puede desplegar la barra de herramientas de acceso rápido abajo de su menú en banda al escoger DisplayQuickAccesUnderRibbon property en su ventana.

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.