3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
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.
 
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
 
int show ()
 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 The function looks lite:
 
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

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

Examples
Arrays.cpp, HelloWorld.cpp, HoneyComb.cpp, Strings.cpp, TreesGenerator.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.

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()

dialog & coat::dialog::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()

dialog & coat::dialog::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()

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.

◆ process()

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 ( )

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 The function looks lite:

def press(index):
if index == 1:
print("Ok pressed, usually it is left button, so it las index 1, indices start from 1 and grow to the right")
Parameters
pressthe callback/lambda
Returns
itself

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: