3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
coat::dialog Class Reference

the rich dialog. You may customize it, show your custom parameters and custom buttons. More...

#include <CoreAPI.h>

Public Member Functions

dialogtext (const char *id)
 pass the header text of the dialog
 
dialogcaption (const char *id)
 pass the caption of the dialog
 
dialogwidth (int w)
 change the default width
 
dialogmodal ()
 dialog will be modal. Generally, it is modal by default. Execution will be paused at show() till the user will press any dialog button.
 
dialognoModal ()
 dialog will be no modal. Execution will continue after you will call the show()
 
dialogbuttons (const char *list)
 pass the list of buttons for the dialog
 
dialogtopRight ()
 place the dialog at the top-right position of the viewport
 
dialogok ()
 add Ok button
 
dialogcancel ()
 add Cancel button
 
dialogyes ()
 add Yes button
 
dialogno ()
 add No button
 
dialogwarn ()
 add Warning icon
 
dialogquestion ()
 add Question icon
 
dialogundoWorks ()
 allow undo (CTR-Z) act even in modal dialog
 
dialogtransparentBackground ()
 the background will not be faded
 
dialogdontShowAgainCheckbox ()
 show the checkbox "Don't show again". If user checks if the dialog will net be shown next time and show() will return 0 immediately.
 
dialogparams (BaseClass *params)
 The important core feature. BaseClass allows to create the custom controls in the dialog. Look the dialog example to understand how to use it.
 
dialogparams (pybind11::object params)
 The important core feature. Pass the object to display object parameters in UI. Look the dialog example to understand how to use it.
 
dialogprocess (pybind11::object callback)
 pass the function/lambda that will be called each frame.
 
dialogprocess (std::function< void()> process)
 pass the function/lambda that will be called each frame. But there is better way - override the ProcessInEditor for the BaseClass derived class and handle the processing there.
 
dialogonPress (std::function< void(int)> press)
 pass the function/lambda that will be called when the button will be pressed. The button index (starts from 1) will be passed to the function
 
dialogonPress (pybind11::object press)
 
int show ()
 Show the dialog. This is usually the last command in the chain.
 
dialogwidget (BaseWidget *w)
 

Static Public Member Functions

static bool & fadeDialogsBackground ()
 returns the reference to the global property - fade modal dialogs background (true) or not (false)
 

Detailed Description

Member Function Documentation

◆ buttons()

dialog & coat::dialog::buttons ( const char * list)

pass the list of buttons for the dialog

Parameters
listlist of buttons. |, .+; may be used as separators between identifiers
Returns
itself

◆ cancel()

◆ caption()

dialog & coat::dialog::caption ( const char * id)

pass the caption of the dialog

Parameters
idid the caption or caption identifier that will be used to take the text from the language file. You may press F9 to localize it in UI.
Returns
the chain ref
Examples
dialogs.cpp, ffCube.cpp, ffCylinder.cpp, spiral.cpp, and threadStud.cpp.

◆ dontShowAgainCheckbox()

dialog & coat::dialog::dontShowAgainCheckbox ( )

show the checkbox "Don't show again". If user checks if the dialog will net be shown next time and show() will return 0 immediately.

Returns
itself
Examples
TreesGenerator.cpp.

◆ fadeDialogsBackground()

static bool & coat::dialog::fadeDialogsBackground ( )
static

returns the reference to the global property - fade modal dialogs background (true) or not (false)

Returns
the property reference

◆ modal()

dialog & coat::dialog::modal ( )

dialog will be modal. Generally, it is modal by default. Execution will be paused at show() till the user will press any dialog button.

Returns
itself

◆ no()

dialog & coat::dialog::no ( )

add No button

Returns
itself

◆ noModal()

dialog & coat::dialog::noModal ( )

dialog will be no modal. Execution will continue after you will call the show()

Returns

◆ ok()

◆ onPress()

dialog & coat::dialog::onPress ( std::function< void(int)> press)

pass the function/lambda that will be called when the button will be pressed. The button index (starts from 1) will be passed to the function

Parameters
pressthe callback/lambda
Returns
itself
Examples
dialogs.cpp.

◆ params() [1/2]

dialog & coat::dialog::params ( BaseClass * params)

The important core feature. BaseClass allows to create the custom controls in the dialog. Look the dialog example to understand how to use it.

Parameters
paramsthe pointer to the class derived from the BaseClass
Returns
itself
Examples
HoneyComb.cpp, capsule.cpp, dialogs.cpp, ellipses.cpp, ffCube.cpp, ffCylinder.cpp, gear.cpp, meshes.cpp, meshes_surface_merge.cpp, metaballs.cpp, spheres.cpp, spiral.cpp, square_volume.cpp, thread.cpp, threadStud.cpp, and tube.cpp.

◆ params() [2/2]

dialog & coat::dialog::params ( pybind11::object params)

The important core feature. Pass the object to display object parameters in UI. Look the dialog example to understand how to use it.

Parameters
paramsthe class reference
Returns
itself

◆ process() [1/2]

dialog & coat::dialog::process ( pybind11::object callback)

pass the function/lambda that will be called each frame.

Parameters
callbackthe callback/lambda called each frame within the dialog
Returns
itself

◆ process() [2/2]

dialog & coat::dialog::process ( std::function< void()> process)

pass the function/lambda that will be called each frame. But there is better way - override the ProcessInEditor for the BaseClass derived class and handle the processing there.

Parameters
processthe callback/lambda
Returns
itself

◆ question()

dialog & coat::dialog::question ( )

add Question icon

Returns
itself

◆ show()

int coat::dialog::show ( )

Show the dialog. This is usually the last command in the chain.

Returns
the button index. First button in the list has index 1
Examples
Arrays.cpp, HelloWorld.cpp, HoneyComb.cpp, Strings.cpp, TreesGenerator.cpp, capsule.cpp, ellipses.cpp, ffCube.cpp, ffCylinder.cpp, gear.cpp, meshes.cpp, meshes_surface_merge.cpp, metaballs.cpp, spheres.cpp, spiral.cpp, square_volume.cpp, thread.cpp, threadStud.cpp, and tube.cpp.

◆ text()

dialog & coat::dialog::text ( const char * id)

pass the header text of the dialog

Parameters
idthe text or text identifier that will be used to take the text from the language file. You may press F9 to localize it in UI.
Returns
the reference to pass multiple options at chain.
Examples
Arrays.cpp, HelloWorld.cpp, Strings.cpp, TreesGenerator.cpp, and dialogs.cpp.

◆ topRight()

dialog & coat::dialog::topRight ( )

place the dialog at the top-right position of the viewport

Returns
itself

◆ transparentBackground()

dialog & coat::dialog::transparentBackground ( )

the background will not be faded

Returns
itself

◆ undoWorks()

dialog & coat::dialog::undoWorks ( )

allow undo (CTR-Z) act even in modal dialog

Returns
itself

◆ warn()

dialog & coat::dialog::warn ( )

add Warning icon

Returns
itself

◆ width()

dialog & coat::dialog::width ( int w)

change the default width

Parameters
wthe width will be scaled in correspondence with the font size, so you may pass absolute values like 500
Returns
itself

◆ yes()

dialog & coat::dialog::yes ( )

add Yes button

Returns
itself

The documentation for this class was generated from the following file: