Cicode Programming Reference > Cicode Function Categories > Display Functions > DspSetClip

DspSetClip

Sets the clip rectangle for the AN of an object or group of objects, defined by the top, left, right and bottom co- ordinates.

If an AN has a clip rectangle specified, then any part (object) of the AN that is outside of the rectangle will not be rendered. You can use a clip rectangle for "control" type genies like treeviews that have scrollbars, to clip the contents of the control to the control's area when the scrollbar is moved.

A clip rectangle can be set for a group which will affect all the children of the group (and their children).

A clip rectangle set on a child will override the clip set on the group (this also applies to nested groups).

When an AN is clipped (i.e. it is outside the clip rectangle) then it will not respond to mouse input i.e. touch commands will not be invoked, tooltips will not be displayed, and the kobject will not be given the focus rectangle for keyboard input. If it is partially clipped, then this only applies to the clipped part, the visible part still responds as normal.

Syntax

DspSetClip(INT nAN, INT nLeft, INT nTop, INT nRight, INT nBottom)

nAN:

The animation-point number of the object or group of objects inside the clipping region.

nLeft:

The x coordinate of the left side of the clipping boundary

nTop:

The x coordinate of the top of the clipping boundary

nRight:

The y co-ordinate of the right side of the clip rectangle.

nBottom:

The y co-ordinate of the bottom of the clip rectangle. .

Return Value

It returns an error if nAN is invalid, or the specified rectangle is invalid i.e. nLeft >= nRight or nTop >= nBottom.

Note: Will return an error if nAN specifies an ActiveX control.

Example

DspSetClip(17, 200, 200, 800, 500);

See Also

Display Functions

Published June 2018