#include <c4d_gui.h>
Used to display GUI dialogs. Derive this class, overriding the necessary functions, and then call Open() to display it.
Public Member Functions | |
Bool | SetColorField (const GadgetPtr &id, const TriState< Vector > &tri, Float brightness, Float maxbrightness, Int32 flags) |
Bool | GetFolding (void) |
void | SetFolding (Bool allowClose) |
Int32 | IsDockedOrTabbed () |
Protected Attributes | |
Bool | createlayout |
Private Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (GeDialog) | |
Private Attributes | |
CDialog * | cd |
Int32 | t_lastcoremsg |
Bool | _folding |
Friends | |
class | GeUserArea |
class | _GeListView |
Constructor/Destructor | |
GeDialog (void) | |
virtual | ~GeDialog (void) |
Internal Representation | |
CDialog * | Get () |
Override | |
virtual Bool | CreateLayout (void) |
virtual Bool | InitValues (void) |
virtual Bool | CoreMessage (Int32 id, const BaseContainer &msg) |
virtual Bool | Command (Int32 id, const BaseContainer &msg) |
virtual Bool | AskClose (void) |
virtual void | Timer (const BaseContainer &msg) |
virtual void | DestroyWindow (void) |
virtual Int32 | Message (const BaseContainer &msg, BaseContainer &result) |
Open/Close | |
Bool | Open (DLG_TYPE dlgtype, Int32 pluginid, Int32 xpos=-1, Int32 ypos=-1, Int32 defaultw=0, Int32 defaulth=0, Int32 subid=0, OPENDIALOGFLAGS flags=OPENDIALOGFLAGS::NONE) |
Bool | Close (void) |
Bool | Close (Bool dummy) |
Basic Functions | |
GeData | SendMessage (const GadgetPtr &id, const BaseContainer &msg) |
Bool | SendParentMessage (const BaseContainer &msg, Bool receiveSelf=false) |
Int32 | GetId (void) |
Bool | IsOpen () |
Bool | IsVisible () |
Bool | IsMinimized () const |
void | SetTimer (Int32 timer) |
void | SetTitle (const maxon::String &title) |
maxon::String | GetTitle () |
Bool | Enable (const GadgetPtr &id, Bool enabled) |
Bool | IsEnabled (const GadgetPtr &id) |
Input | |
Bool | GetInputState (Int32 askdevice, Int32 askchannel, BaseContainer &res) |
Bool | GetInputEvent (Int32 askdevice, BaseContainer &res) |
void | KillEvents (void) |
Plain Set | |
Bool | SetBool (const GadgetPtr &id, Int32 value, Int32 tristate=0) |
Bool | SetInt32 (const GadgetPtr &id, Int32 value, Int32 min=LIMIT< Int32 >::MIN, Int32 max=LIMIT< Int32 >::MAX, Int32 step=1, Int32 tristate=0, Int32 min2=LIMIT< Int32 >::MIN, Int32 max2=LIMIT< Int32 >::MAX) |
Bool | SetFloat (const GadgetPtr &id, Float value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 format=FORMAT_FLOAT, Float min2=0.0, Float max2=0.0, Bool quadscale=false, Int32 tristate=0) |
Bool | SetMeter (const GadgetPtr &id, Float value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 tristate=0) |
Bool | SetDegree (const GadgetPtr &id, Float radians_value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 tristate=0) |
Bool | SetPercent (const GadgetPtr &id, Float value, Float min=0.0, Float max=100.0, Float step=1.0, Int32 tristate=0) |
Bool | SetTime (const GadgetPtr &id, const BaseDocument *doc, const BaseTime &value, const BaseTime &min=BaseTime(- 108000, 1), const BaseTime &max=BaseTime(108000, 1), Int32 stepframes=1, Int32 tristate=0) |
Bool | SetString (const GadgetPtr &id, const maxon::String &text, Int32 tristate=0, Int32 flags=0) |
Bool | SetColorField (const GadgetPtr &id, const Vector &color, Float brightness, Float maxbrightness, Int32 flags) |
Bool | SetFilename (const GadgetPtr &id, const Filename &fn, Int32 tristate=0) |
Plain Get | |
Bool | GetBool (const GadgetPtr &id, Bool &value) const |
Bool | GetInt32 (const GadgetPtr &id, Int32 &value) const |
Bool | GetFloat (const GadgetPtr &id, Float &value) const |
Bool | GetVector (const GadgetPtr &id_x, const GadgetPtr &id_y, const GadgetPtr &id_z, Vector &value) const |
Bool | GetString (const GadgetPtr &id, maxon::String &text) const |
Bool | GetColorField (const GadgetPtr &id, Vector &color, Float &brightness) const |
Bool | GetTime (const GadgetPtr &id, const BaseDocument *doc, BaseTime &time) const |
Bool | GetFilename (const GadgetPtr &id, Filename &fn) const |
Bool | CheckTristateChange (const GadgetPtr &id) |
Container Get | |
Bool | GetBool (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const |
Bool | GetInt32 (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const |
Bool | GetFloat (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const |
Bool | GetTime (const GadgetPtr &id, const BaseDocument *doc, BaseContainer *bc, Int32 bcid) const |
Bool | GetVector (const GadgetPtr &id_x, const GadgetPtr &id_y, const GadgetPtr &id_z, BaseContainer *bc, Int32 bcid) const |
Bool | GetString (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const |
Bool | GetFilename (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const |
Bool | GetColorField (const GadgetPtr &id, BaseContainer *bc, Int32 bc_colid, Int32 bc_brightnessid) const |
Coordinates Transformation | |
Bool | Local2Global (Int32 *x, Int32 *y) |
Bool | Global2Local (Int32 *x, Int32 *y) |
Bool | Screen2Local (Int32 *x, Int32 *y) |
Bool | Local2Screen (Int32 *x, Int32 *y) |
Color | |
Bool | GetColorRGB (Int32 colorid, Int32 &r, Int32 &g, Int32 &b) |
void | SetDefaultColor (const GadgetPtr &id, Int32 colorid, Int32 mapid) |
void | SetDefaultColor (const GadgetPtr &id, Int32 colorid, const Vector &color) |
Layout Helpers | |
Bool | AddChild (const GadgetPtr &id, Int32 subid, const maxon::String &child) |
Bool | FreeChildren (const GadgetPtr &id) |
Bool | SetPopup (const GadgetPtr &id, const BaseContainer &bc) |
Bool | AddChildren (const GadgetPtr &id, const BaseContainer &bc) |
C4DGadget * | AddUserArea (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0) |
Bool | AttachUserArea (GeUserArea &ua, const GadgetPtr &id, USERAREAFLAGS userareaflags=USERAREAFLAGS::COREMESSAGE) |
Bool | AddSubDialog (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0) |
Bool | AttachSubDialog (SubDialog *userdlg, Int32 id) |
Bool | AddDlgGroup (Int32 type) |
Group | |
Bool | GroupBeginInMenuLine () |
Bool | TabGroupBegin (Int32 id, Int32 flags, Int32 tabtype=TAB_TABS) |
Bool | GroupBegin (Int32 id, Int32 flags, Int32 cols, Int32 rows, const maxon::String &title, Int32 groupflags, Int32 initw=0, Int32 inith=0) |
Bool | GroupEnd (void) |
Bool | GroupSpace (Int32 spacex, Int32 spacey) |
Bool | GroupBorder (UInt32 borderstyle) |
Bool | GroupBorderNoTitle (UInt32 borderstyle) |
Bool | GroupBorderSpace (Int32 left, Int32 top, Int32 right, Int32 bottom) |
Bool | GroupWeightsSave (const GadgetPtr &id, BaseContainer &weights) |
Bool | GroupWeightsLoad (const GadgetPtr &id, const BaseContainer &weights) |
Drag and Drop | |
Bool | GetItemDim (const GadgetPtr &id, Int32 *x, Int32 *y, Int32 *w, Int32 *h) const |
Bool | GetDragPosition (const BaseContainer &msg, Int32 *x, Int32 *y) |
Bool | GetDragObject (const BaseContainer &msg, Int32 *type, void **object) |
Bool | SetDragDestination (Int32 cursor, Int32 gadgetid=0) |
Bool | CheckDropArea (const GadgetPtr &id, const BaseContainer &msg, Bool horiz, Bool vert) |
Scroll Group | |
Bool | GetVisibleArea (Int32 scrollgroupid, Int32 *x1, Int32 *y1, Int32 *x2, Int32 *y2) |
Bool | SetVisibleArea (Int32 scrollgroupid, Int32 x1, Int32 y1, Int32 x2, Int32 y2) |
Bool | ScrollGroupBegin (Int32 id, Int32 flags, Int32 scrollflags, Int32 initw=0, Int32 inith=0) |
Menu | |
Bool | MenuFlushAll (void) |
Bool | MenuSubBegin (const maxon::String &string) |
Bool | MenuSubEnd (void) |
Bool | MenuAddCommand (Int32 cmdid) |
Bool | MenuAddString (Int32 id, const maxon::String &string) |
Bool | MenuAddSeparator (const maxon::String &title=maxon::String()) |
Bool | MenuFinished (void) |
Bool | MenuInitString (Int32 id, Bool enabled, Bool checked) |
Bool | MenuSetResource (Int32 id) |
Custom GUI | |
void * | FindCustomGui (Int32 id, Int32 pluginid) |
template<typename T > | |
T * | FindCustomGui (Int32 id) |
void * | AddCustomGui (Int32 id, Int32 pluginid, const maxon::String &name, Int32 flags, Int32 minw, Int32 minh, const BaseContainer &customdata) |
template<typename T > | |
T * | AddCustomGui (Int32 id, const maxon::String &name, Int32 flags, Int32 minw, Int32 minh, const BaseContainer &customdata) |
Multi-line Edit | |
Bool | SetMultiLineMode (const GadgetPtr &id, SCRIPTMODE mode) |
Bool | SetMultiLineLock (const GadgetPtr &id, Bool lock) |
Bool | SetMultiLinePos (const GadgetPtr &id, Int32 line, Int32 pos) |
Miscellaneous | |
Bool | CheckClose (void) |
Bool | CheckValueRanges (void) |
Float | GetPixelRatio () const |
Bool | ReleaseLink () |
Bool | CheckCoreMessage (const BaseContainer &msg, Int32 *ownlastcoremsg=nullptr) |
void * | GetWindowHandle () |
void * | GetWindowInterface () |
static void | HandleHelpString (const BaseContainer &msg, BaseContainer &result, const maxon::String &sym) |
static void * | GetGuiInterface () |
GeDialog | ( | void | ) |
Creates the dialog, but does not open it.
|
virtual |
Destroys the dialog. If the dialog is still open, it is closed.
|
private |
CDialog* Get | ( | void | ) |
Retrieves a pointer to the internal dialog pointer.
|
virtual |
Called when the dialog is about to be displayed. Override this method to define the layout of the dialog.
Either use the recommended LoadDialogResource function or the manual functions (for example AddButton()). See Dialog Layout for more information.
Reimplemented in ProgressDialog.
|
virtual |
Called when the dialog is initialized by the GUI. Override this method to initialize local variables and the gadgets used.
Reimplemented in ProgressDialog.
|
virtual |
Override this method to react to Cinema 4D core messages.
[in] | id | The message ID: EVMSG |
[in] | msg | The message container. |
|
virtual |
Whenever the user clicks on a gadget and/or changes its value this function will be called. It is also called when a string menu item is selected. Override this methods to handle such events.
[in] | id | The ID of the gadget that triggered the event. |
[in] | msg | The message container. Contains the following values: BFM_ACTION_ID and BFM_ACTION_VALUE. |
Reimplemented in ProgressDialog.
|
virtual |
If the user wants to close the dialog with the OK button this function will be called. Override it to avoid closing the dialog if an error situation has occurred.
If false is returned everything will be as usual, but if true is returned the dialog will not close. This function is especially useful in combination with the GeModalDialog class for handling wrong user input before leaving the dialog.
Reimplemented in ProgressDialog.
|
virtual |
Called when a timer event is received.
To subscribe to timer events use SetTimer().
[in] | msg | The timer message container. |
Reimplemented in ProgressDialog.
|
virtual |
Called when the dialog is about to be closed temporarily, for example for layout switching.
All pointers to C4DGadget, GeUserArea and SubDialog objects as well as custom GUI objects are invalidated. So set all such stored pointers to nullptr.
CreateLayout will be called when the dialog is restored.
|
virtual |
Called when a message is received.
Override this function to react to more messages than covered by the other virtual functions. Normally this is not necessary.
[in] | msg | The message container. |
[in] | result | A container to place results in. |
Reimplemented in ProgressDialog, iCustomGui, SubDialog, and GeModalDialog.
Bool Open | ( | DLG_TYPE | dlgtype, |
Int32 | pluginid, | ||
Int32 | xpos = -1 , |
||
Int32 | ypos = -1 , |
||
Int32 | defaultw = 0 , |
||
Int32 | defaulth = 0 , |
||
Int32 | subid = 0 , |
||
OPENDIALOGFLAGS | flags = OPENDIALOGFLAGS::NONE |
||
) |
Opens the dialog at the specified position.
[in] | dlgtype | The dialog type: DLG_TYPE |
[in] | pluginid | The plugin ID of the CommandData with the dialog's CommandData::RestoreLayout(). |
[in] | xpos | The X position of the dialog. See note above. |
[in] | ypos | The Y position of the dialog. See note above. |
[in] | defaultw | The default width of the dialog in pixels. |
[in] | defaulth | The default height of the dialog in pixels. |
[in] | subid | The dialog sub-ID. This can be used to open several dialogs with a single command plugin for CommandData::ExecuteSubID(). |
[in] | flags | See OPENDIALOGFLAGS |
Bool Close | ( | void | ) |
Closes the dialog. Not necessary when using modal dialogs.
Always calls Close(void).
[in] | dummy | A dummy boolean state. |
GeData SendMessage | ( | const GadgetPtr & | id, |
const BaseContainer & | msg | ||
) |
Sends a message to a dialog element by ID.
[in] | id | The dialog element ID. |
[in] | msg | The message container. |
Bool SendParentMessage | ( | const BaseContainer & | msg, |
Bool | receiveSelf = false |
||
) |
Sends a message to the parent dialog.
[in] | msg | The message container. |
[in] | receiveSelf | True if the own parent message should process this message. Default is false. |
Int32 GetId | ( | void | ) |
Gets the dialog ID.
Bool IsOpen | ( | ) |
Checks if the dialog is open.
Bool IsVisible | ( | ) |
Checks if the dialog is visible.
Bool IsMinimized | ( | ) | const |
Checks if the dialog is minimized (in the dock or task bar).
void SetTimer | ( | Int32 | timer | ) |
Initializes the timer clock, so that Timer() is called every timer milliseconds. Use SetTimer(0) to stop the timer.
[in] | timer | The timer interval in milliseconds. Pass 0 to stop the timer. |
void SetTitle | ( | const maxon::String & | title | ) |
Sets the title of the dialog window.
[in] | title | The title. |
maxon::String GetTitle | ( | ) |
Gets the title of the dialog window.
Enables or disables the dialog item with the specified id.
[in] | id | The control ID. |
[in] | enabled | true to enable and false to disable. |
Checks if a dialog item is enabled.
[in] | id | The control ID. |
Bool GetInputState | ( | Int32 | askdevice, |
Int32 | askchannel, | ||
BaseContainer & | res | ||
) |
Polls a certain channel of a device for the current input state.
If the return value is true, the container stored in res is like an input event message, otherwise no state was available.
For a list of valid devices and channels, see Input Events.
[in] | askdevice | The device to ask. |
[in] | askchannel | The channel of the device. |
[out] | res | The result container. |
Bool GetInputEvent | ( | Int32 | askdevice, |
BaseContainer & | res | ||
) |
Gets the next input event for a certain device from the event queue.
If the return value is true, the container stored in res is like an input event message, otherwise no state was available.
For a list of valid devices and channels, see Input Events.
[in] | askdevice | The device to poll. |
[out] | res | The result container. |
void KillEvents | ( | void | ) |
Flushes all events from the window message queue.
For example if looping while the mouse is down (polling), call this function to flush all key downs/mouse clicks that are made during the loop.
Sets the value of checkbox controls.
[in] | id | The control ID. |
[in] | value | The new value. Checked is true and unchecked is false. If tristate is true then value must be 2. |
[in] | tristate | If true, and value is 2, the control is tinted to indicate tristate mode. |
Bool SetInt32 | ( | const GadgetPtr & | id, |
Int32 | value, | ||
Int32 | min = LIMIT< Int32 >::MIN , |
||
Int32 | max = LIMIT< Int32 >::MAX , |
||
Int32 | step = 1 , |
||
Int32 | tristate = 0 , |
||
Int32 | min2 = LIMIT< Int32 >::MIN , |
||
Int32 | max2 = LIMIT< Int32 >::MAX |
||
) |
Sets the value and limits of integer fields. Also used for tab groups, radio buttons and combo boxes.
[in] | id | The control ID. |
[in] | value | The new value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
Bool SetFloat | ( | const GadgetPtr & | id, |
Float | value, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 , |
||
Int32 | format = FORMAT_FLOAT , |
||
Float | min2 = 0.0 , |
||
Float | max2 = 0.0 , |
||
Bool | quadscale = false , |
||
Int32 | tristate = 0 |
||
) |
Sets the value, unit and limits of float fields.
[in] | id | The control ID. |
[in] | value | The new value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | format | The unit and format of the field: FORMAT_NUMBERS |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
[in] | quadscale | If true a quadratic scale is used for the slider, so that more precision is available for lower values. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Bool SetMeter | ( | const GadgetPtr & | id, |
Float | value, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 , |
||
Int32 | tristate = 0 |
||
) |
Sets the value and limits of a meter field. Same as SetFloat with FORMAT_METER.
[in] | id | The control ID. |
[in] | value | The new value. |
[in] | min | The minimum value accepted. |
[in] | max | The maximum value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Bool SetDegree | ( | const GadgetPtr & | id, |
Float | radians_value, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 , |
||
Int32 | tristate = 0 |
||
) |
Sets the value and limits of an angle field. Same as SetFloat with FORMAT_DEGREE.
[in] | id | The control ID. |
[in] | radians_value | The new angle in radians. |
[in] | min | The minimum angle accepted in degrees. |
[in] | max | The maximum angle accepted in degrees. |
[in] | step | The step used for arrow buttons in degrees. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Bool SetPercent | ( | const GadgetPtr & | id, |
Float | value, | ||
Float | min = 0.0 , |
||
Float | max = 100.0 , |
||
Float | step = 1.0 , |
||
Int32 | tristate = 0 |
||
) |
Sets the value and limits of a percent field. Same as SetFloat with FORMAT_PERCENT.
[in] | id | The control ID. |
[in] | value | The new value (real fraction). |
[in] | min | The minimum value accepted (percentage units). |
[in] | max | The maximum value accepted (percentage units). |
[in] | step | The step used for arrow buttons (percentage units). |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Bool SetTime | ( | const GadgetPtr & | id, |
const BaseDocument * | doc, | ||
const BaseTime & | value, | ||
const BaseTime & | min = BaseTime(- 108000, 1) , |
||
const BaseTime & | max = BaseTime(108000, 1) , |
||
Int32 | stepframes = 1 , |
||
Int32 | tristate = 0 |
||
) |
Sets the value and limits of a time field. Same as SetFloat with FORMAT_FRAMES.
[in] | id | The control ID. |
[in] | doc | The document to be used for framerate calculations. |
[in] | value | The new time value. |
[in] | min | The minimum time accepted. |
[in] | max | The maximum time accepted. |
[in] | stepframes | The frame step used for arrow buttons. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Bool SetString | ( | const GadgetPtr & | id, |
const maxon::String & | text, | ||
Int32 | tristate = 0 , |
||
Int32 | flags = 0 |
||
) |
Sets the text of string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and check boxes.
[in] | id | The control ID. |
[in] | text | The new text. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
[in] | flags | Flags: EDITTEXT FLAG_CENTER_ALIGN |
Bool SetColorField | ( | const GadgetPtr & | id, |
const Vector & | color, | ||
Float | brightness, | ||
Float | maxbrightness, | ||
Int32 | flags | ||
) |
Sets the color, brightness and limits of color fields and color choosers.
[in] | id | The control ID. |
[in] | color | The new color value. |
[in] | brightness | The new brightness value. |
[in] | maxbrightness | The maximum brightness allowed. |
[in] | flags | Controls what parts of a color chooser are available: DR_COLORFIELD |
Sets the text of string controls, taking the new value from a filename.
[in] | id | The control ID. |
[in] | fn | The new filename. |
[in] | tristate | If true the control is tinted to indicate tristate mode. |
Retrieves the state of checkbox controls.
[in] | id | The control ID. |
[out] | value | Assigned the current state. |
Retrieves the value of integer fields. Also used for tab groups, radio buttons and combo boxes.
[in] | id | The control ID. |
[out] | value | Assigned the current value. |
Retrieves the value of float fields.
[in] | id | The control ID. |
[out] | value | Assigned the current value. |
Bool GetVector | ( | const GadgetPtr & | id_x, |
const GadgetPtr & | id_y, | ||
const GadgetPtr & | id_z, | ||
Vector & | value | ||
) | const |
Retrieves the value of three float fields at the same time as a vector.
[in] | id_x | The control ID of the X field. |
[in] | id_y | The control ID of the Y field. |
[in] | id_z | The control ID of the Z field. |
[out] | value | Assigned the current value. |
Bool GetString | ( | const GadgetPtr & | id, |
maxon::String & | text | ||
) | const |
Retrieves the text from string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and check boxes.
[in] | id | The control ID. |
[out] | text | Assigned the current text. |
Retrieves the color and brightness of color controls.
[in] | id | The control ID. |
[out] | color | Assigned the current color. |
[out] | brightness | Assigned the current brightness. |
Bool GetTime | ( | const GadgetPtr & | id, |
const BaseDocument * | doc, | ||
BaseTime & | time | ||
) | const |
Retrieves the time of time fields.
[in] | id | The control ID. |
[in] | doc | The document to use for framerate calculations. |
[out] | time | Assigned the current time. |
Retrieves the text from string controls as a filename.
[in] | id | The control ID. |
[out] | fn | Assigned the current filename. |
Checks if a control content has been changed since the last Set.
[in] | id | The control ID. |
Bool SetBool | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid | ||
) |
Sets the value of checkbox controls, taking the new value from a base container.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
Bool SetInt32 | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Int32 | min = LIMIT< Int32 >::MIN , |
||
Int32 | max = LIMIT< Int32 >::MAX , |
||
Int32 | step = 1 , |
||
Int32 | min2 = LIMIT< Int32 >::MIN , |
||
Int32 | max2 = LIMIT< Int32 >::MAX |
||
) |
Sets the value and limits of integer fields, taking the new value from a base container. Also used for tab groups, radio buttons and combo boxes.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
Bool SetFloat | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 , |
||
Int32 | format = FORMAT_FLOAT , |
||
Float | min2 = 0.0 , |
||
Float | max2 = 0.0 , |
||
Bool | quadscale = false |
||
) |
Sets the value, unit and limits of float fields, taking the new value from a base container.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | format | The unit and format of the field: FORMAT_NUMBERS |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
[in] | quadscale | If true a quadratic scale is used for the slider, so that more precision is available for lower values. |
Bool SetMeter | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 |
||
) |
Sets the value, unit and limits of meter fields, taking the new value from a base container. Same as SetFloat with FORMAT_METER.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | min | The minimum value accepted. |
[in] | max | The maximum value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetDegree | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 |
||
) |
Sets the value, unit and limits of angle fields, taking the new value from a base container. Same as SetFloat with FORMAT_DEGREE.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | min | The minimum value accepted. |
[in] | max | The maximum value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetPercent | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Float | min = 0.0 , |
||
Float | max = 100.0 , |
||
Float | step = 1.0 |
||
) |
Sets the value, unit and limits of percent fields, taking the new value from a base container. Same as SetFloat with FORMAT_PERCENT.
[in] | id | The control ID. |
[in] | bc | The base container with the new value (real fraction). The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | min | The minimum value accepted. |
[in] | max | The maximum value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetTime | ( | const GadgetPtr & | id, |
const BaseDocument * | doc, | ||
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
const BaseTime & | min = BaseTime(- 108000, 1) , |
||
const BaseTime & | max = BaseTime(108000, 1) , |
||
Int32 | stepframes = 1 |
||
) |
Sets the value and limits of a time field, taking the new value from a base container. Same as SetFloat with FORMAT_FRAMES.
[in] | id | The control ID. |
[in] | doc | The document to get the framerate from. The caller owns the pointed document. |
[in] | bc | The base container with the new time. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new time. |
[in] | min | The minimum value accepted. |
[in] | max | The maximum value accepted. |
[in] | stepframes | The frame step used for arrow buttons. |
Bool SetString | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid, | ||
Int32 | flags = 0 |
||
) |
Sets the text of string controls, taking the new value from a base container. Used for all controls that have a text, for example static text fields, edit fields, buttons and check boxes.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
[in] | flags | Flags: EDITTEXT FLAG_CENTER_ALIGN |
Bool SetFilename | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bcid | ||
) |
Sets the text of string controls, taking the new value from a filename in a base container.
[in] | id | The control ID. |
[in] | bc | The base container with the new value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the new value. |
Bool SetColorField | ( | const GadgetPtr & | id, |
const BaseContainer * | bc, | ||
Int32 | bc_colid, | ||
Int32 | bc_brightnessid, | ||
Float | maxbrightness, | ||
Int32 | flags | ||
) |
Sets the color, brightness and limits of color fields and color choosers, taking the new values from a base container.
[in] | id | The control ID. |
[in] | bc | The base container with the new color field values. The caller owns the pointed base container. |
[in] | bc_colid | The container ID of the new color value. |
[in] | bc_brightnessid | The container ID of the new brightness value. |
[in] | maxbrightness | The maximum brightness allowed. |
[in] | flags | Controls what parts of a color chooser are available: DR_COLORFIELD |
Bool GetBool | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the state of checkbox controls, and stores it in a base container.
[in] | id | The control ID. |
[out] | bc | The base container to receive the state. The caller owns the pointed base container. |
[in] | bcid | The container ID of the state. |
Bool GetInt32 | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value of integer fields, and stores it in a base container. Also used for tab groups, radio buttons and combo boxes.
[in] | id | The control ID. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetFloat | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value of float fields, and stores it in a base container.
[in] | id | The control ID. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetTime | ( | const GadgetPtr & | id, |
const BaseDocument * | doc, | ||
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value of a time field, and stores it in a base container.
[in] | id | The control ID. |
[in] | doc | The document to get the framerate from. The caller owns the pointed document. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetVector | ( | const GadgetPtr & | id_x, |
const GadgetPtr & | id_y, | ||
const GadgetPtr & | id_z, | ||
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value of three float fields at the same time as a vector, and stores it in a base container.
[in] | id_x | The control ID of the X field. |
[in] | id_y | The control ID of the Y field. |
[in] | id_z | The control ID of the Z field. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetString | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value from string controls, and stores it in a base container. Used for all controls that have a text, for example static text fields, edit fields, buttons and check boxes.
[in] | id | The control ID. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetFilename | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bcid | ||
) | const |
Retrieves the value from string controls, and stores it as a filename in a base container.
[in] | id | The control ID. |
[out] | bc | The base container to receive the value. The caller owns the pointed base container. |
[in] | bcid | The container ID of the value. |
Bool GetColorField | ( | const GadgetPtr & | id, |
BaseContainer * | bc, | ||
Int32 | bc_colid, | ||
Int32 | bc_brightnessid | ||
) | const |
Retrieves the values of color and brightness for color controls, and stores them in a base container.
[in] | id | The control ID. |
[out] | bc | The base container to receive the values. The caller owns the pointed base container. |
[in] | bc_colid | The container ID of the color value. |
[in] | bc_brightnessid | The container ID of the brightness value. |
Sets the value of checkbox controls using a TriState object.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
Bool SetInt32 | ( | const GadgetPtr & | id, |
const TriState< Int32 > & | tri, | ||
Int32 | min = LIMIT< Int32 >::MIN , |
||
Int32 | max = LIMIT< Int32 >::MAX , |
||
Int32 | step = 1 , |
||
Int32 | min2 = LIMIT< Int32 >::MIN , |
||
Int32 | max2 = LIMIT< Int32 >::MAX |
||
) |
Sets the value and limits of integer fields using a TriState object.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
Bool SetFloat | ( | const GadgetPtr & | id, |
const TriState< Float > & | tri, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 , |
||
Int32 | format = FORMAT_FLOAT , |
||
Float | min2 = 0.0 , |
||
Float | max2 = 0.0 , |
||
Bool | quadscale = false |
||
) |
Sets the value, unit and limits of float fields using a TriState object.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
[in] | format | The unit and format of the field: FORMAT_NUMBERS |
[in] | min2 | The minimum value allowed outside the visual range used for sliders. Overrides min for the acceptance check. |
[in] | max2 | The maximum value allowed outside the visual range used for sliders. Overrides max for the acceptance check. |
[in] | quadscale | If true a quadratic scale is used for the slider, so that more precision is available for lower values. |
Bool SetMeter | ( | const GadgetPtr & | id, |
const TriState< Float > & | tri, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 |
||
) |
Sets the value and limits of a meter field using a TriState object. Same as SetFloat with FORMAT_METER.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetDegree | ( | const GadgetPtr & | id, |
const TriState< Float > & | tri, | ||
Float | min = (-1.0e18) , |
||
Float | max = (1.0e18) , |
||
Float | step = 1.0 |
||
) |
Sets the value and limits of an angle field using a TriState object. Same as SetFloat with FORMAT_DEGREE.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetPercent | ( | const GadgetPtr & | id, |
const TriState< Float > & | tri, | ||
Float | min = 0.0 , |
||
Float | max = 100.0 , |
||
Float | step = 1.0 |
||
) |
Sets the value and limits of a percent field using a TriState object. Same as SetFloat with FORMAT_PERCENT.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum visual value accepted. |
[in] | max | The maximum visual value accepted. |
[in] | step | The step used for arrow buttons. |
Bool SetTime | ( | const GadgetPtr & | id, |
const BaseDocument * | doc, | ||
const TriState< BaseTime > & | tri, | ||
const BaseTime & | min = BaseTime(- 108000, 1) , |
||
const BaseTime & | max = BaseTime(108000, 1) , |
||
Int32 | stepframes = 1 |
||
) |
Sets the value and limits of a time field using a TriState object. Same as SetFloat with FORMAT_FRAMES.
[in] | id | The control ID. |
[in] | doc | The document to be used for framerate calculations. |
[in] | tri | A tristate object for the value. |
[in] | min | The minimum time accepted. |
[in] | max | The maximum time accepted. |
[in] | stepframes | The frame step used for arrow buttons. |
Sets the text of string controls using a TriState object.
[in] | id | The control ID. |
[in] | tri | A tristate object for the value. |
[in] | flags | Flags: EDITTEXT FLAG_CENTER_ALIGN |
Transforms local coordinates (relative to the top left corner of the user area) to global window coordinates (relative to the top left corner of the application window). Stores the result in *x and *y.
[in,out] | x | The local X coordinate. Assigned the global window coordinate. |
[in,out] | y | The local Y coordinate. Assigned the global window coordinate. |
Transforms global window coordinates (relative to the top left corner of the application window) to local coordinates (relative to the top left corner of the user area). Stores the result in *x and *y.
[in,out] | x | The global window X coordinate. Assigned the local coordinate. |
[in,out] | y | The global window Y coordinate. Assigned the local coordinate. |
Transforms screen coordinates (relative to the top left corner of the system screen) to local coordinates (relative to the top left corner of the user area). Stores the result in *x and *y.
[in,out] | x | The screen X coordinate. Assigned the local coordinate. |
[in,out] | y | The screen Y coordinate. Assigned the local coordinate. |
Transforms local coordinates (relative to the top left corner of the user area) to screen coordinates (relative to the top left corner of the system screen). Stores the result in *x and *y.
[in,out] | x | The local X coordinate. Assigned the screen coordinate. |
[in,out] | y | The local Y coordinate. Assigned the screen coordinate. |
Gets the RGB values associated with a color constant.
[in] | colorid | A color constant: COLOR |
[out] | r | Assigned the red component of the color. |
[out] | g | Assigned the green component of the color. |
[out] | b | Assigned the blue component of the color. |
Sets the default color for GUI elements.
[in] | id | The control ID to set the color for. |
[in] | colorid | A color constant: COLOR |
[in] | mapid | The color map ID. |
Sets the default color for GUI elements.
[in] | id | The control ID to set the color for. |
[in] | colorid | A color constant: COLOR |
[in] | color | The color to set. |
Bool LoadDialogResource | ( | Int32 | id, |
GeResource * | lr, | ||
Int32 | flags | ||
) |
Loads an external resource file.
This is the preferred method for dialog layout since it gives maximum flexibility and easy multi language support.
[in] | id | The dialog ID. |
[in] | lr | The loaded resource or nullptr. If this is nullptr then the global ::resource singleton is used. The caller owns the pointed resource. |
[in] | flags | The layout flags: BFH BFV |
C4DGadget* AddCheckbox | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw, | ||
Int32 | inith, | ||
const maxon::String & | name | ||
) |
Adds a checkbox to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | name | The name of the checkbox. |
C4DGadget* AddButton | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw, | ||
Int32 | inith, | ||
const maxon::String & | name | ||
) |
Adds a button to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | name | The name of the button. |
C4DGadget* AddStaticText | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw, | ||
Int32 | inith, | ||
const maxon::String & | name, | ||
Int32 | borderstyle | ||
) |
Adds a static text to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | name | The name of the static text. |
[in] | borderstyle | The border style: BORDER |
Adds an arrow button to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | arrowtype | The arrow type: ARROW |
C4DGadget* AddEditText | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Int32 | editflags = 0 |
||
) |
Adds an editable text field to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | editflags | The edit flags: EDITTEXT |
C4DGadget* AddMultiLineEditText | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Int32 | style = 0 |
||
) |
Adds an editable text field with multiple lines to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | style | The style flags: DR_MULTILINE |
Adds an editable number field to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Adds an editable number field with up/down arrows to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Adds a slider with an editable number field to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Adds a slider to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
C4DGadget* AddColorField | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Int32 | colorflags = 0 |
||
) |
Adds a simple color field without sliders to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | colorflags | The color flags: DR_COLORFIELD |
C4DGadget* AddColorChooser | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Int32 | layoutflags = 0 , |
||
const BaseContainer & | settings = BaseContainer() |
||
) |
Adds a color chooser gadget to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | layoutflags | The color flags: DR_COLORFIELD |
[in] | settings | @markPrivate{The color chooser settings.} Since R17 |
C4DGadget* AddRadioButton | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw, | ||
Int32 | inith, | ||
const maxon::String & | name | ||
) |
Adds a radio button to the layout. Used with radio groups created with AddRadioGroup().
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | name | The name of the radio button. |
C4DGadget* AddRadioText | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw, | ||
Int32 | inith, | ||
const maxon::String & | name | ||
) |
Adds a text radio button to the layout (like the ones to the left in the Material Editor). Used with radio groups created with AddRadioGroup().
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | name | The name of the text radio button. |
C4DGadget* AddEditShortcut | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Int32 | shortcutflags = 0 |
||
) |
Adds a field for editing shortcuts.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | shortcutflags | The shortcut flags. |
Adds a horizontal separator to the layout.
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | flags | The layout flags: BFH BFV |
Adds a vertical separator to the layout.
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | flags | The layout flags: BFH BFV |
Adds a radio group to the layout. To add items to the radio button group use the AddChild() function.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | columns | The number of columns, or 0 if rows is used. |
[in] | rows | The number of rows, or 0 if columns is used. |
C4DGadget* AddComboBox | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Bool | specialalign = false , |
||
Bool | allowFiltering = false |
||
) |
Adds a combo box to the layout. To add items to the combo box menu use the AddChild() function.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | specialalign | Used to quantize the width of the combo box. If this is true then the width of the combo box will be a multiple of initw. For example if initw is 60px and specialalign is true the width will be 60, 120, 180px and so on. |
[in] | allowFiltering | True to allow keyboard filtering of the combobox list. |
C4DGadget* AddComboButton | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Bool | specialalign = false , |
||
Bool | allowFiltering = false |
||
) |
Adds a combo button to the layout. To add items to the combo box menu use the AddChild() function.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | specialalign | Used to quantize the width of the item. If this is true then the width of the item will be a multiple of initw. For example if initw is 60px and specialalign is true the width will be 60, 120, 180px and so on. |
[in] | allowFiltering | True to allow keyboard filtering of the popup list. |
C4DGadget* AddPopupButton | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 , |
||
Bool | allowFiltering = false |
||
) |
Adds a popup button to the layout. To add items to the popup menu use the AddChild() function or SetPopup().
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
[in] | allowFiltering | True to allow keyboard filtering of the popup list. |
Adds a list view to the layout.
[in] | id | The control ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Bool AddChild | ( | const GadgetPtr & | id, |
Int32 | subid, | ||
const maxon::String & | child | ||
) |
Adds items to combo boxes or popup buttons. The dialog resource equivalent is CHILDS
.
[in] | id | The control ID. |
[in] | subid | The ID of the item to add. |
[in] | child | The name of the item to add. |
Clears the item list of combo boxes and popup buttons.
[in] | id | The control ID. |
Bool SetPopup | ( | const GadgetPtr & | id, |
const BaseContainer & | bc | ||
) |
Sets the item list of a popup button using a popup menu base container.
This allow things like sub-menus and separators. See ShowPopupMenu() for more information.
[in] | id | The popup button ID. |
[in] | bc | A base container with menu items. |
Bool AddChildren | ( | const GadgetPtr & | id, |
const BaseContainer & | bc | ||
) |
Adds children to a dialog element using a base container.
[in] | id | The element to add children to. |
[in] | bc | A base container with items. |
Adds a user area to the layout. Use AttachUserArea() to assign a GeUserArea object to the user area control.
[in] | id | The user area ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Bool AttachUserArea | ( | GeUserArea & | ua, |
const GadgetPtr & | id, | ||
USERAREAFLAGS | userareaflags = USERAREAFLAGS::COREMESSAGE |
||
) |
Attaches a GeUserArea object to a user area control, added with AddUserArea().
The object will handle all messages to the user area and is responsible for painting the user area.
[in] | ua | A user area object to attach. |
[in] | id | The user area ID. |
[in] | userareaflags | The user area flags: USERAREAFLAGS |
Adds a sub-dialog to the layout. Use AttachSubDialog() to assign a SubDialog object to the sub-dialog control.
[in] | id | The sub-dialog ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | initw | The initial width. Use SizePixChr() to set this value. |
[in] | inith | The initial height. Use SizePixChr() to set this value. |
Attaches a SubDialog derived object to a SubDialog control, added with AddSubDialog().
To replace the sub-dialog with another one, just call this function again.
[in] | userdlg | The sub-dialog object. The caller owns the pointed sub-dialog. |
[in] | id | The sub-dialog ID. |
Adds a dialog group with standard buttons to the layout.
[in] | type | The standard buttons to add: DLG |
Bool GroupBeginInMenuLine | ( | ) |
Begins a group in the menu bar of the dialog. End the group with GroupEnd().
Begins a tab group. Add tabs to the tab group with GroupBegin(). End the tab group with GroupEnd().
[in] | id | The ID of the tab group. |
[in] | flags | The layout flags: BFH BFV |
[in] | tabtype | The tab type: TAB |
Bool GroupBegin | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | cols, | ||
Int32 | rows, | ||
const maxon::String & | title, | ||
Int32 | groupflags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 |
||
) |
Begins a group. End the group with GroupEnd().
[in] | id | The ID of the group. |
[in] | flags | The layout flags: BFH BFV |
[in] | cols | The number of columns, or 0 if rows are used. |
[in] | rows | The number of rows, or 0 if cols are used. |
[in] | title | The title of the the group. Used for tab groups and groups with border. |
[in] | groupflags | The group flags: BFV_GROUP |
[in] | initw | The initial width. |
[in] | inith | The initial height. |
Bool GroupEnd | ( | void | ) |
Ends groups begun with GroupBegin(), TabGroupBegin() and ScrollGroupBegin().
Sets the space in pixels between two elements in the current group. Equivalent to SPACE
in dialog resources.
[in] | spacex | The X distance. |
[in] | spacey | The Y distance. |
Sets the border type of the current group, and displays the title in the border if possible.
Equivalent to BORDERSTYLE
in dialog resources, if a NAME
field is provided with the GROUP declaration.
[in] | borderstyle | The border style: BORDER |
Sets the border size around the current group in pixels. Equivalent to BORDERSIZE
in dialog resources.
[in] | left | The distance to the left of the group. |
[in] | top | The distance above the group. |
[in] | right | The distance to the right of the group. |
[in] | bottom | The distance below the group. |
Bool GroupWeightsSave | ( | const GadgetPtr & | id, |
BaseContainer & | weights | ||
) |
Retrieves group weights for group id.
[in] | id | The ID of the group. |
[out] | weights | Filled with the weights: GROUPWEIGHTS_PERCENT |
Bool GroupWeightsLoad | ( | const GadgetPtr & | id, |
const BaseContainer & | weights | ||
) |
Sets group weights for group id.
The group weights are usually absolute values. If an element has a bigger minimum size the given weight will be ignored. The sum of the weights do not need to be 100.
[in] | id | The ID of the group. |
[in] | weights | The weights to set: GROUPWEIGHTS_PERCENT |
Queries a dialog control for its current size and position in pixels.
[in] | id | The control ID. Use C4DGUIWINDOWID to get the pos/size of the window. |
[out] | x | Assigned the X coordinate of the upper left corner of the control. |
[out] | y | Assigned the Y coordinate of the upper left corner of the control. |
[out] | w | Assigned the width of the control. |
[out] | h | Assigned the height of the control. |
Bool GetDragPosition | ( | const BaseContainer & | msg, |
Int32 * | x, | ||
Int32 * | y | ||
) |
Extracts local drag coordinates from a drag and drop event. Stores the result in *x and *y.
[in] | msg | The original message. |
[out] | x | Assigned the local X position. |
[out] | y | Assigned the local Y position. |
Bool GetDragObject | ( | const BaseContainer & | msg, |
Int32 * | type, | ||
void ** | object | ||
) |
Extracts the object from a drag and drop message. Stores the result in *type and *object.
[in] | msg | The original message. |
[out] | type | Assigned the type of the object. |
[out] | object | Assigned a pointer to the object. Cinema 4D owns the pointed object. |
Sets the correct cursor during drag and drop handling.
[in] | cursor | A mouse cursor: MOUSE |
[in] | gadgetid | The dialog element that this cursor is for, or 0. |
Bool CheckDropArea | ( | const GadgetPtr & | id, |
const BaseContainer & | msg, | ||
Bool | horiz, | ||
Bool | vert | ||
) |
Checks the drag position in a drag event message against a certain dialog element's position in the layout. The check can be limited to only X or Y coordinates.
[in] | id | The dialog element ID. |
[in] | msg | The drag message. |
[in] | horiz | If true the drag position is checked against the horizontal bounds of the region. |
[in] | vert | If true the drag position is checked against the vertical bounds of the region. |
Queries a scroll group for its currently visible region, a rectangle between (x1,y1) and (x2,y2).
[in] | scrollgroupid | The scroll group ID. |
[out] | x1 | Assigned the X coordinate of the top left visible corner. |
[out] | y1 | Assigned the Y coordinate of the top left visible corner. |
[out] | x2 | Assigned the X coordinate of the bottom right visible corner. |
[out] | y2 | Assigned the Y coordinate of the bottom right visible corner. |
Scrolls a scroll group so that the rectangle between (x1,y1) and (x2,y2) is visible.
[in] | scrollgroupid | The scroll group ID. |
[in] | x1 | The X coordinate of the top left corner of the rectangle. |
[in] | y1 | The Y coordinate of the top left corner of the rectangle. |
[in] | x2 | The X coordinate of the bottom right corner of the rectangle. |
[in] | y2 | The Y coordinate of the bottom right corner of the rectangle. |
Bool ScrollGroupBegin | ( | Int32 | id, |
Int32 | flags, | ||
Int32 | scrollflags, | ||
Int32 | initw = 0 , |
||
Int32 | inith = 0 |
||
) |
Begins a scrollable group. End the scroll group with GroupEnd().
Use SetVisibleArea() and GetVisibleArea() to control the currently visible area.
[in] | id | The scroll group ID. |
[in] | flags | The layout flags: BFH BFV |
[in] | scrollflags | Additional flags for the scroll group: SCROLLGROUP |
[in] | initw | The initial width of the scroll area. |
[in] | inith | The initial height of the scroll area. |
Notifies Cinema 4D that the layout of a dynamic group in the dialog has changed.
This is usually done by first calling LayoutFlushGroup() and then adding new controls.
[in] | id | The ID of the changed group. |
Notifies Cinema 4D that the layout of a dynamic group in the dialog has changed.
This is usually done by first calling LayoutFlushGroup() and then adding new controls.
[in] | id | The ID of the changed group. |
Sets the focus to a specific control within the dialog.
[in] | id | The control ID. |
Checks if the given gadget has the focus.
[in] | id | The control ID. |
UpdateDialogHelper BeginLayoutChange | ( | const GadgetPtr & | gadget, |
Bool | disableRedraws, | ||
Bool | doNotFlush = false |
||
) |
BeginLayoutChange simplifies the call of the combinations of LayoutFlushGroup()/LayoutChanged().
[in] | gadget | Gadget to flush and re-layout. |
[in] | disableRedraws | True if all redraws should be disabled while the result object lives and result.CommitChanges() wasn't called. |
[in] | doNotFlush | If true, existing elements persist and new elements are added at the end. |
Removes all controls from a group and places the control insertion point within the group. This makes it possible to have dynamic groups.
After all components are added call LayoutChanged() with the group ID.
[in] | id | The ID of the group. |
LayoutFlushDisableRedraw description. Warning. For each calls of LayoutFlushDisableRedraw(true) you must call LayoutFlushDisableRedraw(false)!
[in] | id | The ID of the group. |
[in] | disable | True to disable redraw. Don't forget to enable it. Best use a finally{} to enable it again. |
Removes an element from the dialog.
[in] | id | The control ID. |
Hides/unhides an element within a dialog.
[in] | id | The control ID. |
[in] | hide | true to hide and false to unhide. |
Used to restore an asynchronous dialog that has been placed in the users layout.
[in] | pluginid | The plugin ID of the command plugin. |
[in] | subid | The sub-ID of the dialog. |
[in] | secret | An internal pointer. |
Bool MenuFlushAll | ( | void | ) |
Flushes the menu bar of the dialog, removing all menus.
Add menus with MenuSubBegin(). Call MenuFinished() when all menus and items have been added.
Bool MenuSubBegin | ( | const maxon::String & | string | ) |
Creates a new menu group. At the top level this means a menu, at lower levels a sub-menu. Add items with MenuAddCommand(), MenuAddString() or MenuAddSeparator(). Call MenuSubEnd() when the menu is finished.
[in] | string | The name of the sub menu. |
Bool MenuSubEnd | ( | void | ) |
Closes the current menu group, opened with MenuSubBegin().
Adds a command item to the current menu.
This can either be a Cinema 4D command or a plugin command. Particularly useful is IDM_CM_CLOSEWINDOW to add a close item for dialogs.
[in] | cmdid | A Cinema 4D command id or a plugin ID. |
Bool MenuAddString | ( | Int32 | id, |
const maxon::String & | string | ||
) |
Adds a string item to the current menu. Command() will be called when the menu item is selected.
[in] | id | The item ID. |
[in] | string | The item text. Use a d suffix for disabled and a c suffix for checked items. |
Bool MenuAddSeparator | ( | const maxon::String & | title = maxon::String() | ) |
Adds a separator to the current menu.
[in] | title | Optional separator title. |
Bool MenuFinished | ( | void | ) |
Call this function when all menus and all items have been added.
Used to change the enabled/disabled and checked/unchecked state of menu items.
[in] | id | The menu item ID. |
[in] | enabled | true if the menu item is enabled or false if the menu item is disabled (grayed out). |
[in] | checked | true if the menu item should be checked, otherwise false. |
Sets the menu from a MENU resource ID.
[in] | id | The menu resource ID. |
Gets the custom GUI for a certain element ID. The GUI object must have been previously added with AddCustomGui().
[in] | id | The custom GUI element ID. |
[in] | pluginid | The plugin ID of the custom GUI. |
T* FindCustomGui | ( | Int32 | id | ) |
Gets the custom GUI for a certain element ID. The GUI object must have been previously added with AddCustomGui().
[in] | id | The custom GUI element ID. |
void* AddCustomGui | ( | Int32 | id, |
Int32 | pluginid, | ||
const maxon::String & | name, | ||
Int32 | flags, | ||
Int32 | minw, | ||
Int32 | minh, | ||
const BaseContainer & | customdata | ||
) |
Adds a custom GUI element to the dialog.
[in] | id | The dialog element ID of the new custom GUI. |
[in] | pluginid | The plugin ID of the custom GUI. |
[in] | name | The name of the added custom GUI. (Not necessarily used.) |
[in] | flags | The layout flags: BFH BFV |
[in] | minw | The minimum width. |
[in] | minh | The minimum height. |
[in] | customdata | The settings for the new custom GUI. |
T* AddCustomGui | ( | Int32 | id, |
const maxon::String & | name, | ||
Int32 | flags, | ||
Int32 | minw, | ||
Int32 | minh, | ||
const BaseContainer & | customdata | ||
) |
Adds a custom GUI element to the dialog.
[in] | id | The dialog element ID of the new custom GUI. |
[in] | name | The name of the added custom GUI. (Not necessarily used.) |
[in] | flags | The layout flags: BFH BFV |
[in] | minw | The minimum width. |
[in] | minh | The minimum height. |
[in] | customdata | The settings for the new custom GUI. |
Bool SetMultiLineMode | ( | const GadgetPtr & | id, |
SCRIPTMODE | mode | ||
) |
Sets the edit mode for multi-line edit fields.
[in] | id | The control ID. |
[in] | mode | The multi-line edit mode: SCRIPTMODE |
Locks/unlocks multi-line edit fields.
[in] | id | The control ID. |
[in] | lock | true to lock the field, formatConstant{false} to unlock it. |
Sets the cursor position within a multi-line edit text control.
[in] | id | The control ID. |
[in] | line | The line number. |
[in] | pos | The position within the line. |
Bool CheckClose | ( | void | ) |
Checks if the dialog can be closed. Normally checks the value ranges and calls AskClose().
Bool CheckValueRanges | ( | void | ) |
Checks whether all input fields' values are within the allowed range.
Float GetPixelRatio | ( | ) | const |
Private. Always returns 1.0 except for user areas shown on OS X Retina displays, where it returns 2.0.
Bool ReleaseLink | ( | ) |
Internal.
Bool CheckCoreMessage | ( | const BaseContainer & | msg, |
Int32 * | ownlastcoremsg = nullptr |
||
) |
Speedup function that checks if a core message is new or has been already processed.
[in] | msg | The core message. |
[in] | ownlastcoremsg | An optional pointer to a last core message. |
|
static |
Private.
void* GetWindowHandle | ( | ) |
Gets the handle of the dialog window (HWND). Private.
void* GetWindowInterface | ( | ) |
Private.
|
static |
Private.
Bool GetFolding | ( | void | ) |
Retrieve if the dialog is open but currently folded away in the layout.
void SetFolding | ( | Bool | allowClose | ) |
Fold the dialog away in the layout.
[in] | allowClose | True if the dialog should fold away. |
Int32 IsDockedOrTabbed | ( | ) |
Returns the docking state of the dialog.
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
protected |
true if the layout has been created, otherwise false. Normally not needed.