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.
Override - Called when C4D is about to display the dialog.
Return type: | bool |
---|---|
Returns: | True if successful, or False to signalize an error. |
Override - Use to react to more messages.
Parameters: |
|
---|---|
Return type: |
int |
Returns: |
The return value depends on the message. |
Called when the dialog is initialized by the GUI.
Return type: | bool |
---|---|
Returns: | True if successful, or False to signalize an error. |
Override this function if you want to react to C4D core messages. The original message is stored in msg.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||||||||||||||||||||||||||||||||||
Returns: |
Currently not used - but you have to return a bool value. |
Override this function if you want to react to user clicks. 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 it to handle such events.
Note
Remember that you need to call StopAllThreads() before making modifications to the scene.
Parameters: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
|||||||||||||||||||||
Returns: |
False if there was an error, otherwise True. |
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. |
If you subscribe to timer events using SetTimer() (x), this function is called every x’th millisecond.
Parameters: | msg (BaseContainer) – The raw timer message. |
---|
Override this method - this function is called when the dialog is about to be closed temporarily, for example for layout switching.
Opens a dialog.
Parameters: |
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||
Returns: |
True if successfully opened, otherwise False. |
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. |
Polls a certain channel of a device for the current input state. If the return value is True, the container stored in res is just like an input event message, otherwise no state was available. For a list of valid devices and channels, please see Input Events.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if a state could be retrieved, otherwise False. |
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 just like an input event message, otherwise no event was available. For a list of valid devices and channels, please see Input Events.
Parameters: | askdevice (int) – The device to poll. |
---|---|
Return type: | BaseContainer |
Returns: | The result is this container or None. |
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.
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{x: int, y: int} |
---|---|
Returns: | The converted coordinates or None. |
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{x: int, y: int} |
---|---|
Returns: | The converted coordinates or None. |
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{x: int, y: int} |
---|---|
Returns: | The converted coordinates or None. |
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{x: int, y: int} |
---|---|
Returns: | The converted coordinates or None. |
Set The default color for GUI elements.
Parameters: |
|
---|
Gets the RGB values associated with a color code.
Parameters: |
colorid (int) –
The color value.
|
||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | dict{r: int, g: int, b: int} | ||||||||||||||||||||||||||||||||||||||||||||||
Returns: | The color in the dict with the keys x, y and z. |
Close the dialog.
Return type: | bool |
---|---|
Returns: | True if everything was fine, or False if any field is wrong. |
Add a checkbox to the dialog.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Add a button to the dialog.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a static text field to the layout.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds an editable text field to the layout.
Parameters: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds an editable text field with multiple lines to the layout.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds an editable number field to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds an editable number field with up/down arrows to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a slider with an editable number field to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a slider with an editable number field to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a simple color field without sliders to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a combo box to the layout. To add items to the combo box menu use the AddChild() method.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a color field with sliders to the layout.
Parameters: |
|
||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||||||||
Returns: |
The added gadget. |
New in version R13.016.
Adds a radio group to the layout. To add items to the radio button group use the AddChild() function.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||||||||||||||
Returns: |
True if the radio group was added, otherwise False. |
New in version R13.016.
Adds a radio button to the layout. Used with radio groups created with AddRadioGroup().
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
New in version R13.016.
Adds a text radio button to the layout (like the ones to the left in the C4D material editor). Used with radio groups created with AddRadioGroup().
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a horizontal separator to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a vertical separator to the layout.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
Adds a custom GUI element to the dialog. Returns a pointer to the custom GUI object.
Parameters: |
|
---|
New in version R13.016.
Get the custom GUI object for a certain ID. The GUI object must have been previously added with AddCustomGui().
Parameters: |
|
---|---|
Return type: |
any of the custom GUI classes. |
Returns: |
The custom GUI element that was added, or None if an error occured. |
Adds items to combo boxes or popup buttons. The resource equivalent is CHILDS.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the child was added. |
Clears the item list of combo boxes and popup buttons.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | bool |
Returns: | True if the children were removed. |
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: |
|
||||||||
---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||
Returns: |
True if the children were removed. |
Adds a user area to the layout. Use AttachUserArea() to assign a GeUserArea object to the user area control.
Parameters: |
|
||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | |||||||||||||||||||||||||||||
Returns: |
The added gadget. |
New in version R13.016.
Adds a dialog group with standard buttons to the layout.
Parameters: |
type (int) –
The dialog type:
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | bool | ||||||||||||||
Returns: | True if the dialog group was added, otherwise False. |
Begins a group in the menu bar of the dialog. End the group with GroupEnd()
Retrieves group weights for group id.
Parameters: | id (C4DGadget or int) – The control ID or int. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: | BaseContainer | ||||||||||||
Returns: |
A new container or None. Filled with the weights:
|
Sets group weights for group id. The group weights are absolute values. If a element has a bigger minimum size the given weight will be ignored. The sum of the weights don’t need to be 100:
def CreateLayout(self):
self.GroupBegin(999,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,2,0,"",c4d.BFV_GRIDGROUP_ALLOW_WEIGHTS);
self.AddStaticText(1000,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddStaticText(1001,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddStaticText(1002,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddStaticText(1003,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddStaticText(1004,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddStaticText(1005,c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT,0,0,"SubDialog2",c4d.BORDER_THIN_IN);
self.AddEditNumberArrows(1006, c4d.BFH_SCALEFIT)
if not self.weights_saved:
#initialization code
self.weights.SetLong(c4d.GROUPWEIGHTS_PERCENT_W_CNT, 2) # number of columns - has to be equal to the given layout
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_W_VAL+0,25.0); # weight for col 1
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_W_VAL+1,75.0); # weight for col 2
#set the rows
self.weights.SetLong(c4d.GROUPWEIGHTS_PERCENT_H_CNT,4); # number of rows - has to be equal to the given layout
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+0,10.0); # weight for row 1
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+1,30.0); # weight for row 2
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+2,60.0); # weight for row 3
self.weights.SetReal(c4d.GROUPWEIGHTS_PERCENT_H_VAL+3,0.0); # weight for row 4
self.weights_saved = True
self.GroupWeightsLoad(999, self.weights)
self.GroupEnd()
return True
def Message(self, msg, result):
if msg.GetId()==c4d.MFM_WEIGHTS_CHANGED:
#if the weights change because of user interaction you will get notified
if msg.GetLong(c4d.BFM_WEIGHTS_CHANGED)==999:
self.GroupWeightsSave(999, self.weights)
return GeDialog.Message(self, msg, result)
Parameters: |
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||
Returns: |
True if the group weights could be set, otherwise False. |
Begins a scrollgroup.
Parameters: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: |
True if scrollgroup was added. |
Notifies C4D 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.
Parameters: | id (int) – The ID of the changed group. |
---|---|
Return type: | bool |
Returns: | True if the layout was updated, otherwise False. |
Notifies C4D 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.
Parameters: | id (C4DGadget or int) – The ID of the changed group. |
---|---|
Return type: | bool |
Returns: | True if the layout was updated, otherwise False. |
Sets the focus to a specific control within the dialog.
Parameters: | id (int) – The control ID |
---|---|
Return type: | bool |
Returns: | True if the control was activated. |
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.
Parameters: | id (int) – The control ID. |
---|---|
Return type: | bool |
Returns: | True if the group was flushed. |
Flushes the menu bar of the dialog, removing all menus. Add menus with MenuSubBegin(). Call MenuFinished() when all menus and items have been added.
Return type: | bool |
---|---|
Returns: | True if the menu bar was flushed. |
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.
Parameters: | string (str) – Name of the sub menu. |
---|---|
Return type: | bool |
Returns: | True if a menu group could be begun. |
Closes the current menu group, opened with MenuSubBegin().
Return type: | bool |
---|---|
Returns: | True if the menu group was ended, otherwise False. |
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.
Parameters: | cmdid (int) – A C4D command id or a plugin ID. |
---|---|
Return type: | bool |
Returns: | True if the command was added. |
Adds a string item to the current menu. Command() will be called when the menu item is selected.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the menu item was added, otherwise False. |
Adds a separator to the current menu.
Parameters: | id (int) – The item ID. |
---|---|
Return type: | bool |
Returns: | True if a seperator was added. |
Call this function when all menus and all items have been added.
Parameters: | id (int) – The item ID. |
---|---|
Return type: | bool |
Returns: | True if a seperator was added. |
Used to change the enabled/disabled and checked/unchecked state of menu items. Can be called after MenuFinished() to update the menu item dynamically.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the item was set. |
Begins a tab group.
Parameters: |
|
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||||||||||||||||||||||
Returns: |
True if a tab group could be begun, otherwise False. |
Begins a group.
Parameters: |
|
---|
Ends groups.
Return type: | bool |
---|---|
Returns: | True if the group was ended, otherwise False. |
Ends groups.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the spacing could be set. |
Sets the border type of the current group, and displays the title in the border if possible.
Note
Use GroupBorderNoTitle() if you don’t have a title. Otherwise there’ll be a small gap in the border where the title would be.
Parameters: |
borderstyle (int) –
The style:
|
---|
Sets the border type of the current group, and displays the title in the border if possible.
Parameters: |
borderstyle (int) –
The style:
|
---|
Sets the border size around the current group in pixels.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the border space was set. |
Close the dialog.
Return type: | bool |
---|---|
Returns: | True if successfully closed, otherwise False. |
Sends a message to a dialog gadget.
Parameters: |
|
---|---|
Return type: |
object |
Returns: |
Depends on the message. |
Sends a message to the parent dialog.
Parameters: | msg (BaseContainer) – The message container. |
---|---|
Return type: | bool |
Returns: | True if the message was sent. |
Gets the dialog ID.
Return type: | int |
---|---|
Returns: | The id. |
Checks if the dialog is visible.
Return type: | bool |
---|---|
Returns: | True if it’s visible, otherwise False. |
Checks if the dialog is open.
Return type: | bool |
---|---|
Returns: | True if it’s open, otherwise False. |
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...
Note
The timer will be paused while a synchronous dialog is opened in CINEMA 4D.
Warning
Keep in mind that using small timer values results in heavy message traffic in the application which may slow down CINEMA 4D.
Parameters: | value (int) – The timer interval in milliseconds. |
---|
Sets the title of the dialog window.
Parameters: | title (str) – The title. |
---|
Enables or disables the dialog gadget, depending on the value of enable.
Parameters: |
|
---|
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: |
|
---|
Sets the value of checkbox controls.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the value and limits of integer fields. Also used for tab groups, radio buttons and combo boxes.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the value, unit and limits of float fields.
Parameters: |
|
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||||||||||||
Returns: |
True if the value was set. |
Sets the value and limits of a meter field. Same as SetReal() with FORMAT_METER.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the value and limits of an angle field. Same as SetReal() with FORMAT_DEGREE.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the value and limits of a percent field. Same as SetReal() with FORMAT_PERCENT.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the value and limits of a time field. Same as SetReal() with FORMAT_FRAMES.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
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: | |
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
Sets the color, brightness and limits of color fields and color choosers.
Parameters: |
|
||||||
---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||
Returns: |
True if the value was set. |
Sets the text of string controls, taking the new value from a filename.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if the value was set. |
New in version R13.016.
Set the cursor position within a dialog multi-line string item.
Parameters: |
|
---|---|
Return type: |
bool |
Returns: |
True if successful, otherwise False. |
New in version R13.016.
Sets the edit mode for multi-line edit fields.
Parameters: |
|
||||||
---|---|---|---|---|---|---|---|
Return type: |
bool |
||||||
Returns: |
True if the multi-line mode was set, otherwise False. |
Retrieves the value of checkbox controls.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | bool |
Returns: | The value or None if the value was not retrieved. |
Retrieves the value of integer fields. Also used for tab groups, radio buttons and combo boxes.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | int |
Returns: | The value or None if the value was not retrieved. |
Retrieves the value of float fields.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | float |
Returns: | The value or None if the value was not retrieved. |
Retrieves the value of three float fields at the same time as a vector.
Parameters: | |
---|---|
Return type: |
Vector |
Returns: |
The value or None if the value was not retrieved. |
Retrieves the text from 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. |
---|---|
Return type: | str |
Returns: | The value or None if the value was not retrieved. |
Retrieves the color and brightness of color controls.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | dict{brightness: float, color: Vector} |
Returns: | The value or None if the value was not retrieved. |
Retrieves the time of time fields.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The time or None if the value was not retrieved. |
Retrieves the text from string controls as a filename.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | str |
Returns: | The time or None if the value was not retrieved. |
Indicates wheter a control’s content has been changed since the last time its value was set manually with.
Parameters: | id (C4DGadget or int) – The control ID or int. |
---|---|
Return type: | bool |
Returns: | True if the control has been changed, otherwise False. |
Queries a scroll group for its currently visible region, a rectangle between (x1,y1) and (x2,y2). The coordinates are in pixels.
Parameters: | scrollgroup (int) – The scroll group ID. |
---|---|
Return type: | dict{x1: int, y1: int , x2: int , y2: int } |
Returns: | The visible area in coordinates, in keys 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: |
|
---|---|
Return type: |
bool |
Returns: |
True if the group was scrolled or already had the right view. |
Private.