GeDialog is the base class for interface elements of Cinema 4D. An asynchronous (non-modal) dialog acts as a panel that can be added to the application layout or as a free floating window. In contrast a synchronous (modal) dialog blocks the application's main thread until it is closed. A custom dialog is added by creating a subclass of GeDialog. GeDialog is also the base class of iCustomGui which is used to create custom GUI elements for NodeData parameters.
A GeDialog based window is typically owned by a CommandData plugin. This CommandData stores and opens the dialog instance.
The GeDialog is opened with GeDialog::Open(). The different types of dialogs are:
The GeDialog window can be closed with GeDialog::Close(). This will call GeDialog::AskClose() (see below).
A custom window is created by implementing a subclass of GeDialog. This subclass can implement different virtual functions to define the layout and behaviour of the dialog.
Dialog setup:
Messages and Interaction:
Timed Actions:
It is possible to check these GeDialog properties:
It is also possible to read the pixel ratio of the current screen:
The layout of a GeDialog - the arrangement of groups and gadgets - is defined in the implementation of GeDialog::CreateLayout(). This layout can be defined by creating the groups and gadgets individually or by loading a dialog resource file.
General functions to handle GeDialog gadgets are:
GeDialog based windows contain a menu bar. This menu bar can contain various sub-menus and also any kind of gadget in a special sub-group.
Menus are created with:
Sub-menus are added with these functions:
Menu items are added with these functions:
It is possible to add arbitrary gadgets to a special sub-group of the menu bar:
The arrangement of elements of the dialog layout is defined with groups. Such groups can define rows and columns and can contain further sub-groups.
Groups are created with these functions:
The border style and spacing of groups can be defined with these functions:
If the group flag BFV_GRIDGROUP_ALLOW_WEIGHTS is set the user can change the width/height of group's columns/rows. The size of columns/rows is stored as "weights" which can be stored.
See also BFM_WEIGHTS_CHANGED in GUI and Interaction Messages Manual.
The content of a group can be flushed and replaced with new gadgets:
A scroll group allows to scroll the content of a group using the mouse-wheel:
See also BFM_SETSTATUSBAR in Specific GUI Elements.
A gadget that is part of a GeDialog layout can be identified in two ways:
Default GUI gadgets can be added to a GeDialog with these member functions:
Number related gadgets:
Text related gadgets:
Color related gadgets:
Buttons:
Seperators:
Further gadgets are:
A multi-line text edit field can be created and configured with these functions:
See also Specific GUI Elements.
Several gadgets can contain multiple child-elements, typically for selection purposes:
Further interaction with gadgets is typically done by sending messages to the gadget:
See also GUI and Interaction Messages Manual.
There is no default gadget to display an image (BaseBitmap) in a GeDialog. Two possible solutions are:
Further gadgets are implemented as custom GUI elements. Such custom GUI elements have to be created using their type ID.
See Custom GUI Elements.
GeUserArea is the base class for all dialog gadgets. A subclass of GeUserArea defines a new custom gadget. Such a custom gadget can be added to the GeDialog.
See also GeUserArea Manual.
It is possible to add a sub-dialog to a given GeDialog based window. Such a sub-dialog is based on SubDialog which in return is also based on GeDialog.
For convenience it is possible to add a default group of gadgets to the dialog. This group can contain the standard buttons "OK" or"Cancel". See DLG.
For most gadgets it is possible to define the size of the gadget. To define this size one must use these functions to bake the pixel size:
The position and behaviour of groups and gadgets is defined with these flags:
Horizontal alignment:
Vertical alignment:
GUI elements are used to display values and to allow user interaction to change these values. For default GUI elements there are three kinds of functions to edit these values:
Editing Boolean values:
Editing integer values:
Editing float values:
Editing Vector values:
Editing Time values:
Editing String values:
Editing Filename values: These functions just wrap around GeDialog::GetString() and GeDialog::SetString().
Editing Color values:
A GeDialog receives messages from both its gadget and from the Cinema 4D GUI. They are sent to GeDialog::Message().
See GUI and Interaction Messages Manual.
When a gadget is changed it sends a message to the parent GeDialog. This message can be caught in GeDialog::Command().
See GUI and Interaction Messages Manual.
When a gadget is changed one might need to know the state of the mouse or keyboard when this happened.
The user can drag and drop various elements onto a GeDialog. The GeDialog is informed about this event through messages sent to GeDialog::Message(). These functions are used to react to these messages:
See also Drag and Drop.
A GeDialog can also receive core messages. These messages are sent to inform the dialog about global events e.g. when something in the active document changed. The messages are sent to GeDialog::CoreMessage().
See also GUI and Interaction Messages Manual and Core Messages Manual.
A GeDialog can be the base of a sub-dialog or a custom GUI element. In this case it must send messages to a parent dialog. The typical use case is a custom GUI element (based on CustomGuiData, iCustomGui) that has to inform the parent dialog that a stored value has changed.
These utility functions allow to access the dimensions of a gadget or to transfer given coordinates into various spaces:
Color related functions are:
c4d_colors.h
.