The Combo class implements the Combo object, a drop-down menu (or list-box) with an optional edit field.
The style property defines the type of combo box, as follows:
0 = drop down menu with edit field 1 = simple list box (always down), with edit field 2 = drop down list, no edit field
Note: Under MacOS, only style 2 is currently supported. Under Linux, style 1 is not supported.
The list property determines the items in the menu/list box part of the control. 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).
Under Windows amd Linux, the text property contains the text of the edit field (which the user may have edited), as a character vector. The selection and seltext properties contain the selection start/end and selected text in the edit field. Under Windows only, the limit property allows you to limit the maximum number of characters in this text.
The value property is an integer containing the index into the list of the selected item, in index origin 1. It is an empty vector if there is no selection (you can also write 0 to achieve the same effect).
To provide help text when the user moves the mouse pointer over the control and pauses, you can use the tooltip property.
If you need to detect when the user changes the selection, add an onChange callback.
∇DEMO_Combo;DEMO  ⍝ Sample function demonstrating use of the Combo object  DEMO←'⎕' ⎕NEW 'Dialog' ⋄ DEMO.scale←1  DEMO.title←'Combo Example'  DEMO.myCombo.New 'Combo' ⋄ DEMO.myCombo.where←2 1  DEMO.myCombo.list←⎕W ⋄ DEMO.myCombo.value←3  ⍝ Wait for the user to close the window  0 0⍴⎕WE DEMO ∇
align anchors aquaadjust autodraw caption children class color data doublebuffered dragsource droptarget enabled events extent font handle limit list maxsize methods minsize name opened order pointer properties scale selection self seltext size sourceformats style tabstop targetformats text tie tooltip 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