Topic: APLX Help : System Classes : List of Classes : Scroll
[ Previous | Next | Contents | Index | APL Home ]



The Scroll class implements scroll bars, allowing the user to move a slider to scroll around data or select a value from a range.

The main property for a Scroll object is value. This is a five-element vector, as follows:

[1] Current value (initially 0)
[2] Maximum value (default 100)
[3] 'Page' increment (default 1)
[4] Minimum value (default 0)
[5] (Reserved: 0)

When setting this property, you do not have to set all the elements.

The style property determines the orientation of the scroll bar. It is 0 for Vertical or 1 for Horizontal.

When the user changes the position of the slider, the onChange callback is triggered.

Note that you do not need to create your own scroll bars for List, Tree, Picture, Edit, RichEdit and Document objects; these will automatically include scroll bars where necessary, provided you have set the correct style property.


[1]   ⍝ Sample function demonstrating use of the Scroll object
[2]   DEMO←'⎕' ⎕NEW 'Dialog' ⋄ DEMO.scale←1
[3]   DEMO.title←'Scroll Bar Example'
[4]   DEMO.Scrl.New 'Scroll' ⋄ DEMO.Scrl.where←2 1
[5]   DEMO.Scrl.value←0 100 10 0 0
[6]   DEMO.Lab.New 'Label' ⋄ DEMO.Lab.where←4 1
[7]   DEMO.Lab.caption←'Value: 0'
[8]   ⍝
[9]   ⍝ Create callback function which will run when the user spins the control
[10]  0 0⍴⎕FX 'CB_SCROLL;X' 'X←DEMO.Scrl.value' 'DEMO.Lab.caption←"Value ",⍕1↑X'
[11]  DEMO.Scrl.onChange←'CB_SCROLL'
[12]  ⍝
[13]  ⍝ Wait for the user to close the window
[14]  0 0⍴⎕WE DEMO


align anchors aquaadjust autodraw caption children class color data doublebuffered dragsource droptarget enabled events extent handle maxsize methods minsize name opened order pointer properties scale self size sourceformats style tabstop targetformats tie tooltip units value visible where winptr


Click Clienttoscreen Close Create Delete Draw Focus Hide New Open Paint Resize Screentoclient Send Set Show Trigger


onChange onClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onFocus onHide onKeyDown onKeyPress onKeyUp onMouseDown onMouseMove onMouseUp onOpen onSend onShow onUnFocus

Topic: APLX Help : System Classes : List of Classes : Scroll
[ Previous | Next | Contents | Index | APL Home ]