This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com

c4d.gui.GeDialog – a dialog class

A dialog is a window or a panel, in which buttons, edit boxes, icons, images, and other things are put upon. These buttons, sliders, icons, etc are called widgets. Dialogs act as interfaces for a plugin. You are able to customize or derive a dialog box that will act as an interface for your plugin. Most dialog boxes are derived off of GeDialog class.

The reason you care about dialogs is that you want anyone to be able to use your plugin, and you want it to be easier to use. Plus it is a lot cooler when you have tons of widgets to play with. There is no other (easy) interactive way for you to interface with the user than with a dialog.

The class to create custom dialogs.

class c4d.gui.GeDialog

//Methods to override

//Basic methods

//Input events

// Setter

// Getter

Still private

  • GeDialog.AddSplineGui()
  • GeDialog.AddGradientGui()
  • GeDialog.AddTreeViewGui()
  • GeDialog.AddHtmlViewerGui()

SubClass

SubDialog

Methods

GeDialog.CreateLayout(self)

Override - Called when C4D is about to display the dialog.

Return type:bool
Returns:True if successful, or False to signalize an error.
GeDialog.Message(self, msg, result)

Override - Use to react to more messages..

Parameters:
  • msg (BaseContainer) – The message container.
  • result (BaseContainer) – A container to store results in.
Return type:

int

Returns:

The return value depends on the message.

GeDialog.InitValues(self)

Called when the dialog is initialized by the GUI.

Return type:bool
Returns:True if successful, or False to signalize an error.
GeDialog.CoreMessage(self, id, msg)

Override this function if you want to react to C4D core messages. The original message is stored in msg.

Parameters:
  • id – The message id.
  • id (int) – The message container
Return type:

bool

Returns:

Currently not used - but you have to return a bool value.

GeDialog.AskClose(self)

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 occured. If you return False everything will be as usual, but if you return True the dialog won’t close. T

Warning

Please pay attention to the result value. True means, it will not close.

Return type:bool
Returns:True if the dialog shouldn’t be closed, False if it should.
GeDialog.Timer(self, msg)

If you subscribe to timer events using SetTimer(x), this function is called every x’th millisecond.

Parameter:msg (BaseContainer) – The raw timer message.
GeDialog.DestroyWindow(self)
Override this method - this function is called when the dialog is about to be closed temporarily, for example for layout switching.
GeDialog.Open(async[, pluginid, xpos=-1, ypos=-1, width=0, height=0, subid=0])

Opens a dialog.

Parameters:
  • async (bool) –

    If True the dialog os opened asynchronous. Don’t set True in scripts.

    Note

    If you use a mac and this flag is set to False there will be no exit buttons on the left top corner. To close the windows, just press Alt + ESC.

  • pluginid (int) – The plugin ID of c4d.plugins.CommandData.
  • xpos (int) – The Y position of the dialog or -1.
  • ypos (int) – The Y position of the dialog or -1.
  • defaultw (int) – The default width in pixels, or 0.
  • defaulth (int) – The default height in pixels, or 0.
  • subid (int) – The dialog sub ID.
Return type:

bool

Returns:

True if successfully opened, otherwise False.

GeDialog.Restore(pluginid, secret)

Used to restore an asynchronous dialog that has been placed in the users layout. Just use this method in CommandData.RestoreLayout().

Parameters:
Return type:

bool

Returns:

True if successfully restored, otherwise False.

GeDialog.GetInputState(askdevice, askchannel)

Polls a certain channel of a device for the current input state.

Parameter:askdevice (The channel of the device.) – The device to ask.
Return type:BaseContainer
Returns:The result is this container or None.
GeDialog.GetInputEvent(askdevice)

Gets the next input event for a certain device from the event queue.

Parameter:askdevice (int) – The device to poll.
Return type:BaseContainer
Returns:The result is this container or None.
GeDialog.KillEvents()
Flushes all events from the window message queue. For example if you loop while the mouse is down (polling) you can call this command to flush all keydowns/mouseclicks that are made during the loop.
GeDialog.Local2Global()

Transforms local coordinates (relative to the top left corner of the dialog) to global coordinates (relative to the top left corner of the physical window). Result is a dict with member keys x and y of type int.

Return type:dict
Returns:The converted coordinates or None.
GeDialog.Global2Local()

Transforms global coordinates (relative to the top left corner of the physical window) to local coordinates (relative to the top left corner of the dialog). Result is a dict with member keys x and y of type int.

Return type:dict
Returns:The converted coordinates or None.
GeDialog.Local2Screen()

Transforms local coordinates (relative to the top left corner of the dialog) to screen coordinates (relative to the top left corner of the system screen). Result is a dict with member keys x and y of type int.

Return type:dict
Returns:The converted coordinates or None.
GeDialog.Screen2Local()

Transforms screen coordinates (relative to the top left corner of the system screen) to local coordinates (relative to the top left corner of the dialog). Result is a dict with member keys x and y of type int.

Return type:dict
Returns:The converted coordinates or None.
GeDialog.SetDefaultColor(id, colorid, color)

Set The default color for GUI elements.

Parameters:
  • id (C4DGadget or int) – The control ID to set the color for.
  • colorid (int) –

    The color value.

    COLOR_3DTEXT  
    COLOR_XOR  
    COLOR_TRANS  
    COLOR_BG  
    COLOR_BGEDIT  
    COLOR_BGFOCUS  
    COLOR_TEXT  
    COLOR_TEXTFOCUS  
    COLOR_EDGELT  
    COLOR_EDGEWH  
    COLOR_EDGEDK  
    COLOR_EDGEBL  
    COLOR_DBARFG1  
    COLOR_DBARBG1  
    COLOR_DBARFG2  
    COLOR_DBARBG2  
    COLOR_BGGADGET  
    COLOR_BGSELECTEDTEXT  
    COLOR_FGSELECTEDTEXT  
    COLOR_TIMELINE  
    COLOR_BGTRISTATE  
    COLOR_BG_DARK1  
    COLOR_BG_DARK2  
    COLOR_EMBOSS_WH  
    COLOR_EMBOSS_DK  
    COLOR_TIMELINE_BG  
    COLOR_TIMELINE_BG_DARK  
    COLOR_TIMELINE_TEXT  
    COLOR_TIMELINE_TEXT_SELECTED  
    COLOR_TIMELINE_TEXT_SELECTED2  
    COLOR_TIMELINE_LINES  
    COLOR_TIMELINE_LINES_SEL  
    COLOR_TIMELINE_LINES_SEPARATOR1  
    COLOR_TIMELINE_LINES_SEPARATOR2  
    COLOR_TIMELINE_TREE  
    COLOR_TIMELINE_LOOP  
    COLOR_TIMELINE_SELECTION  
    COLOR_TIMELINE_TICKS1  
    COLOR_TIMELINE_TICKS2  
    COLOR_TIMELINESCROLLER_MINMAX  
    COLOR_TIMELINESCROLLER_CURRENT  
    COLOR_BROWSER_LINES_SELECTED  
    COLOR_FCURVE_BG  
    COLOR_FCURVE_TEXT  
    COLOR_FCURVE_LINES  
    COLOR_FCURVE_MAINGRID  
    COLOR_FCURVE_SUBGRID  
    COLOR_FCURVE_LLTGRAY  
    COLOR_FCURVE_GRAY1  
    COLOR_FCURVE_GRAY2  
    COLOR_FCURVE_GRAY3  
    COLOR_FCURVE_POINTSELECTED  
    COLOR_MATERIALMANAGER_BG  
    COLOR_MATERIALMANAGER_TEXT  
    COLOR_MATERIALMANAGER_TEXT_SELECTED  
    COLOR_MATERIALMANAGER_SELECTED  
    COLOR_OBJECTMANAGER_BG  
    COLOR_OBJECTMANAGER_ACTIVECAMERA  
    COLOR_OBJECTMANAGER_INACTIVECAMERA  
    COLOR_OBJECTMANAGER_TEXT  
    COLOR_OBJECTMANAGER_TEXT_ACTIVE  
    COLOR_OBJECTMANAGER_TEXT_ACTIVE2  
    COLOR_OBJECTMANAGER_SELECTEDTAG  
    COLOR_OBJECTMANAGER_TREE  
    COLOR_SPREADSHEET_BG  
    COLOR_SPREADSHEET_TEXT  
    COLOR_SPREADSHEET_EDITBG  
    COLOR_SPREADSHEET_EDITTEXT  
    COLOR_SPREADSHEET_SELECTED  
    COLOR_CONSOLE_BG  
    COLOR_CONSOLE_TEXT  
    COLOR_PAINTER_SELECTED  
    COLOR_PAINTER_TREE  
    COLOR_SYNTAX_COFFEE  
    COLOR_SYNTAX_INCLUDE  
    COLOR_SYNTAX_COMMENT  
    COLOR_SYNTAX_COMMENTWRONG  
    COLOR_SYNTAX_STRING  
    COLOR_TEXT_SELECTED  
    COLOR_TEXT_SELECTED_DARK  
    COLOR_TEXT_DISABLED  
    COLOR_TEXT_EDIT  
    COLOR_TEXT_EDIT_DISABLED  
    COLOR_TEXT_MENU  
    COLOR_TEXT_MENU_DISABLED  
    COLOR_TEXT_TAB  
    COLOR_TEXT_TAB_DISABLED  
    COLOR_TEXT_BUTTON  
    COLOR_TEXT_BUTTON_DISABLED  
    COLOR_TEXT_COMBO  
    COLOR_TEXT_COMBO_DISABLED  
    COLOR_MENU_BG  
    COLOR_MENU_BG_SELECTED  
    COLOR_MENU_TEXT  
    COLOR_MENU_TEXT_DISABLED  
    COLOR_MENU_TEXT_SELECTED  
    COLOR_MENU_BORDER_WH  
    COLOR_MENU_BORDER_DK  
    COLOR_TIMELINE_LAYER0  
    COLOR_TIMELINE_LAYER1  
    COLOR_TIMELINE_LAYER2  
    COLOR_TIMELINE_LAYER3  
    COLOR_TIMELINE_LAYER4  
    COLOR_TIMELINE_LAYER5  
    COLOR_TIMELINE_LAYER6  
    COLOR_TIMELINE_LAYER7  
    COLOR_BG_MM_E_ACTIVE_TEXTURE  
    COLOR_FG_MM_E_ACTIVE_TEXTURE  
    COLOR_BG_MM_E_INACTIVE_TEXTURE  
    COLOR_FG_MM_E_INACTIVE_TEXTURE  
    COLOR_BG_MM_E_SELECTED_LAYER  
    COLOR_FG_MM_E_SELECTED_LAYER  
    COLOR_BG_MM_E_ACTIVE_LAYER  
    COLOR_FG_MM_E_ACTIVE_LAYER  
    COLOR_BG_MM_E_INACTIVE_LAYER  
    COLOR_FG_MM_E_INACTIVE_LAYER  
    COLOR_BG_TEXTUREVIEW  
    COLOR_OBJECTMANAGER_TEXT_ACTIVE3  
    COLOR_SYNTAX_CONSTANT  
    COLOR_SYNTAX_FUNCTION  
    COLOR_SYNTAX_CLASS  
    COLOR_SYNTAX_MEMBER  
    COLOR_CTIMELINE_GRID  
    COLOR_CTIMELINE_POSITION  
    COLOR_CTIMELINE_ROTATION  
    COLOR_CTIMELINE_SCALE  
    COLOR_CTIMELINE_PLA  
    COLOR_CTIMELINE_COLOR  
    COLOR_CTIMELINE_GENERAL  
    COLOR_CTIMELINE_MASTER  
    COLOR_CTIMELINE_MASTERIDENTICAL  
    COLOR_CTIMELINE_CURRENTFRAME  
    COLOR_CTIMELINE_PREVIEW  
    COLOR_CTIMELINE_BREAKDOWN  
    COLOR_CTIMELINE_HLECURVE  
    COLOR_DBARBG3  
    COLOR_CONTENTBROWSER_TEXT  
    COLOR_CONTENTBROWSER_BG_TEXT_ACT  
    COLOR_CONTENTBROWSER_BG_TEXT_INACT  
    COLOR_CONTENTBROWSER_FG_TEXT_ACT  
    COLOR_CONTENTBROWSER_FG_TEXT_INACT  
    COLOR_CONTENTBROWSER_NOTAVAILABLE  
    COLOR_BG_GROUP1  
    COLOR_BG_GROUP2  
    COLOR_POWERSOUND  
    COLOR_BG_GROUPBAR1  
    COLOR_BG_GROUPBAR2  
    COLOR_CTIMELINE_CLIPTEXT  
    COLOR_CTIMELINE_CLIP  
    COLOR_CTIMELINE_CLIPMASTER  
    COLOR_BUBBLE_BG  
    COLOR_BUBBLE_FG  
    COLOR_BUBBLE_BORDER  
    COLOR_CTIMELINE_CLIPTEXTHL  
    COLOR_TRACK_X  
    COLOR_TRACK_Y  
    COLOR_TRACK_Z  
    COLOR_TRACK_S  
    COLOR_AM_ANIMDOT  
    COLOR_AM_ANIMDOT_CHANGED  
    COLOR_AM_BPDOT  
    COLOR_PV_BUCKET  
    COLOR_PV_TEXT  
    COLOR_PV_CACHE  
    COLOR_PV_NOTALL  
    COLOR_PV_COMPARE  
    COLOR_PV_FPS  
  • color (Vector) – The color.
GeDialog.GetColorRGB(colorid)

Gets the RGB values associated with a color code.

Parameter:colorid (int) –

The color value.

COLOR_3DTEXT  
COLOR_XOR  
COLOR_TRANS  
COLOR_BG  
COLOR_BGEDIT  
COLOR_BGFOCUS  
COLOR_TEXT  
COLOR_TEXTFOCUS  
COLOR_EDGELT  
COLOR_EDGEWH  
COLOR_EDGEDK  
COLOR_EDGEBL  
COLOR_DBARFG1  
COLOR_DBARBG1  
COLOR_DBARFG2  
COLOR_DBARBG2  
COLOR_BGGADGET  
COLOR_BGSELECTEDTEXT  
COLOR_FGSELECTEDTEXT  
COLOR_TIMELINE  
COLOR_BGTRISTATE  
COLOR_BG_DARK1  
COLOR_BG_DARK2  
COLOR_EMBOSS_WH  
COLOR_EMBOSS_DK  
COLOR_TIMELINE_BG  
COLOR_TIMELINE_BG_DARK  
COLOR_TIMELINE_TEXT  
COLOR_TIMELINE_TEXT_SELECTED  
COLOR_TIMELINE_TEXT_SELECTED2  
COLOR_TIMELINE_LINES  
COLOR_TIMELINE_LINES_SEL  
COLOR_TIMELINE_LINES_SEPARATOR1  
COLOR_TIMELINE_LINES_SEPARATOR2  
COLOR_TIMELINE_TREE  
COLOR_TIMELINE_LOOP  
COLOR_TIMELINE_SELECTION  
COLOR_TIMELINE_TICKS1  
COLOR_TIMELINE_TICKS2  
COLOR_TIMELINESCROLLER_MINMAX  
COLOR_TIMELINESCROLLER_CURRENT  
COLOR_BROWSER_LINES_SELECTED  
COLOR_FCURVE_BG  
COLOR_FCURVE_TEXT  
COLOR_FCURVE_LINES  
COLOR_FCURVE_MAINGRID  
COLOR_FCURVE_SUBGRID  
COLOR_FCURVE_LLTGRAY  
COLOR_FCURVE_GRAY1  
COLOR_FCURVE_GRAY2  
COLOR_FCURVE_GRAY3  
COLOR_FCURVE_POINTSELECTED  
COLOR_MATERIALMANAGER_BG  
COLOR_MATERIALMANAGER_TEXT  
COLOR_MATERIALMANAGER_TEXT_SELECTED  
COLOR_MATERIALMANAGER_SELECTED  
COLOR_OBJECTMANAGER_BG  
COLOR_OBJECTMANAGER_ACTIVECAMERA  
COLOR_OBJECTMANAGER_INACTIVECAMERA  
COLOR_OBJECTMANAGER_TEXT  
COLOR_OBJECTMANAGER_TEXT_ACTIVE  
COLOR_OBJECTMANAGER_TEXT_ACTIVE2  
COLOR_OBJECTMANAGER_SELECTEDTAG  
COLOR_OBJECTMANAGER_TREE  
COLOR_SPREADSHEET_BG  
COLOR_SPREADSHEET_TEXT  
COLOR_SPREADSHEET_EDITBG  
COLOR_SPREADSHEET_EDITTEXT  
COLOR_SPREADSHEET_SELECTED  
COLOR_CONSOLE_BG  
COLOR_CONSOLE_TEXT  
COLOR_PAINTER_SELECTED  
COLOR_PAINTER_TREE  
COLOR_SYNTAX_COFFEE  
COLOR_SYNTAX_INCLUDE  
COLOR_SYNTAX_COMMENT  
COLOR_SYNTAX_COMMENTWRONG  
COLOR_SYNTAX_STRING  
COLOR_TEXT_SELECTED  
COLOR_TEXT_SELECTED_DARK  
COLOR_TEXT_DISABLED  
COLOR_TEXT_EDIT  
COLOR_TEXT_EDIT_DISABLED  
COLOR_TEXT_MENU  
COLOR_TEXT_MENU_DISABLED  
COLOR_TEXT_TAB  
COLOR_TEXT_TAB_DISABLED  
COLOR_TEXT_BUTTON  
COLOR_TEXT_BUTTON_DISABLED  
COLOR_TEXT_COMBO  
COLOR_TEXT_COMBO_DISABLED  
COLOR_MENU_BG  
COLOR_MENU_BG_SELECTED  
COLOR_MENU_TEXT  
COLOR_MENU_TEXT_DISABLED  
COLOR_MENU_TEXT_SELECTED  
COLOR_MENU_BORDER_WH  
COLOR_MENU_BORDER_DK  
COLOR_TIMELINE_LAYER0  
COLOR_TIMELINE_LAYER1  
COLOR_TIMELINE_LAYER2  
COLOR_TIMELINE_LAYER3  
COLOR_TIMELINE_LAYER4  
COLOR_TIMELINE_LAYER5  
COLOR_TIMELINE_LAYER6  
COLOR_TIMELINE_LAYER7  
COLOR_BG_MM_E_ACTIVE_TEXTURE  
COLOR_FG_MM_E_ACTIVE_TEXTURE  
COLOR_BG_MM_E_INACTIVE_TEXTURE  
COLOR_FG_MM_E_INACTIVE_TEXTURE  
COLOR_BG_MM_E_SELECTED_LAYER  
COLOR_FG_MM_E_SELECTED_LAYER  
COLOR_BG_MM_E_ACTIVE_LAYER  
COLOR_FG_MM_E_ACTIVE_LAYER  
COLOR_BG_MM_E_INACTIVE_LAYER  
COLOR_FG_MM_E_INACTIVE_LAYER  
COLOR_BG_TEXTUREVIEW  
COLOR_OBJECTMANAGER_TEXT_ACTIVE3  
COLOR_SYNTAX_CONSTANT  
COLOR_SYNTAX_FUNCTION  
COLOR_SYNTAX_CLASS  
COLOR_SYNTAX_MEMBER  
COLOR_CTIMELINE_GRID  
COLOR_CTIMELINE_POSITION  
COLOR_CTIMELINE_ROTATION  
COLOR_CTIMELINE_SCALE  
COLOR_CTIMELINE_PLA  
COLOR_CTIMELINE_COLOR  
COLOR_CTIMELINE_GENERAL  
COLOR_CTIMELINE_MASTER  
COLOR_CTIMELINE_MASTERIDENTICAL  
COLOR_CTIMELINE_CURRENTFRAME  
COLOR_CTIMELINE_PREVIEW  
COLOR_CTIMELINE_BREAKDOWN  
COLOR_CTIMELINE_HLECURVE  
COLOR_DBARBG3  
COLOR_CONTENTBROWSER_TEXT  
COLOR_CONTENTBROWSER_BG_TEXT_ACT  
COLOR_CONTENTBROWSER_BG_TEXT_INACT  
COLOR_CONTENTBROWSER_FG_TEXT_ACT  
COLOR_CONTENTBROWSER_FG_TEXT_INACT  
COLOR_CONTENTBROWSER_NOTAVAILABLE  
COLOR_BG_GROUP1  
COLOR_BG_GROUP2  
COLOR_POWERSOUND  
COLOR_BG_GROUPBAR1  
COLOR_BG_GROUPBAR2  
COLOR_CTIMELINE_CLIPTEXT  
COLOR_CTIMELINE_CLIP  
COLOR_CTIMELINE_CLIPMASTER  
COLOR_BUBBLE_BG  
COLOR_BUBBLE_FG  
COLOR_BUBBLE_BORDER  
COLOR_CTIMELINE_CLIPTEXTHL  
COLOR_TRACK_X  
COLOR_TRACK_Y  
COLOR_TRACK_Z  
COLOR_TRACK_S  
COLOR_AM_ANIMDOT  
COLOR_AM_ANIMDOT_CHANGED  
COLOR_AM_BPDOT  
COLOR_PV_BUCKET  
COLOR_PV_TEXT  
COLOR_PV_CACHE  
COLOR_PV_NOTALL  
COLOR_PV_COMPARE  
COLOR_PV_FPS  
Return type:dict
Returns:The color in the dict with the keys x, y and z.
GeDialog.CheckValueRanges()

Close the dialog.

Return type:bool
Returns:True if everything was fine, or False if any field is wrong.
GeDialog.AddCheckbox(id, flags[, initw=0][, inith=0][, name=""])

Add a checkbox to the dialog.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • name (str) – Name of the checkbox option.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddButton(id, flags[, initw=0][, inith=0][, name=""])

Add a button to the dialog.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • name (str) – Name of the button.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddStaticText(id, flags[, initw=0][, inith=0][, name=""][, borderstyle=0])

Adds a static text field to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • name (str) – Name of the button.
  • borderstyle (int) –

    Border style:

    BORDER_NONE No border.
    BORDER_THIN_IN Thin border inward.
    BORDER_THIN_OUT Thin border outward.
    BORDER_IN Normal border inward.
    BORDER_OUT Normal border outward.
    BORDER_GROUP_IN Group border inside.
    BORDER_GROUP_OUT Group border outside.
    BORDER_OUT2 Outward border 2.
    BORDER_OUT3 Outward border 3
    BORDER_BLACK Thin black line.
    BORDER_ACTIVE_1 Active border 1.
    BORDER_ACTIVE_2 Active border 2.
    BORDER_ACTIVE_3 Active border 3.
    BORDER_ACTIVE_4 Active border 4.
    BORDER_GROUP_TOP Border along the top.
    BORDER_MASK Masks out border type.
    BORDER_WITH_TITLE Display group title in the border.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddEditText(id, flags[, initw=0][, inith=0][, name=""][, editflags=0])

Adds an editable text field to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • name (str) – Name of the button.
  • editflags (int) –

    Edit flags, stored in mod:c4d.gui:

    EDITTEXT_PASSWORD Password field.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddMultiLineEditText(id, flags[, initw=0][, inith=0][, style=0])

Adds an editable text field with multiple lines to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • style (int) –

    A combination of the following flags:

    DR_MULTILINE_MONOSPACED Monospaced font.
    DR_MULTILINE_SYNTAXCOLOR C.O.F.F.E.E. syntax highlighting.
    DR_MULTILINE_STATUSBAR Display a statusbar with the cursor position.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddEditNumber(id, flags[, initw=80][, inith=0])

Adds an editable number field to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddEditNumberArrows(id, flags[, initw=70][, inith=0])

Adds an editable number field with up/down arrows to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddSlider(id, flags[, initw=80][, inith=0])

Adds a slider with an editable number field to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddEditSlider(id, flags[, initw=80][, inith=0])

Adds a slider with an editable number field to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddColorField(id, flags[, initw=80][, inith=0])

Adds a simple color field without sliders to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddComboBox(id, flags[, initw=80][, inith=0][, specialalign=False])

Adds a simple color field without sliders to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • specialalign (bool) –
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddColorChooser(id, flags[, initw=80][, inith=0][, layoutflags=False])

Adds a simple color field without sliders to the layout.

Parameters:
  • id (int) – The unique ID of the dialog.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
  • layoutflags (int) –

    Flags:

    DR_COLORFIELD_NO_BRIGHTNESS Disable the brightness control.
    DR_COLORFIELD_NO_COLOR Disable the color control.
    DR_COLORFIELD_BODYPAINT Use the Bodypaint style.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddSeparatorH(initwh[, flags=BFH_FIT])

Adds a horizontal separator to the layout.

Parameters:
  • initw (int) – Initial width.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddSeparatorV(initwh[, flags=BFH_FIT])

Adds a vertical separator to the layout.

Parameters:
  • inith (int) – Initial width.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddDateTimeControl(id[, name][, flags][, minw][, minh][, customdata])

Adds a vertical separator to the layout.

Parameters:
  • id (int) – The ID.
  • name (str) – The name of the added custom GUI. (Not necessarily used.)
  • flags

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • minw (int) – Minimum width.
  • minh (int) – Minimum height
  • flags (int) – Layout flags:
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.AddChild(id, subid, child)

Adds items to combo boxes or popup buttons. The resource equivalent is CHILDS.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • subid (int) – ID of the item to add.
  • child (str) – Name of the item to add.
Return type:

bool

Returns:

True if the child was added.

GeDialog.FreeChildren(id, subid, child)

Clears the item list of combo boxes and popup buttons.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:bool
Returns:True if the children were removed.
GeDialog.AttachUserArea(ua, id[, userareaflags=USERAREA_COREMESSAGE])

Assigns a GeUserArea object to a user area control in the dialog. The object will handle all messages to the user area and is responsible for painting the user area. A good practice is to place the GeUserArea derived object as a member of the GeDialog derived class.

Parameters:
  • ua (GeUserArea) – A user area object to attach.
  • id (C4DGadget or int) – The control ID.
  • userareaflags (int) –

    Flags for the user area:

    USERAREA_TABSTOP  
    USERAREA_HANDLEFOCUS  
    USERAREA_COREMESSAGE  
    USERAREA_SYNCMESSAGE  
Return type:

bool

Returns:

True if the children were removed.

GeDialog.AddUserArea(id, flags[, initw=0][, inith=0])

Adds a user area to the layout. Use GeDialog.AttachUserArea() to assign a GeUserArea object to the user area control.

Parameters:
  • id (The user area ID.) – The unique ID.
  • flags (int) –
    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • initw (int) – Initial width.
  • inith (int) – Initial height.
Return type:

C4DGadget

Returns:

The added gadget.

GeDialog.GroupBeginInMenuLine()
Begins a group in the menu bar of the dialog. End the group with GeDialog.GroupEnd()
GeDialog.ScrollGroupBegin(id, flags[, scrollflags=0][, initw=0][, inith=0])

Begins a scrollgroup.

Parameters:
  • id (int) – The scroll group ID.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • scrollflags (int) –

    Additional settings for the scroll group. Can be a combination of the following flags:

    SCROLLGROUP_VERT Allow the group to scroll vertically.
    SCROLLGROUP_HORIZ Allow the group to scroll horizontally.
    SCROLLGROUP_NOBLIT Always redraw the whole group, not just new areas, when scrolling.
    SCROLLGROUP_LEFT Create the vertical slider to the left.
    SCROLLGROUP_BORDERIN Display a small border around the scroll group.
    SCROLLGROUP_STATUSBAR Create a status bar for the scroll group.
    SCROLLGROUP_AUTOHORIZ Only show horizontal slider if needed.
    SCROLLGROUP_AUTOVERT Only show vertical slider if needed.
    SCROLLGROUP_NOSCROLLER No scroller.
    SCROLLGROUP_NOVGAP No vertical gap.
    SCROLLGROUP_STATUSBAR_EXT_GROUP Creates an extern group within the statusbar.
  • initw (int) – The initial width of the scroll area.
  • inith (int) – The initial height of the scroll area.
Return type:

bool

Returns:

True if scrollgroup was added.

GeDialog.LayoutChanged(id)

Notifies C4D that the layout of a dynamic group in the dialog has changed. This is usually done by first calling GeDialog.LayoutFlushGroup() and then adding new controls.

Parameter:id (int) – The ID of the changed group.
Return type:bool
Returns:True if the layout was updated, otherwise False.
GeDialog.LayoutChangedNoRedraw(id)

Notifies C4D that the layout of a dynamic group in the dialog has changed. This is usually done by first calling GeDialog.LayoutFlushGroup() and then adding new controls.

Parameter:id (C4DGadget or int) – The ID of the changed group.
Return type:bool
Returns:True if the layout was updated, otherwise False.
GeDialog.Activate(id)

Sets the focus to a specific control within the dialog.

Parameter:id (int) – The control ID
Return type:bool
Returns:True if the control was activated.
GeDialog.LayoutFlushGroup(id)

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 GeDialog.LayoutChanged() with the group ID.

Parameter:id (int) – The control ID.
Return type:bool
Returns:True if the group was flushed.
GeDialog.MenuFlushAll()

Flushes the menu bar of the dialog, removing all menus. Add menus with GeDialog.MenuSubBegin(). Call GeDialog.MenuFinished() when all menus and items have been added.

Return type:bool
Returns:True if the menu bar was flushed.
GeDialog.MenuSubEnd()

Closes the current menu group, opened with GeDialog.MenuSubBegin().

Return type:bool
Returns:True if the menu group was ended, otherwise False.
GeDialog.MenuAddCommand()

Adds a command item to the current menu. This can either be a C4D command or a plugin command. Particularly useful is IDM_CM_CLOSEWINDOW to add a close item for dialogs.

Parameter:cmdid (int) – A C4D command id or a plugin ID.
Return type:bool
Returns:True if the command was added.
GeDialog.MenuAddString(id, string)

Adds a string item to the current menu. GeDialog.Command() will be called when the menu item is selected.

Parameters:
  • id (int) – The item ID.
  • string (str) – The item text. Use a &d& suffix for disabled and a c suffix for checked items.
Return type:

bool

Returns:

True if the menu item was added, otherwise False.

GeDialog.MenuAddSeparator()

Adds a separator to the current menu.

Parameter:id (int) – The item ID.
Return type:bool
Returns:True if a seperator was added.
GeDialog.MenuFinished()

Call this function when all menus and all items have been added.

Parameter:id (int) – The item ID.
Return type:bool
Returns:True if a seperator was added.
GeDialog.MenuInitString(id, enabled, value)

Used to change the enabled/disabled and checked/unchecked state of menu items. Can be called after GeDialog.MenuFinished() to update the menu item dynamically.

Parameters:
  • id (int) – The menu item ID.
  • enabled (bool) – True if the item is enabled, otherwise False.
  • value (bool) – True if the menu item should be checked.
Return type:

bool

Returns:

True if the item was set.

GeDialog.MenuSubBegin(string)

Creates a new menu group.At the top level this means a menu, at lower levels a sub-menu. Add items with GeDiaog.MenuAddCommand(), GeDiaog.MenuAddString() or GeDiaog.MenuAddSeparator(). Call GeDiaog.MenuSubEnd() when the menu is finished.

Parameter:string (str) – Name of the sub menu.
Return type:bool
Returns:True if a menu group could be begun.
GeDialog.MenuSubBegin(string)

Creates a new menu group.At the top level this means a menu, at lower levels a sub-menu. Add items with GeDiaog.MenuAddCommand(), GeDiaog.MenuAddString() or GeDiaog.MenuAddSeparator(). Call GeDiaog.MenuSubEnd() when the menu is finished.

Parameter:string (str) – Name of the sub menu.
Return type:bool
Returns:True if a menu group could be begun.
GeDialog.GroupBegin(id, flags[, cols=0][, rows=0][, title=""][, groupflags=0])

Begins a group.

Parameters:
  • id (int) – The ID of the group.
  • flags (int) –

    Layout flags:

    BFH_CENTER Centered horizontally.
    BFH_LEFT Aligned to the left.
    BFH_RIGHT Aligned to the right.
    BFH_FIT BFH_LEFT | BFH_RIGHT
    BFH_SCALE Scale if there’s more space.
    BFH_SCALEFIT BFH_SCALE | BFH_FIT
    BFH_MASK Masks out these flags.
    BFV_CENTER Centered verticall.y
    BFV_TOP Aigned to the top.
    BFV_BOTTOM Aligned to the bottom.
    BFV_FIT BFV_BOTTOM | BFV_TOP
    BFV_SCALE Scale if there’s more space.
    BFV_SCALEFIT BFV_SCALE | BFV_FIT
    BFV_MASK *Masks out these flags.
  • cols (int) – Columns.
  • rows (int) – Rows
  • title (str) – The title.
GeDialog.GroupEnd()

Ends groups.

Return type:bool
Returns:True if the group was ended, otherwise False.
GeDialog.GroupSpace(spacex, spacey)

Ends groups.

Parameters:
  • spacex (int) – The X distance.
  • spacey (int) – The Y distance.
Return type:

bool

Returns:

True if the spacing could be set.

GeDialog.GroupBorder(borderstyle)

Sets the border type of the current group, and displays the title in the border if possible.

Note

Use GeDialog.GroupBorderNoTitle() if you don’t have a title. Otherwise there’ll be a small gap in the border where the title would be.

Parameter:borderstyle (int) –

The style:

BORDER_NONE No border.
BORDER_THIN_IN Thin border inward.
BORDER_THIN_OUT Thin border outward.
BORDER_IN Normal border inward.
BORDER_OUT Normal border outward.
BORDER_GROUP_IN Group border inside.
BORDER_GROUP_OUT Group border outside.
BORDER_OUT2 Outward border 2.
BORDER_OUT3 Outward border 3
BORDER_BLACK Thin black line.
BORDER_ACTIVE_1 Active border 1.
BORDER_ACTIVE_2 Active border 2.
BORDER_ACTIVE_3 Active border 3.
BORDER_ACTIVE_4 Active border 4.
BORDER_GROUP_TOP Border along the top.
BORDER_MASK Masks out border type.
BORDER_WITH_TITLE Display group title in the border.
GeDialog.GroupBorderNoTitle(borderstyle)

Sets the border type of the current group, and displays the title in the border if possible.

Parameter:borderstyle (int) –

The style:

BORDER_NONE No border.
BORDER_THIN_IN Thin border inward.
BORDER_THIN_OUT Thin border outward.
BORDER_IN Normal border inward.
BORDER_OUT Normal border outward.
BORDER_GROUP_IN Group border inside.
BORDER_GROUP_OUT Group border outside.
BORDER_OUT2 Outward border 2.
BORDER_OUT3 Outward border 3
BORDER_BLACK Thin black line.
BORDER_ACTIVE_1 Active border 1.
BORDER_ACTIVE_2 Active border 2.
BORDER_ACTIVE_3 Active border 3.
BORDER_ACTIVE_4 Active border 4.
BORDER_GROUP_TOP Border along the top.
BORDER_MASK Masks out border type.
BORDER_WITH_TITLE Display group title in the border.
GeDialog.GroupBorderSpace(left, top, right, bottom)

Sets the border size around the current group in pixels.

Parameters:
  • left (int) – The distance to the left of the group.
  • top (int) – The distance above the group.
  • right (int) – The distance to the right of the group.
  • bottom (int) – The distance below the group.
Return type:

bool

Returns:

True if the border space was set.

GeDialog.Close()

Close the dialog.

Return type:bool
Returns:True if successfully closed, otherwise False.
GeDialog.SendMessage(gadget, value)

Sends a message to a dialog gadget.

Parameters:
Return type:

object

Returns:

Depends on the message.

GeDialog.SendParentMessage(msg)

Sends a message to the parent dialog.

Parameter:msg (BaseContainer) – The message container.
Return type:bool
Returns:True if the message was sent.
GeDialog.GetId()

Gets the dialog ID.

Return type:int
Returns:The id.
GeDialog.IsVisible()

Checks if the dialog is visible.

Return type:bool
Returns:True if it’s visible, otherwise False.
GeDialog.IsOpen()

Checks if the dialog is open.

Return type:bool
Returns:True if it’s open, otherwise False.
GeDialog.SetTimer(value)

Initializes the timer clock, so that timer() is called every timer milliseconds. Use SetTimer(0) to stop the clock.

Note

Depending on the speed of the computer, the operating system, the complexity of the dialog and the threads running in the background, there is no guarantuee that event messages will occur on a regular basis. Using a value of 500 ms should be no problem but if using a value of 1 ms one might get events with the following time spaces: 3 ms, 76 ms, 15 ms, 19 ms, 67 ms...

Warning

Keep in mind that using small timer values results in heavy message traffic in the application which may slow down CINEMA 4D

Parameter:value (int) – The timer interval in milliseconds.
GeDialog.SetTitle(title)

Sets the title of the dialog window.

Parameter:title (str) – The title
GeDialog.Enable(gadget, enable)

Enables or disables the dialog gadget, depending on the value of enabled.

Parameters:
  • gadget (DialogGadget) – The dialog gadget
  • enabled (bool) – True means enabled, otherwise False.
GeDialog.LoadDialogResource(id[, lr=None][, flags=0])

Loads an external resource file. This is the prefered method for dialog layout since it gives maximum flexibility and easy multi language support. The dialog loaded is automatically surrounded by an additional outer group, so flags means the same as with dialog groups (e.g. BFV_CENTER).

Parameters:
  • id (int) – The dialog ID.
  • lr (GeResource) – A loaded resource or None. If this is None then the global resource singleton is used. The caller owns the pointed object.
  • flags (int) – Additional layout flags.
GeDialog.LoadDialogResource(id[, lr=None][, flags=0])

Loads an external resource file. This is the prefered method for dialog layout since it gives maximum flexibility and easy multi language support. The dialog loaded is automatically surrounded by an additional outer group, so flags means the same as with dialog groups (e.g. BFV_CENTER).

Parameters:
  • id (int) – The dialog ID.
  • lr (GeResource) – A loaded resource or None. If this is None then the global resource singleton is used. The caller owns the pointed object.
  • flags (int) – Additional layout flags.
Return type:

bool

Returns:

True if the dialog was loaded successfully.

GeDialog.SetBool(id, value)

Sets the value of checkbox controls.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (bool) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetInt(id, value)

Sets the value and limits of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (int) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetFloat(id, value)

Sets the value, unit and limits of float fields.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (float) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetMeter(id, value)

Sets the value and limits of a meter field.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (float) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetDegree(id, value)

Sets the value and limits of a meter field.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (float) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetPercent(id, value)

Sets the value and limits of a meter field.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (float) – The new value.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetTime(id, value)

Sets the value and limits of a meter field.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (BaseTime) – The new time.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetString(id, value)

Sets the text of string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and checkboxes.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • value (BaseTime) – The new string.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetColorField(id, color, brightness, maxbrightness, flags)

Sets the color, brightness and limits of color fields and color choosers.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • color (Vector) – The color.
  • brightness (float) – The new brightness value.
  • maxbrightness (float) – The maximum brightness allowed.
  • flags (int) –

    Controls what parts of a color chooser that are available. Possible values are:

    DR_COLORFIELD_NO_BRIGHTNESS Disable the brightness control.
    DR_COLORFIELD_NO_COLOR Disable the color control.
    DR_COLORFIELD_BODYPAINT Use the Bodypaint style.
Return type:

bool

Returns:

True if the value was set.

GeDialog.SetFilename(id, fn)

Sets the text of string controls, taking the new value from a filename.

Parameters:
  • id (C4DGadget or int) – The control ID or int.
  • fn (str) – The new filename.
Return type:

bool

Returns:

True if the value was set.

GeDialog.GetBool(id)

Retrieves the value of checkbox controls.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:bool
Returns:The value or None if the value was not retrieved.
GeDialog.GetInt(id)

Retrieves the value of integer fields. Also used for tab groups, radio buttons and combo boxes.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:int
Returns:The value or None if the value was not retrieved.
GeDialog.GetFloat(id)

Retrieves the value of float fields.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:float
Returns:The value or None if the value was not retrieved.
GeDialog.GetVector(id_x, id_y, id_z)

Retrieves the value of three float fields at the same time as a vector.

Parameters:
  • id_x (C4DGadget or int) – The control ID of the X field.
  • id_y (C4DGadget or int) – The control ID of the Y field.
  • id_z (C4DGadget or int) – The control ID of the Z field.
Return type:

Vector

Returns:

The value or None if the value was not retrieved.

GeDialog.GetString(id)

Retrieves the text from string controls. Used for all controls that have a text, for example static text fields, edit fields, buttons and checkboxes.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:str
Returns:The value or None if the value was not retrieved.
GeDialog.GetColorField(id)

Retrieves the color and brightness of color controls.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:dict
Returns:The value or None if the value was not retrieved.
GeDialog.GetTime(id, doc)

Retrieves the time of time fields.

Parameters:
Return type:

BaseTime

Returns:

The time or None if the value was not retrieved.

GeDialog.GetFilename(id)

Retrieves the text from string controls as a filename.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:str
Returns:The time or None if the value was not retrieved.
GeDialog.CheckTristateChange(id)

Indicates wheter a control’s content has been changed since the last time it’s value was set manually with.

Parameter:id (C4DGadget or int) – The control ID or int.
Return type:bool
Returns:True if the control has been changed, otherwise False.
GeDialog.GetVisibleArea(scrollgroup)

Queries a scroll group for its currently visible region, a rectangle between (x1,y1) and (x2,y2). The coordinates are in pixels.

Parameter:scrollgroup (int) – The scroll group ID.
Return type:dict of int
Returns:The visible area in coordinates, in members x1, y1, x2, y2.
GeDialog.SetVisibleArea(scrollgroupid, x1, y1, x2, y2)

Scrolls a scroll group so that the rectangle between (x1,y1) and (x2,y2) is visible. The coordinates are in pixels. If the area is smaller than the scroll group then it’s moved only as much as necessary. If the area is bigger than the scroll group then the top left corners are aligned.

Parameters:
  • scrollgroup (int) – The scroll group ID.
  • x1 (int) – The X coordinate of the top left corner of the rectangle.
  • y1 (int) – The Y coordinate of the top left corner of the rectangle.
  • x2 (int) – The X coordinate of the bottom right corner of the rectangle.
  • y2 (int) – The Y coordinate of the bottom right corner of the rectangle.
  • id (C4DGadget or int) – The control ID or int.
Return type:

bool

Returns:

True if the group was scrolled or already had the right view.

GeDialog.GetType(id)
Private.

Border flags

../../../_images/borders.png

Table Of Contents

This Page