Add User-Defined Options to IDE Menus

To integrate custom functionality into the Uniface IDE, you can use the IDE Menu Plug-In API to create components that define the desired menu options and implement the actions performed by these options. You must then add the components to the Uniface IDE resources and configure the IDE to use them.

  1. Create at least one component that implements the following operations to specify the menu options to be added.
    • getVersion—return the version number of the API that you have programmed for.
    • getGlobalMenuOptions—return the menu options for the Main Menu ( ≡ )).
    • getEditorMenuOptions—return the menu options for the Actions menu in object editors. These options can be dynamic, based on the type and/or name of the current object.

    The IDE calls these operations at run time, so it is possible to populate menus dynamically, based on data or other circumstances that can be looked up just before the menu is displayed.

  2. Create the callback components that implement the menu actions. For each operation called by a menu option, include the appropriate menu option parameters. For more information, see Menu Callback Operations.
  3. Optionally, package your custom components into a Uniface archive file.
  4. In the Uniface IDE assignment file, specify the location of the components in the [RESOURCES] section. You can specify a UAR, or the resources directory where the compiled components are located. For example:
    [RESOURCES]
    ; D:\unifaceData\project\resources ; dir where IDE puts compiled components
    D:\uniface10\project\USERMENUS.UAR 
    usys:ide.uar
    usys:ide_messages.uar
    
    
  5. In the Uniface IDE assignment file, specify the name of the components that return the menu options using the IDE_DEFINE_USERMENUS logical.

    To specify a separator between the menu options provided by different components, use the _sep_ keyword. For example:

    [LOGICALS]
    IDE_DEFINE_USERMENUS = USERMENU1, _sep_, USERMENU2, USERMENU3

    There will always be a separator between the IDE options and the first user option.

Related Topics