Topic: APLX Help : System Classes : Using the Draw method : Draw method Grouping and Control commands
[ Previous | Contents | Index | APL Home ]

www.microapl.co.uk

Draw method: Grouping and Control commands


Reset

Syntax: Control.Draw 'Reset'

Deletes all saved Draw command sequences associated with the control, and resets the Font, Pen and Brush to default values. The default Pen is a black solid line of 1 pixel width. The default Brush is the window background color. The default Font is Arial 10 point.


State

Syntax: R ← Control.Draw 'State'

Returns a nested array of the Draw commands which are associated with a control. This is the series of commands which APLX automatically uses to redraw the control when a window update is needed. You can use this to redraw the same image on a different control by passing it directly as the nested argument of the Draw method. This is particularly useful for printing the contents of a window; simply open a Printer object and pass the array to the Draw method of the printer.


GetBitmap

Syntax: R ← Control.Draw 'GetBitmap'

Returns an APL integer matrix, where each element contains an RGB color for the corresponding pixel. The color value is encoded as 256⊥Blue Green Red, where each color value is in the range 0 to 255


GetSVG

Syntax: R ← Control.Draw 'GetSVG'

Returns a character vector containing a representation of the drawing in Scalable Vector Graphics (SVG) format. This can be useful for creating high quality resolution-independent drawings suitable for publication.

Copy

Syntax: Control.Draw 'Copy'

Places a copy of the drawing on the clipboard in the native format for the host


Group

Syntax: Control.Draw 'Group' ID

Sets the Drawing group for further commands.

All drawing commands for a particular control belong to a group. (The default is group 0). Using this command, you can cause a particular series of commands to be given a different group ID. The group ID must be a non-negative integer. Subsequently, you can either temporarily enable and disable the group (for example, to hide a particular part of the drawing), or delete the group altogether. You can use this feature for animation effects.


DisableGroup

Syntax: Control.Draw 'DisableGroup' ID

Temporarily disables one or more Drawing groups for a particular control. The control is redrawn without the commands in the disabled group(s) being executed. The ID parameter comprises one or more integers containing the groups to be added to the list of disabled groups.


EnableGroup

Syntax: Control.Draw 'EnableGroup' ID

Re-enables one or more Drawing groups for a particular control. The control is redrawn. The ID parameter comprises one or more integers containing the groups to be removed from the list of disabled groups.


DeleteGroup

Syntax: Control.Draw 'DeleteGroup' ID

Removes one or more Drawing groups from the list of saved commands for a particular control. The commands are removed entirely and the memory associated with them is released. The control is redrawn.


Topic: APLX Help : System Classes : Using the Draw method : Draw method Grouping and Control commands
[ Previous | Contents | Index | APL Home ]