[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.6.4 Clipping

Clipping is the process of removing parts of output covered by other components. CSWS has full clipping implemented for all existing graphics primitives. There is no drawing operation that can influence other component's image except transparent windows. Clipping is performed in the following fasion. First primitive is clipped against dirty rectangle (to cut off excessive output), then it is clipped against all its neightbours, then against `clip parent' window and all its neightbours and so on.

Clip Parents

All components have a `parent' component and a `clipparent' component. What they are used for? Usually `clipparent' is equal to `parent' so there is no difference between them. But in some rare cases there is a need to perform clipping in a different way. For example, popup menus that belong to a window usually should not be clipped against that window, but rather to the parent of parent window or even clipped only to desktop. In this case you should assign a different clip parent to that component. This can be performed by using InsertClipChild() method. For example, to make a menu clip to application's bounds, you should call:

 
app->InsertClipChild(menu);

You should not assign directly to `clipparent' variable since InsertClipChild() does much extra work. For example it inserts the so-called "clip children" into component's clip child list, removes component from former clipparent's "clip children" list and so on.

Partially Transparent Components

You can set a state flag called `CSS_TRANSPARENT' to mark semi-transparent components. Transparent components works differently in the following ways:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html