Skip to main content
Version: Next

LISTBOX SELECT BREAK

LISTBOX SELECT BREAK ( {* ;} object ; row ; column {; action} )

ParameterTypeDescription
*Operator🡒If specified, object is an object name (string)
If omitted, object is a variable
objectForm object🡒Object name (if * is specified) or
Variable (if * is omitted)
rowLongint🡒Number of break row
columnLongint🡒Number of break column
actionLongint🡒Selection action

Description

The LISTBOX SELECT BREAK command can be used to select break rows in the list box object designated by the object and * parameters. The list box must be displayed in hierarchical mode.

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a variable. In this case, you pass a variable reference instead of a string.

Break rows are added to represent the hierarchy but they do not correspond to existing rows in the array. To designate a break row to be selected, in the row and column parameters, you must pass the row and column number corresponding to the first occurrence in the corresponding array. These values are returned by the LISTBOX GET CELL POSITION command when the user has selected a break row. This principle is described in the “Management of break rows” paragraph of the Hierarchical list boxes section.

The action parameter, if it is passed, can set the selection action to be carried out when a selection of break rows already exists in the list box. You can pass a value or one of the following constants, found in the "List Box" theme:

ConstantTypeValueComment
lk add to selectionLongint1The row selected is added to the existing selection. If the row specified already belongs to the existing selection, the command does nothing.
lk remove from selectionLongint2The row selected is removed from the existing selection. If the row specified does not belong to the existing selection, the command does nothing.
lk replace selectionLongint0The row selected becomes the new selection and replaces the existing selection. The command has the same effect as a user click on a row (however, the On Clicked event is not generated). This is the default action (if the action parameter is omitted).

Note: If you have checked the Hide selection highlight option for a list box:

  • you have to make list box selections visible using available interface options. For more information about how to do this, see Customizing the appearance of selections.
  • you cannot highlight break rows for hierarchical list boxes in this case (see Limitation with hierarchical list boxes).

Example

Given the following arrays shown in a list box:

We want to select the "Normandy" break row:

 $row:=Find in array(T2;"Normandy")
 $column:=2
 LISTBOX COLLAPSE(*;"MyListbox") //collapsing of all levels
 LISTBOX SELECT BREAK(*;"MyListbox";$row;$column)

Here is the result:

See also

LISTBOX GET CELL POSITION
LISTBOX SELECT ROW