The List class implements list boxes, allowing the user to make a selection from a list.
The style property defines the type of list box, as the sum of the following flags:
1 = Allow multi select 2 = Allow display of a non-integral number of lines 16 = Show the vertical scroll bar 64 = Show the horizontal scroll bar (Mac only) 128 = Hide scroll bars when they are not needed (Mac only)
The list property determines the items in the list box. You can set it either as a character matrix or as a character vector with embedded carriage returns. (If you read it back, it will be returned as a character matrix).
The value property is an integer scalar or vector containing the index into the list of the selected item, in index origin 1. It is an empty vector if there is no selection. If the style allows multi-select, it may be a vector of more than one element.
The firstvisible property allows you to read or set the first visible item in the list (i.e. where the list is scrolled to).
If you need to detect when the user changes the selection, add an onChange callback.
∇DEMO_List;DEMO  ⍝ Sample function demonstrating use of the List object  DEMO←'⎕' ⎕NEW 'Dialog' ⋄ DEMO.scale←1  DEMO.title←'List Example'  DEMO.myList.New 'List'  DEMO.myList.where←2 1  DEMO.myList.list←⎕M  DEMO.myList.value←3  ⍝  ⍝ Wait for the user to close the window  0 0⍴⎕WE DEMO ∇
align anchors aquaadjust autodraw border caption children class color data doublebuffered dragsource droptarget enabled events extent firstvisible font handle list maxsize methods minsize name opened order pointer properties scale self size sourceformats style tabstop targetformats tie units value visible where winptr
onChange onClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onFocus onHide onKeyDown onKeyPress onKeyUp onMouseDown onMouseMove onMouseUp onOpen onSend onShow onUnFocus
Copyright © 1996-2010 MicroAPL Ltd