Name
Scrollcanvas.Paint -- request paint notification
Function
Set up a listener on this attribute to have your event handler called whenever content needs to be drawn on the canvas. Your event handler can then paint the canvas contents depending on the current scrollbar position.

RapaGUI will pass the identifier of a Hollywood brush whose size is exactly as big as the visible area of your scrollcanvas widget to your callback. You then have to draw the desired contents to this brush. Precisely, you just have to draw to the rectangle defined by the four coordinates X, Y, Width, and Height which are passed to your callback as well. These four coordinates describe a rectangular area within the dimensions of the brush that is passed to your callback. When a full redraw is needed, X and Y will be 0 and Width and Height will match the dimensions of the brush. Most oftenly, however, only a partial redraw is needed and then you must only draw to the portion of the brush defined by those coordinates.

The following extra arguments will be passed to your event handler:

Brush:
Contains the identifier of a brush you have to draw to. Use Hollywood's SelectBrush() command to select this brush as the output device in your callback. Don't forget to call EndSelect() when you are done!

ViewWidth:
Contains the visible width of widget. This is also identical to the width of the brush that is passed to your callback.

ViewHeight:
Contains the visible height of widget. This is also identical to the height of the brush that is passed to your callback.

ScrollX:
Contains the position of the horizontal scrollbar.

ScrollY:
Contains the position of the vertical scrollbar.

VirtWidth:
Contains the virtual width of your widget. This is the value set using Scrollcanvas.VirtWidth.

VirtHeight:
Contains the virtual height of your widget. This is the value set using Scrollcanvas.VirtHeight.

X:
Contains the x-position inside the brush at which you should start drawing. See above for details.

Y:
Contains the y-position inside the brush at which you should start drawing. See above for details.

Width:
Contains the number of columns you should paint to the brush (starting from X). See above for details.

Height:
Contains the number of rows you should paint to the brush (starting from Y). See above for details.

To compute the absolute position of the content that should be drawn to the canvas, just add the ScrollX+X and ScrollY+Y coordinates and you're done.

See Notifications for details.

Type
Boolean

Applicability
N


Show TOC