Index Parent

List class


The List class is used to manipulate lists.

A list object is not a Listview: It is the object a Listview renders.

A List object can only be added to a Listview object at Listview creation time.

See Listview

 

Attributes
Name Type Class Note
Active M ISGN G2N A number or one of:
  • Bottom
  • Down
  • Off
  • PageDown
  • PageUp
  • Top
  • Up
ActiveEntry S GN As Active, but as the value of the active entry
ActiveEntry0 S GN The value of the columun number 0 of the active entry
ActiveEntry1 S GN  
ActiveEntry2 S GN  
ActiveEntry3 S GN  
ActiveEntry4 S GN  
ActiveEntry5 S GN  
ActiveEntry6 S GN  
ActiveEntry7 S GN  
ActiveEntry8 S GN  
ActiveEntry9 S GN  
AdjustHeight B I  
AdjustWidth B I  
AutoVisible B ISG  
Case B I Sets case comparation mode (0 is the default)
DefaultInsertPos M IS A number or one of:
  • Active
  • Default (Default)
  • Bottom
  • Sorted
  • Top
Entries supplied at Init time or via AddStem or ClearAddStem are inserted at this position. If this attribute is not supplied or its value is Default, entries are inserted:
  • Sorted - if DragSortable is 1
  • At the bottom - otherwise
See Insertion and Sorting
DragSortable B ISG  
DropMark N G  
Entries S I  
First N ISGN  
Format S ISG  
Image S I See Images in lists
InsertPosition N GN  
List S I A name of an ARexx stem where to read entries
MinLineHeight N I  
Names S I A string of entries separated by a ,
NumSelected N G The number of the selected entries
NumSort B ISGN Sets numeric comparation mode (0 is the default)
Quiet B SG  
Separator C I The char to be used as columns separator in a multi column list. Default: |
ShowDropMarks B ISG  
SortFormat S ISG Here you may specify a sort Format String to control some sorting options. The string may contain one entry for each column of the list. Entries are seperated by commas: each entry is parsed via dos.library/ReadArgs(). The template for a single entry is
C=COL/K/N,NUM/S,CASE/S
where:
  • COL - This value adjusts the number of the current column. Defaults to current entry number (0,1,...)
  • NUM - An integral number comparation is to be applied to this column
  • CASE - A string case comparation is to be applied to this column
Note that:
  1. Default value is an empty string
  2. If one column is omitted, it's value is cleared
  3. Numeric comparation is also controlled by NumSort attribute
  4. Case comparation is also controlled by Case attribute
  5. Entries for columns that doesn't exist are ignored
Example:
Let's suppose you created a List with 3 col, First, Second and Third, where First is to be nocase-sorted, Second is to be case-sorted and Third is to be num-sorted, just set (init) SortFormat to "CASE,,NUM"
SortType M G2N ISGN Specify the sort type and order. When set, it is a string to parse with the template OFF/S,COL/K/N,REV/S, where
  • OFF - if present, all other fields are ignore, no sort
  • COL - a column number: entries are sorted by the contents of this column
  • REV - indicates reverse order
Note that:
  • The default is off
  • If OFF, entries are inserted at the bottom, even if Sorted is specified (see Insert method)
See Insertion and Sorting
Title S I  
Visible N N  

 

Methods
Name Parameters Note
AddStem <stemName/V>,[pos] Add the entries defined in stem to the list. mode is one of:
  • Active
  • Default
  • Bottom
  • Sorted
  • Top
See Insertion and Sorting
Clear   Clear the list.
ClearAddStem <stemName/V>,[pos] As AddStem, but clear the list before adding the entries<./td> mode is one of:
  • Active
  • Default
  • Bottom
  • Sorted
  • Top
See Insertion and Sorting
Exchange <entry1>,<entry2> Exchange 2 entries.

entry1 is a number or one of:

  • Active
  • Bottom
  • Top

entry2 is a number or one of:

  • Active
  • Bottom
  • Next
  • Previous
  • Top
GetEntries <stemName> The method writes in stem.num the number of the entries and in stem.0,... stem.i (i=stem.num-1) the entries:
    call DoMethod("list","GetEntries","entries")
    do i=0 to entries.num-1
        say entries.i
    end
GetEntry <pos>,<var> Get an entry.

pos is a number or Active

GetSelected stem The method writes in stem.num the number of the selected entries and in stem.0,... stem.i (i=stem.num-1) the entries:
    do i=0 to sel.num-1
        say sel.i
    end
GetSortType <var/V> Get the human form of SortType value. If you read SortType, you get an integral number, the format of which is not even compatible with ARexx integral numbers. This methods writes in var the SortType string. See Insertion and Sorting
Insert <entry>, [pos] Insert an entry in a list.

pos is a number or one of:

  • Active
  • Bottom (Default)
  • Sorted
  • Top
Jump [pos] Jump to an entry, making it visible.

pos is a number or one of

  • Active (Default)
  • Bottom
  • Down
  • Top
Remove [pos] Remove an entry.

pos is a number or one of

  • Active (Default)
  • First
  • Last
  • Selected
ReplaceCol <pos>,<col>,<value> Replace the contents of the col column of the pos entry with value.

pos is a number of Active.

Select [pos],[type],[var/S] Select entries.

pos is a number or one of:

  • Active (Default)
  • All

type is a number or one of:

  • Ask
  • On
  • Off
  • Toggle (Default)

If type is Ask the third argument must be supplied and must be a valid ARexx var name: it will contain the number of the selected entries.

Sort   Sort the entries of the list. See Insertion and Sorting

 

Insertion and sorting

Insertion means adding entries at init time and adding entries with AddStem and ClearAddStem methods.

Insertion is ruled by the following attributes:

  1. DefaultInsertPos
  2. DragSortable

At init time, if DefaultInsertPos is specified and it is not Default, entries are inserted at the position specified, otherwise: if DragSortable is 1, entries are inserted Sorted, otherwise entries are inserted at the bottom.

The above applies also when adding entries with AddStem and ClearAddStem.

Sorting is ruled by SortType and SortFormat; SortType specifies the sorting criterium: no sort, the number of the column that rules the sort, reverse order; SortFormat specifies options for each column of the List.

Note that SortType default value is OFF. It means that no sorting applies so that entries are inserted not sorted (usually at the bottom).