Grid Management Library : Look-Up Manager (LUM) Feature
Description
The Grid Management Library (GML) can be configured to associate a list type control, such as a list button or list edit, with a particular event that occurs on a specific column within a main grid cell. This feature provides the capability to temporarily show, at the location of a main grid cell, a list type control to be used to look-up and select information from a list of choices presented within the control. The GML administers the tasks associated with moving, sizing, showing, and hiding the look-up control. The portion of the GML that manages these tasks is referred to as the GML Look-Up Manager (LUM)
A template named GML_LUM$ is used to store the look-up parameters. The GML LUM is capable of managing more than one look-up, therefore an array subscript [n] is used to designate the assignment of look-up values. Variables within this template that require initialization by the application are as follows: ([n] indicates look-up number)
|
Variable |
Description |
|---|---|
|
GML_LUM.LU_ID%[n] |
ID of the look-up control. |
|
GML_LUM.SET%[n] |
Set number of the associated grid. |
|
GML_LUM.COL%[n] |
Column number within the main grid that will be used to activate (display) the look-up control. |
|
GML_LUM.LOC%[n] |
Location where the look-up control is to be displayed, relative to column number assigned to the |
|
GML_LUM.SCOPE%[n] |
Width of the look-up control. Each time a look-up control is displayed, it is moved and resized to overlay on the column identified by the sum of variables |
|
GML_LUM.X_ADJ%[n] GML_LUM.Y_ADJ%[n] GML_LUM.W_ADJ%[n] |
The |
Additional Information
The effect of the value in variable GML_LUM.SCOPE%[n] on the look-up control width is based on values that are assigned to variable GML_LUM.LOC%[n].
EV = Event Column
LU = Look-Up control column
X = Scope (width) of control
|
GML_LUM.COL%[n]=3 |
|
GML_LUM.LOC%[n]=0 |
|
Grid Columns |
|
GML_LUM.SCOPE%[n] |
EV LU |
||||
|
0 |
X |
||||
|
1 |
X |
X |
|||
|
2 |
X |
X |
|||
|
3 |
X |
X |
X |
||
|
4 (width of grid control) |
X |
X |
X |
X |
X |
|
GML_LUM.COL%[n]=3 |
|
GML_LUM.LOC%[n]=-1 |
|
Grid Columns |
|
GML_LUM.SCOPE%[n] |
LU |
EV |
|||
|
0 |
X |
||||
|
1 |
X |
X |
|||
|
2 |
X |
X |
X |
||
|
4 (width of grid control) |
X |
X |
X |
X |
X |
|
GML_LUM.COL%[n]=3 |
|
GML_LUM.LOC%[n]=1 |
|
Grid Columns |
|
GML_LUM.SCOPE%[n] |
EV |
LU |
|||
|
0 |
X |
||||
|
1 |
X |
X |
|||
|
2 |
X |
X |
X |
||
|
4 (width of grid control) |
X |
X |
X |
X |
X |
GML Look-Up Manager (LUM) : Start-Up
The GML LUM feature is configured during application start-up as follows:
Step 1
At start-up, assign to GML_INIT$ variable GML_INIT.LUM_QTY% the quantity of look-up controls to be used by the application.
|
Step 2
Following the call to program GML_I, initialize the LUM template by executing the following procedure:
|
Step 3
Assign values to the GML_LUM$ template variables as appropriate:
|
The look-up control ID value of 122 in GML_LUM.LU_ID%[1] refers to a list button or list edit type control that exists at the time of GML_LUM$ template initialization. This control must exist in the same context as the grid control(s) in the grid set value assigned to variable GML_LUM.SET%[1]. In addition, the control should be visible, but placed beyond the width of the window. As an example, if the window width is 550 pixels, the x value of the look-up control should be greater than 550.
Step 4
Start the Look-Up Manager:
|
GML Look-Up Manager (LUM) : Displaying (Showing) The Look-Up Control
When grid event 14 (left click), 15 (left click current cell), or 18 (right click) occurs on the main grid (member 1) of a grid set, GML_TPL$ template variable GML_TPL.INFO$ contains information relating to the location of the click. This information can be passed on to the Look-Up Manager for displaying the look-up control in the row where the event was generated. The actual location of the control is determined by the values of the variables contained in the GML_LUM$ template that were initialized at the application start-up.
In the following example, GML.NOTIFY% 18 is being used as the event that activates (shows) the look-up control. If there is a control associated with the information contained in the GML_TPL$ template, that control is displayed. However, if no look-up control is associated with the GML_TPL$ information, the call to LUM_DISPLAY will have no effect.
|