AppBuilder Menu and Toolbar Additions FAQs
Beta Draft
Author: (Author's Name)
Date Last Updated: (Date)
Scheduled Release: (Release Number)


Revision History The following revisions have been made to this document:

Date: (date)
Revision: (rev-no)
Developer: (developer)
Summary of Changes: (summary)


 

Copyright (C) 2000 by Progress Software Corporation ("PSC"), 14 Oak Park, Bedford, MA 01730, and other contributors as listed below. All Rights Reserved.

The Initial Developer of the Original Code is PSC. The Original Code is Progress IDE code released to open source December 1, 2000.

The contents of this file are subject to the Possenet Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. A copy of the License is available as of the date of this notice at:

http://www.possenet.org/license.html

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. You should refer to the License for the specific language governing rights and limitations under the License.


Contributors
Jane Contributor, Joe Contributor


Contents

1 AppBuilder Menu Modifications/A>
1.1 How do you add a new menu item to the AppBuilder?
2 AppBuilder Toolbar Modifications
2.1 How do you add a new button to the AppBuilder toolbar?
3 Related Documentation


1. AppBuilder Menu Modifications

This section contains information about modifying AppBuilder menus.

1.1 How do you add a new menu item to the AppBuilder?

Steps

To add a menu item to the AppBuilder main window menu:

  1. Define the menu item in the appropriate sub-menu in adeuib/uibmdefs.i. Be sure to choose a mnemonic character that does not conflict with an existing menu item.
  2. If applicable, add code to the sensitize_main_window internal procedure of adeuib/uibmproe.i to set the menu item's SENSITIVE attribute to TRUE or FALSE as appropriate.
  3. Add an ON CHOOSE trigger for the menu item in adeuib/uibmtrig.i to run the internal procedure to be executed when that menu item is chosen.
  4. Create an internal procedure to execute the functionality when the menu item is chosen.  Place this internal procedure in adeuib/uibmproa.i or adeuib/uibmproe.i depending on the name of the internal procedure (uibmproa.i contains procedures that begin with a – d and uibmproe.i contains internal procedures that begin with e – z).

Example

The following example illustrates the required code modifications for adding a new tool (called Foo) to the AppBuilder main window Tools sub-menu:

2 AppBuilder Toolbar Modifications

This section contains information about modifying the AppBuilder toolbar.

2.1 How do you add a new button to the AppBuilder toolbar?

Steps

To add a button to the AppBuilder main window toolbar:

  1. Add a new bitmap to the adeicon directory for the button’s up-image. The bitmap should be 25 pixels by 25 pixels.
  2. Add the new item to the following &SCOPED-DEFINE directives in adeuib/uibmdefs.i:
  3. bar_labels (Names of the buttons)

    bar_tips (Tooltips for the buttons)

    bar_images (Images for the buttons without the .bmp extension)

    bar_actions (Internal procedures that execute when the buttons are chosen)

    Each of the above directives contains a list of button characteristics in order of appearance on the toolbar. If, for example, you add a new button as the 5th item in the toolbar, you must add the item characteristic (name, tooltip, image, or action) as the 5th item in each directive.

  4. Add 1 to the &GLOBAL-DEFINE directive, bar_count in adeuib/uibmdefs.i.
  5. Adjust the size of the rectangles of the toolbar to accommodate the additional button in adeuib/uibmdefs.i.
  6. If applicable, add code to the sensitize_main_window internal procedure of adeuib/uibmproe.i to set the menu item's SENSITIVE attribute to TRUE or FALSE as appropriate. Be sure to search through adeuib code for references to h_button_bar and adjust any references to its extent, as necessary.
  7. Create an internal procedure to execute the functionality when the toolbar button is chosen. Place this internal procedure in adeuib/uibmproa.i or adeuib/uibmproe.i depending on the name of the internal procedure (uibmproa.i contains procedures that begin with a – d and uibmproe.i contains internal procedures that begin with e – z).

Example

The following example illustrates the required code modifications for adding a new tool (called Foo) to the AppBuilder main window toolbar (after the Color button and before the Development Mode button):

  1. Add foo.bmp to the adeicon directory.
  2. Add 1 to the bar_count &GLOBAL-DEFINE directive in adeuib/uibmdefs.i:
  3. &GLOBAL-DEFINE bar_count 11

  4. Add the foo to the bar_labels &SCOPED-DEFINE directive in adeuib/uibmdefs.i:
  5. &SCOPED-DEFINE bar_labels New,Open,Save,Print,Procedure,Run,Edit,List,~

    Property,Colors,Foo

  6. Add foo to the bar_tips directive:
  7. &SCOPED-DEFINE bar_tips New,Open,Save,Print,Procedure settings,Run,Edit code,List objects,Object properties,Colors,Foo

  8. Add foo to the bar_images directive:
  9. &SCOPED-DEFINE bar_images new,open,save,print,proc,run,editcode,list,props,color,foo

  10. Add choose_foo_tool to the bar_actions directive:
  11. &SCOPED-DEFINE bar_actions choose_file_new,choose_file_open,choose_file_save,choose_file_print,choose_proc_settings,choose_run,choose_codedit,choose_uib_browser,choose_prop_sheet,adeuib/_selcolr.p,choose_foo_tool

  12. Adjust the size of the rectangles in adeuib/uibmdefs.i to accommodate the new button in the same rectangle as the Color button:
  13. a)       Change the SIZE-PIXELS of rectangle group3 from 265 BY 30 to 290 BY 30

    b)       Change the SIZE-PIXELS of rectangle group4 from 295 BY 30 to 320 BY 30

  14. Change appropriate references to h_button_bar[10] to h_button_bar[11] in mode-morph in adeuib/uibmproe.i. (This assumes that bar_count was changed from 10 to 11 in step #2 above).
  15. X = h_button_bar[11]:X + h_button_bar[11]:WIDTH-P + 6

    ASSIGN rh = h_button_bar[11]:FRAME

    rh:WIDTH-P = rh:WIDTH-P - h_button_bar[11]:WIDTH-P.

  16. Add choose_foo_tool internal procedure to adeuib/uibmproa.i:
  17. PROCEDURE choose_foo_tool :

    RUN adeuib/_footool.w.

    END PROCEDURE.

3 Related Documentation

The following documents provide additional information about this subject matter: