You are here: Development Standards > Routines > General Routines > GENGULIB.PUB

# GENGULIB.PUB

GENGULIB.PUB is a public program that performs several functions, mainly for setting up menus, windows, and other information for the Graphical and Startstyle menus. This program has seven entry points, which all use the same exit point.

MAKE_WINDOW_MENU

This entry point OPENs the sysgui device “X0” and returns the channel on which it was OPENed in both the variable WIND and within OSGUI.CHAN. It also records the channel number into STBL(“MGW”).

`1000 MAKE_WINDOW_MENU:`
`1010 ENTER WIND,OSGUI$`

Variable | Description
WIND | Channel on which the graphical device “X0” is open
OSGUI$ | GUI template (see GENGURES.PUB for more detail)

Exit Points | Explanation
EXIT | GENGULIB.PUB does not normally return an error.
EXIT ERR | GENGULIB.PUB returns an error if one occurs.

NEW_WIND_MENU

This entry point displays the Start-style menu and paints the image to be used with it. This procedure is CALLed only from RMMENU1.

`1500 NEW_WIND_MENU:`
`1510 ENTER FILE[ALL],WIND,OSGUI$`

Variable | Description
FILE[ALL] | Standard file array
WIND | Channel on which the graphical device “X0” is open
OSGUI$ | GUI template (see GENGURES.PUB for more detail)

MAKE_GUI_FILEBAR_MENU

This entry point builds the standard menu bar that is used on all GUI menu types.

`1900 MAKE_GUI_FILEBAR_MENU:`
`1910 ENTER WIND,OTHER$,USER$,RADIO_BUTTON$,OSCODECH,OSURCH`

Variable | Description
WIND | Channel on which the graphical device “X0” is open
OTHER$ | Template that contains the xxMN file structure. If OTHER$ is left blank, the template will be retrieved from OSTPL.
USER$ | Template that contains the xxMN file structure for the User menu.
RADIO_BUTTONS | If the value is non-zero, the Live or Sample radio button will be checked (on the Start-style menu only)
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.

MAKE_BBJ_GUI_FILEBAR_MENU

This entry point builds the standard menu bar that is used on the BBj MDI menu.

`2200 MAKE_GUI_FILEBAR_MENU:`
`2210 WIND,OTHER$,USER$,RADIO_BUTTONS,OSCODECH,OSURCH,menuBar!,mdi!,livesampMenu!,OTHERCTR,`
`2210:USERCTR,GLOBAL_ID,scale100!,scale125!,scale150!,scale175!,scale200!,scaleCustom!`

Variable | Description
WIND | Channel on which the graphical device “X0” is open
OTHER$ | Template that contains the xxMN file structure. If OTHER$ is left blank, the template will be retrieved from OSTPL.
USER$ | Template that contains the xxMN file structure for the User menu.
RADIO_BUTTONS | If the value is non-zero, the Live or Sample radio button will be checked (on the Start-style menu only)
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.
menubar! | Current menubar object.
mdi! | Current MDI object.
livesampleMenu! | Object for the live/sample menubar item.
OTHERCTR | Number of items on the Other Commands menu.
USERCTR | Number of items on the User menu.
GLOBAL_ID | Control ID of the Global Inquiry menu.
scale100! | Object for the 100% scaling menu option.
scale125! | Object for the 125% scaling menu option.
scale150! | Object for the 150% scaling menu option.
scale175! | Object for the 175% scaling menu option.
scale200! | Object for the 200% scaling menu option.
scaleCustom! | Object for the custom scaling menu option.

MAKE_OTHER_MENU

This entry point builds the Other Commands menu and returns its structure to the CALLing program.

`2510 MAKE_OTHER_MENU:`
`2520 ENTER MENU$,OTHER$,OVERRIDE_ID,OSCODECH,OSURCH`

Variable | Description
MENU$ | Menu structure of the Other Commands menu
OTHER$ | Template that contains the xxMN file structure. If OTHER$ is left blank, the template will be retrieved from OSTPL.
OVERRIDE_ID | Not used
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.

POP_COMP_ID_MENU

This entry point populates a combo box on the GUI menus with available company IDs and their names.

`2700 POP_COMP_ID_MENU:`
`2710 ENTER WIND,OSCOMP,ID`

Variable | Description
WIND | Channel on which the graphical device “X0” is open
OSCOMP | Channel on which the file OSCOMP is open
ID | Control ID to be populated (must be a List Button control)

MAKE_OTHER_BBJ_MENU

This entry point builds the Other Commands menu on a BBJ GUI menubar.

`2910 MAKE_OTHER_BBJ_MENU:`
`2920 ENTER MENU$,OTHER$,OVERRIDE_ID,OSCODECH,OSURCH,menubar!,OTHERCTR,GLOBAL_ID`

Variable | Description
MENU$ | Menu structure of the Other Commands menu
OTHER$ | Template that contains the xxMN file structure. If OTHER$ is left blank, the template will be retrieved from OSTPL.
OVERRIDE_ID | Not used
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.
menubar! | Menubar object passed in to build BBj GUI menu on
OTHERCTR | Keeps a count of how many entries are added to the other commands menu
GLOBAL_ID | Not used

MAKE_USER_MENU

This entry point builds the User menu and returns its structure to the CALLing program.

`3310 MAKE_USER_MENU:`
`3320 ENTER MENU$,USER$,OVERRIDE_ID,OSCODECH,OSURCH`

Variable | Description
MENU$ | Menu structure of the Other Commands menu
USER$ | Template that contains the xxMN User menu file structure. If USER$ is left blank, the template will be retrieved from OSTPL.
OVERRIDE_ID | Not used
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.

MAKE_USER_BBJ_MENU

This entry point builds the User menu and returns its structure to the CALLing program. This is done for BBj only.

`3510 MAKE_USER_MENU:`
`3515 ENTER MENU$,USER$,OVERRIDE_ID,OSCODECH,OSURCH,menuBar!,USERCTR,GLOBAL_ID`

Variable | Description
MENU$ | Menu structure of the Other Commands menu
USER$ | Template that contains the xxMN User menu file structure. If USER$ is left blank, the template will be retrieved from OSTPL.
OVERRIDE_ID | Not used
OSCODECH | Channel OSCODE file is opened on.
OSURCH | Channel OSUR file is opened on.
menubar! | Menubar object passed in to build BBj GUI user menu on
USERCTR | Keeps a count of how many entries are added to the user menu
GLOBAL_ID | Not used

GET_CURRENT_SCALE

This entry point retrieves information about the Windows display, including screen width, height, and the scaling factor used when displaying OSAS screens. This factor is determined by dividing the display’s width and height by 640 and 480 respectively. This entry point is no longer used in standard OSAS programs.

`4000 GET_CURRENT_SCALE:`
`4010 ENTER SINFO$`

Variable | Description
SINFO | Template that returns information about the current display

This chart breaks down the SINFO$ template:

Field | Description
GUICHAN:B | Channel on which the graphical device “X0” is open
SWIDTH:B | Current screen width
SHEIGHT:B | Current screen height
XSCALE:B | Current X scale, taking SINFO.SWIDTH/640
YSCALE:B | Current Y scale, taking SINFO.SHEIGHT/480
UNIT:C(1) | Current scaling units; ‘P’ixels, ‘S’emichars, or ‘C’hars
FCSIZE:B | Font size in unscaled units
FSSIZE:B | Font size in scaled units
FSTYLE:B | Style of current font
FAMILY:C(1*) | Current font family

GET_CURRENT_FONT

This entry point retrieves information about the current font used by the current window. The size of the font will always be 10.

`5000 GET_CURRENT_FONT:`
`5010 ENTER SINFO$`

Variable | Description
SINFO | Template that returns information about the current display

This chart breaks down the SINFO$ template:

Field | Description
GUICHAN:B | Channel on which the graphical device “X0” is open
SWIDTH:B | Current screen width
SHEIGHT:B | Current screen height
XSCALE:B | Current X scale, taking SINFO.SWIDTH/640
YSCALE:B | Current Y scale, taking SINFO.SHEIGHT/480
UNIT:C(1) | Current scaling units; ‘P’ixels, ‘S’emichars, or ‘C’hars
FCSIZE:B | Font size in unscaled units
FSSIZE:B | Font size in scaled units
FSTYLE:B | Style of current font, as represented by one or more of these values: $01$ = bold $02$ = italic 10$ = underline $0200$ = strikeout
FAMILY:C(1*) | Current font family