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

www.microapl.co.uk

Line


Description

The Line object draws a single line, and is normally used for display purposes only. The where or size property is used to define the enclosing rectangle, with a special meaning. The first two parameters (top and left of the 'rectangle') are the starting position of the line. The second two (height and width of the 'rectangle') are the offset to the end of the line, and may be negative. For example, if where is 20 20 10 0, the line starts at 20 20 and is vertically downwards; if where is 20 20 ¯10 0, it is vertically upwards.

You can set the drawing (foreground) color using the color property, and the pensize property changes the thickness of the lines.

Note: Remember that the default scale is in character units. See the scale property for details.

See also the Draw method which allows you to draw geometric shapes on your windows and controls.

Example

     ∇DEMO_Line;DEMO
[1]   ⍝ Sample function demonstrating use of the Line object
[2]   DEMO←'⎕' ⎕NEW 'Window' ⋄ DEMO.scale←1
[3]   DEMO.title←'Line Example'
[4]   ⍝
[5]   ⍝ Thin horizontal line in red
[6]   DEMO.LN1.New 'Line'
[7]   DEMO.LN1.where←4 0 0 10
[8]   DEMO.LN1.color←255
[9]   ⍝
[10]  ⍝ Thicker diagonal line in blue
[11]  DEMO.LN2.New 'Line'
[12]  DEMO.LN2.where←4 10 8 10
[13]  DEMO.LN2.pen←4
[14]  DEMO.LN2.color←0 0 255
[15]  ⍝
[16]  ⍝ Wait for the user to close the window
[17]  0 0⍴⎕WE DEMO
     ∇

Properties

align anchors aquaadjust autodraw children class color data dragsource droptarget enabled events extent filled maxsize methods minsize name opened pointer properties scale self size sourceformats targetformats tie units visible where

Methods

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

Callbacks

onClick onClose onDblClick onDestroy onDragDrop onDragEnd onDragEnter onDragLeave onDragOver onDragStart onHide onMouseDown onMouseMove onMouseUp onOpen onSend onShow


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