SplitList

(System Library)

Description: Draws a split list (listbox with two columns) with a scrollbar if required and indicates the selected item.
Returns: Nothing
Usage: Steady State only.
Function Groups: Graphics
Related to: Bevel | CheckBox | ColorSelect | DropList | DropTree | Edit | GridList | HScrollbar | Listbox | RadioButtons | SpinBox | TextBox | ToolBar | VScrollbar
Format:  System.SplitList(X1, Y1, X2, Y2, Title1, Title2, Data1, Data2, Index, Picked[, Flat, DoubleClick, MaxLen, Offset, FocusID, AlignTitle, Multi, PickList, SplitPos, ShrinkData1CBContext, ShrinkData1Callback, BGColor, FGColor])
Parameters:  
X1
Required. Any numeric expression giving the X coordinate on the screen of one side of the listbox.
Y1
Required. Any numeric expression giving the Y coordinate on the screen of either the top or bottom of the listbox.
X2
Required. Any numeric expression giving the X coordinate on the screen of the side of the listbox opposite to X1.
Y2
Required. Any numeric expression giving the Y coordinate on the screen of the top or bottom of the listbox, whichever is the opposite to Y1.
Title1
Required. Any text expression giving the title to display above the first column of the split list.
Title2
Required. Any text expression giving the title to display above the second column of the split list.
Data1
Required. An array of data to display in the first column of the split list. This array must be the same size as Data2.
Data2
Required. An array of data to display in the second column of the split list. This array must be the same size as Data1.
Index
Required. Any variable whose value will be set to the index of the highlight.
Picked
Required. A variable whose value will be set true (1) when an item is chosen in the split list. The setting of Index by an external source will not trigger Picked.
Flat
Any logical expression. If true (non-0) the border of the split list will be a single black line, if false (0) it have the look of two indented windows. Defaults to 0.
DoubleClick
An optional parameter that is a variable whose value will be set to true (1) when an item has been double-clicked upon.
MaxLen
An optional parameter that is any numeric expression giving the maximum length of the data lists. If omitted, the maximum list length is given by the size of the arrays Data1 and Data2.
Offset
An optional parameter that is any numeric expression giving the starting offset in the list. The element indicated by this index will be the one initially shown at the top of the list (unless too few elements follow this one to fill the display area).
FocusID
An optional parameter that is any numeric expression from 0 to 32767 for the focus number of this graphic. If this value is 0, the split list will not accept keyboard input, although mouse input will still be recognized. The default value is 1.
AlignTitle
An optional parameter that is any logical expression. If true (non-0) the title is drawn within the split list's boundaries, if false(0) the list fills its bounding area and the title is added at the top (i.e. it extends past the top boundary). The default is true.
Multi
An optional parameter that is any logical expression. If true (non-0), multiple items may be selected in the list. The default is false.
PickList
An optional parameter that is a variable whose value is set to the list of items selected if Multi is true (1). If invalid, no items are selected. This variable may initially be set to a dynamically allocated array (one created with the New function) containing items to be highlighted/selected upon the startup of the split list.
SplitPos
An optional parameter that is a variable that will contain the pixel position of the split bar. If initially valid, the split bar will be in the middle of the SplitList. The default will center the split bar.
ShrinkData1CBContext
Context for callback to shorten Data1 text
ShrinkData1Callback
Callback(Text, AvailWidth, Font)
BGColor
Optional. Any numeric expression for the background color of the control. No default value.
FGColor
Optional. Any numeric expression for the foreground color of the control. No default value.
Comments:

This module is a member of the System Library, and must therefore be prefaced by \System. as shown in the "Format" section.

If your application predates version 11.2, use the backslash notation rather than dot: \System\

If Multi is true, multiple items in the list may be selected by using the <Shift> or <Ctrl> keys along with mouse input. If <Ctrl> is held while an item is clicked on by the mouse, it will become selected (or deselected if it is already selected) and will be added to the list of chosen items. If <Shift> is held while an item is clicked on by the mouse, all items from the last selected item to the currently selected item will be selected. All other items outside of this list will be deselected. If both <Ctrl> and <Shift> are held while an item is clicked on by the mouse, all items from the last selected item to the currently selected item will be set to the state of the last selected item.
For any optional parameter that is to be set, all optional parameters preceding the desired one must be present, although they may be invalid.

Examples:

System.SplitList(20, 325, 340, 50 { Outline of splitlist },
                 NameLabel { Column 1 title },
                 TypeLabel { Column 2 title },
                 NameTable { Column 1 data },
                 TypeTable { Column 2 data },
                 Index { Highlighted element },
                 0 { Picked not required },
                 0 { 3D look },
                 DClick { Set for double click },
                 Invalid { Use default max length },
                 0 { Start at top of list },
                 3 { Focus ID },
                 0 { Title extends past top });