LEFTBOX

Summary


Leftbox is used to display a single left list containing the records from a table and the selection of several elements

Syntax

Leftboxcl_table  box  Field_list
Sizeddimension  [ Titled  box_title ] [ Atposition ] Asabrev

Parameters

Element

Description

Restrictions

cl_table

Abbreviation of an open table

the table must already be open

box

Identifier for the selection box in the form :
- selection box name

field_list

List of fields separated by the character ','.
The definition of a field expressed in the form :
Field [ Titled field_title]

field

Identifier of a field under the following form :
- variable name
- alphanumeric expression

the field must exist

field_title

Alphanumeric expression for the field title

dimension

Size of the selection box on the screen in the form :
'('
nb_lin  ','  nb_col ')'

This position must not exceed the limits of the screens.

nb_lin

Integer expression giving a number of lines
expressed as 1/8 of a line.

nb_col

Integer expression gives a number of columns
expressed as 1/4 of a column.

box_title

Alphanumeric expression of the box title

position

Position of the selection box on the screen in the form :
'('
exp_lin ',' exp_col ')' '

This position must not be outside the screen.

exp_lin

Numeric expression for the line number on the screen from which the selection box will be displayed.
expressed in 1/8 of line

exp_col

Numeric expression for the column number on the screen from which the selection box will be displayed.
expressed in 1/4 of column

abrev

Abbreviation assigned to this selection box

Examples

# Treebox applied to the starting mask (example 1)

# opening of the table (with the key : yitmref,yuom,yvatrat )
If !clalev([F:ZMT]) : Local File ZMOTTBX [ZMT] :     Endif

# display of the basic screen
Local Mask ZMOTSA17 [ZM17]
Local Dlgbox Mask [ZM17]
& Button "PICK1","FIN"
& With "1","F"
& Coded 1901,1902
& Titled "Test Treebox"
& As [ZM17]
Boxact [ZM17]

# principal entry
$ENTRY
Boxinp [ZM17] Using RESU
Case RESU
When 7,44, 1902 : Goto END
When 1901 : Gosub DISPLAYBOX : Disable 1901
When GSTAPIC : Gosub SAIPIC
When Default
Endcase
Goto ENTRY

# display of the hierarchy elements
$DISPLAYBOX
Treebox [ZMT] SEL
& [F:ZMT]YITMREF Titled "",
& [F:ZMT]YUOM Titled "",
& [F:ZMT]YVATRAT Titled ""
& Sized(160,240)
& Titled "Selection window"
& At(40,40)
& As [PIC]
Boxact [PIC]
Fillbox [PIC]
Return

# entry of the hierarchy selection box
$SAIPIC
Pick [PIC]
Case status
When 37 : Gosub SELECTION : Goto SAIPIC
When 41 : Gosub DESELECTION : Goto SAIPIC
When Default
Endcase
Return

# an element has been selected => insertion of the grid
$SELECTION
Read [ZMT] YIX0 = [F]YITMREF;[F]YUOM;[F]YVATRAT
....
Return

# an element has been de-selected => deletion from the grid
$DESELECTION
Read [ZMT] YIX0 = [F]YITMREF;[F]YUOM;[F]YVATRAT
....
Return

$END
Boxclr [PIC]
Close Mask [ZM17]
Close File [ZMT]

# Autonomous Treebox is not applied to a mask (example 2)

# opening of the table (with the key : yitmref,yuom,yvatrat )
If !clalev([F:ZMT]) : Local File ZMOTTBX [ZMT] :     Endif

# display of the hierarchy elements
Treebox [ZMT] SEL
& [F:ZMT]YITMREF Titled "",
& [F:ZMT]YUOM Titled "",
& [F:ZMT]YVATRAT Titled ""
& Sized(160,240)
& Titled "Selection window"
& At(40,40)
& As [PIC]
Boxact [PIC]
Fillbox [PIC]

# entry in the hieracrhy selection box
$SAIPIC
Boxinp [PIC] Using RESU
Case RESU
When GSTAPIC
  Repeat
  Pick [PIC]
  Case status
    When 7, 44 : Break
    When 37 : Gosub SELECTION
    When 41 : Gosub DESELECTION
  Endcase
  Until 1=0
When GSTAPKF : Goto END
When GSTAESC, GSTAFIN : Goto END
Endcase
Goto SAIPIC

# Treebox where the elements are expressions (example 3)

Treebox [ZMT] SEL
& "reference :"-[F:ZMT]YITMREF Titled "",
& "unit :"-[F:ZMT]YUOM Titled "",
& "rate :"-[F:ZMT]YVATRAT Titled ""
& Sized(160,240)
& Titled "Selection window"
& At(40,40)
& As [PIC]

Description and comments

Leftbox is used to display a left list made up of the records from a table, displayed in a simple form to allow the selection of one or more records. The exit from this box along with the selections is carried out using the "Apply" button. The selection box can be applied to a mask (example 1) or even be autonomous (example 2). The selection box can be displayed with pre-selected records by having used the instruction Setlbox; in this case, these records are actually considered as already selected.

The table in which the selection operates must have been opened by the File or Local File instruction. The Leftbox can also be applied to an abbreviation defined during a link between several tables.

The second parameter is used to identify the selection box.

Defined in the third parameter are the fields that will be displayed in the selection box in order to identify each record. The Leftbox is applied to the first key for the identification of the hierarchy levels and the display order of the records. For this, it is imperative to define the same number of fields to be displayed as there are fields in the primary key. It is possible to declare the fields other than those of the primary key. For each field, it is necessary to express the title of the field, which can be an empty string. This title is not used for a hierarchy selection box. It is possible to concatenate a string of characters in the field (example 3).

The clause Sized is used to give a dimension to the selection box.

The clause As is used to associate an abbreviation with this selection box that will then be used by the display, the loading and the taking into account of selections or de-selections by the instructions Boxact, Fillbox, Pick.

The following clauses are optional :

The clause Titled is used to give a title to the selection box.

The clause At is used to specify an absolute position for the box on the screen : This is the upper left corner of this OBJect. By default, the box will be displayed at the top left of the screen.

Remarks

The number of OBJects-screens that can be opened simultaneously is up to 25. The OBJect-screen are the open boxes by Mesbox, Inpbox, Dlgbox, Listbox, Treebox, Pickbox (this is included when it is a left list). It is also necessary to take into account in this number, the "work window" open at the launch of an application.

The selection box is re-closed following exiting either by the "Apply" button, or by click on the cross. The Close instruction does not exist for a Leftbox .

The declaration of an OBJect-screen with an abbreviation already used by another OBJect-screen, close this latter.

Associated errors

Error

Description

ERCLAS (7)

The file is not open.

Associated keywords

Pickbox  -  Listbox Pick  -  Boxact  -  Fillbox  -  Currbox  -  Setlbox  -   Dislbox


SUMMARY


Copyright © Sage 1999 - 2007