Communication between different parts of the Cinema 4D GUI happens through multiple messages. These messages are sent to GeDialog and GeUserArea elements:
Messages are represented by BaseContainer objects that store the parameters of the message. The ID of the message is typically the ID of the BaseContainer (BaseContainer::GetId()). See BaseContainer Manual.
For details on GeDialog and GeUserArea see GeDialog Manual and GeUserArea Manual.
All message are first sent to the object's "Message" function (GeDialog::Message(), GeUserArea::Message()). If the messages are not handled in the implementation of the "Message" function they will be also handled in the base-class. Certain messages are re-directed to dedicated functions.
Several messages sent to a GeDialog will invoke these member functions:
Several messages sent to a GeUserArea will invoke these member functions:
Messages can be sent to receive information from the target element. In some cases the message must explicitly state that it requests a result.
When the mouse cursor is moved over a GeDialog or GeUserArea a message is sent to these elements. The reaction to this message allows to define the cursor and some help text.
The parameters of the message are:
Compare also ToolData::GetCursorInfo(), SceneHookData::GetCursorInfo(), etc.
The message BFM_CURSORINFO_REMOVE can be sent by a custom callback function to inform a user area that the cursor has left the area:
A GeDialog or GeUserArea is informed when it receives or looses the focus:
A GeDialog is informed when it is about to be closed. One has to return false if it is safe to close the dialog.
A GeDialog is informed when any kind of interaction with some hosted gadget starts or ends:
When a gadget or custom GUI element is changed by the user it sends the message BFM_ACTION to the parent dialog.
The parameters of the message are:
Both GeDialog and GeUserArea are informed on keyboard and mouse user interaction events.
The parameters of the message are:
The input from keyboard interactions is either a character or some special key:
Further details on the event are stored in these parameters:
Both GeDialog and GeUserArea are informed on drag and drop operations onto their area:
The parameters of the message are:
Different types of elements can be dragged:
See also Drag and Drop and Drag and Drop.
A custom GUI element can be used to display a parameter of a NodeData based plugin the in the Attribute Manager. It is possible to send a message from the custom GUI to that NodeData based plugin. This can be used to inform the plugin on what internal data specificity was changed.
See also Attribute Manager Interaction.
A GeUserArea can inform the parent dialog when it changed its size:
A GeDialog can be part of a layout and is created when that layout is loaded. To restore a given state of that GeDialog, internal data of that dialog must be stored with the layout. This internal data is received and reset using these messages:
A GeDialog defines its layout using groups with multiple columns/rows. The weights of a group define the relative scale of these columns/rows. When the user changes the scale a message is sent to the GeDialog:
A GeUserArea can support a dynamic fading effect. After GeUserArea::ActivateFading() was called, Cinema 4D sends the BFM_FADE message to the user area for the duration of the fading operation.
See Drawing Operations.
The message BFM_DRAW is sent to a GeUserArea to draw into the Cinema 4D GUI. The message will call GeUserArea::DrawMsg().
The clipping dimensions are stored in these parameters:
The draw reason is also stored:
Dialogs and user areas are informed when they become visible:
Some messages can only be sent to specific elements or are only sent by specific elements.
Text edit field messages:
Multi-line edit fields messages:
Messages to access the internally stored undo stack of a multi-line edit field:
It is also possible to send messages from the IDM list to the multi-line edit field.
The message BFM_SETSTATUSBAR can be sent to edit the status bar of a scroll group or a progress bar custom GUI element:
The parameters of this message are:
A message is sent from a popup button:
A scroll group informs the parent dialog when it was scrolled:
The base class for custom GUI elements (used to display NodeData parameters in the Attribute Manager) is iCustomGui which is based on GeDialog. Such custom GUI elements receive these messages when the used "User Interface" is changed in the Attribute Manager. The custom GUI can then store the ID of the currently active gadget:
Both GeDialog and GeUserArea receive core messages. These messages call GeDialog::CoreMessage() or GeUserArea::CoreMessage().
See the Core Messages Manual.