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

# GENGURES.PUB

GENGURES.PUB is a public program that loads all GUI screens from BRC files. This routine also builds standard tool bars and status bars on all screens as well.

`0060 ENTER FILE[ALL],OSGUI$,MSG$`

Variable | Description
FILE[ALL] | Standard file array
OSGUI$ | GUI template
MSG$ | Displays an error message if an error occurs

Exit Points | Explanation
EXIT | GENGURES.PUB usually does not return any errors.
EXIT ERR | GENGURES.PUB will return an error if one occurs.

This chart breaks down the OSGUI$ template:

Field | Description
SCRNID$:C(80*) | Name of .BRC file from which screens will be loaded
CHAN:N(5*) | Channels on which the graphical device “X0” is open
GUI_ID:N(5*) | Reserved for future development
LINE:N(5*) | Used by GENGULIN.PUB; returns the line of a grid that was clicked on
SCALE:N(5*) | Contains current scale factor (current window width/ 640)
CONTEXT_POINTER:N(5*) | Current context array
INQUIRY:N(1*) | Used by GENGUWIN.PUB; set to 1 so GENGUINP.PUB and GENGULIN.PUB know when an F2 window is active
RES_SCREEN:C(80*) | Not used
RES_HANDLE:N(3*) | Not used
CUR_CONTEXT[X]:N(5*) | Current context of the screen being loaded
BASE_CONTEXT[X]:N(5*) | Context of the last screen that has a status bar
TOOL_CONTEXT[X]:N(5*) | Context of the last screen that has a tool bar
TOOL_TYPE[X]:N(1*) | Set to 1 for ‘Save’ to appear in first text button on GUI screen, any other value will force ‘OK’ to appear. Currently this is not used.
WIND_ID[X]:N(1*) | Window ID from within the BRC file to load
HEADINGS[50]:C(50*) | Column heading text for a GUI HLE Grid
ALIGN[50]:N(1*) | Column heading alignment for a GUI HLE Grid
HEADER_ID[20]:N(6) | GUI control ID of a grid header line
GRIDS:N(1) | Total number of grids on the current GUI screen
GRIDPTR:N(1*) | Pointer that refers to the current active grid

GENGURES.PUB can open one form up at a time, or it can open several at once.

To load a single form, set OSGUI.SCRNID$ to the name of the BRC you are working with, set OSGUI.WIND_ID[X] to the number of the window ID you want to load from the BRC file, and set OSGUI.CONTEXT_POINTER to whatever element of the array in OSGUI.WIND_ID[X] you are using.

To load multiple forms, set all of the window IDs into the OSGUI.WIND_ID[X] array. All forms must exist in the BRC file specified. Then, set OSGUI.CONTEXT_POINTER to the first array element you used to store the window IDs multiplied by -1. The negative value causes GENGURES.PUB to cycle through all window IDs you stored, loading each form. You can also set the first window ID negative in OSGUIWIND_ID[X] to force GENGURES.PUB to display a speedo in that form’s status bar, stating that other forms are loading, and to please wait.

If you have forms that either don’t need a tool bar or don’t have a status bar, you can set OSGUI.TOOL_CONTEXT[X] to -1 to stop a tool bar from being displayed, and OSGUI.BASE_CONTEXT[X] to -1 to stop a status bar from being displayed. However, after a form loads, you must set OSGUI.BASE_CONTEXT[X] to point to a context where there is a status bar.