GeUserArea is the base class for all gadgets that can be displayed in a GeDialog. A new gadget is created by implementing a subclass of GeUserArea. Such a gadget manages user interaction and draws the gadget interface in the GUI.
An instance of a GeUserArea based class is typically stored as a member of the parent GeDialog. It is added to the dialog layout using:
See GeDialog Manual.
The parent dialog is accessible with:
A custom user area is created by implementing a subclass of GeUserArea. This subclass can implement different virtual functions that define the behaviour of the gadget.
The user area is initiated with:
The size of the user area is handled with:
Different messages are sent to a user area:
The primary purpose of a user area is to draw the actual user interface:
A user area can catch user interaction events:
See also GeDialog Gadget Interaction.
These properties can be read from a user area:
A user area can use an internal timer that calls GeUserArea::Timer() periodically.
A user area can handle user interaction events by implementing GeUserArea::InputEvent(). The following functions are used to get more detailed information on the current event:
A special operation is a mouse drag event inside the user area. Such a mouse drag is initiated in reaction to certain user interaction using these functions:
The user can drag and drop various elements onto a user area. The user area is informed about this event through messages sent to GeUserArea::Message(). These functions are used to react to those messages:
See also Drag and Drop.
It is also possible to start a drag and drop operation from a user area. This is typically done in reaction to some user interaction.
A user area can send messages to its parent GeDialog. This is typically done to inform the dialog that some user interaction occurred and that the managed values changed.
See GUI and Interaction Messages Manual.
The central task of a user area is to draw something to Cinema 4D's user interface. The drawing operations have to happen inside the GeUserArea::DrawMsg() function.
The drawing operation can be triggered with:
The following functions can be used to draw inside the canvas provided by the user area. For more advanced drawing operations one can use a GeClipMap and GeUserArea::DrawBitmap().
The color and opacity settings are handled with:
c4d_colors.h
.Different styles used with various drawing functions are (LINESTYLE):
These functions draw primitive shapes:
A BaseBitmap can both be drawn to the canvas and filled with the current pen:
See also BaseBitmap Manual.
The border style of the user area is defined with:
Text is drawn with these functions:
A user area can support a dynamic fading effect that is typically used to change the background color of the gadget after the cursor moved over it:
See also Fading.
It is also possible to be informed when the cursor leaves the user area:
Clipping is used to limit drawing operations to certain areas:
Miscellaneous functions are:
These functions are used to transform coordinates into different spaces: