Extended types for objects Special text objects Keyboard shortcuts
Programming guideline of WinDom

The UserDraw objects

These objects are not really extended object. The extended type (255) should never be set directly by the user from the ressource editor. This value is not used by RsrcXtype() but by RsrcUserDraw().

The goal of these objects is to provide an easy way to draw something in a formular or a toolbar inside a window. Drawing inside classical GEM formular is not possible.

To attribute a drawing function to an object, you have to use the RsrcUserDraw() function. This function transforms the object in a special extended type (255) format. After this call, the AES will call the function given to RsrcUserDraw() to draw the object. The function given to RsrcUserDraw() - that we call the UserDraw function - and the Userdef function are differents. Actually, the Userdef function calls the drawing function to draw the object. The main raison of this system is that the drawing function is similar to a standard drawing function of a window (i.e. the function called by WM_REDRAW), but there are some differences:

The only one difference with a Userdef function is that we should never clip the redraw area of the object. This action is performed by the userdef function calling your UserDraw function.

Example

/* A typical userdraw function : a simple text */

void MyUserDraw( WINDOW *win, PARMBLK *pblk) { char *p;

A FINIR }