Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2023.
Loading...
Searching...
No Matches
SDialog Class Reference

Provide simple dialog creation methods. More...

Public Member Functions

boolean AddImage (string imgPath, number width=-1, number height=-1, boolean keepRatio=true)
 Adds a new image to the Dialog. More...
 
 AddLine (string label, boolean isInput, Object labParams={}, number defaultInput=0)
 Adds a new line to the Dialog. More...
 
 AddLine (string label, boolean isInput, Object labParams={}, number defaultInput=0)
 Adds a new line to the Dialog. More...
 
 AddLine (string label, boolean isInput, Object labParams={}, string defaultInput="")
 Adds a new line to the Dialog. More...
 
 AddOutput (string label, string output, Object labParams={}, Object outParams={})
 Adds a new output line to the Dialog. More...
 
Object Execute ()
 Executes the dialog box. More...
 
 SDialog (string title="Dialog")
 Dialog constructor. More...
 
string toString ()
 Get the type of the variable. More...
 

Static Public Member Functions

static SDialog New (string title="Dialog")
 Dialog constructor. More...
 

Detailed Description

Provide simple dialog creation methods.

See also Creating Custom Form page for details on how to use this class.

Constructor & Destructor Documentation

◆ SDialog()

SDialog::SDialog ( string  title = "Dialog")

Dialog constructor.

Parameters
title(string) Window title

Member Function Documentation

◆ AddImage()

boolean SDialog::AddImage ( string  imgPath,
number  width = -1,
number  height = -1,
boolean  keepRatio = true 
)

Adds a new image to the Dialog.

Supported formats include PNG, JPG, JPEG, BMP and more.

Parameters
imgPath(string) Image path
width(number) Image width. Negative to ignore.
height(number) Image height. Negative to ignore.
keepRatio(boolean) Should the original size ratio be respected?
Returns
(boolean) true if success, false if failure

◆ AddLine() [1/3]

SDialog::AddLine ( string  label,
boolean  isInput,
Object  labParams = {},
number  defaultInput = 0 
)

Adds a new line to the Dialog.

Either a simple line with a single label, or also with a text input field. The resulting inputs are then returned by the Execute() method

Parameters
label(string) Label text
isInput(boolean) Should the line include a text input field?
labParams(Object) Label text parameters, as associative array. Available key parameters :
  • align (string): text alignment
  • size (number): text size in points (pt)
  • color (string): text color. You can specify a color using different formats (like with CSS):either #rgb / #rrggbb / the color name (same names as CSS color names).
  • css (string): Additional custom CSS code
defaultInput(number) Default text if input field

◆ AddLine() [2/3]

SDialog::AddLine ( string  label,
boolean  isInput,
Object  labParams = {},
number  defaultInput = 0 
)

Adds a new line to the Dialog.

Either a simple line with a single label, or also with a text input field. The resulting inputs are then returned by the Execute() method

Parameters
label(string) Label text
isInput(boolean) Should the line include a text input field?
labParams(Object) Label text parameters, as associative array. Available key parameters :
  • align (string): text alignment
  • size (number): text size in points (pt)
  • color (string): text color. You can specify a color using different formats (like with CSS):either #rgb / #rrggbb / the color name (same names as CSS color names).
  • css (string): Additional custom CSS code
defaultInput(number) Default text if input field

◆ AddLine() [3/3]

SDialog::AddLine ( string  label,
boolean  isInput,
Object  labParams = {},
string  defaultInput = "" 
)

Adds a new line to the Dialog.

Either a simple line with a single label, or also with a text input field. The resulting inputs are then returned by the Execute() method

Parameters
label(string) Label text
isInput(boolean) Should the line include a text input field?
labParams(Object) Label text parameters, as associative array. Available key parameters :
  • align (string): text alignment
  • size (number): text size in points (pt)
  • color (string): text color. You can specify a color using different formats (like with CSS):either #rgb / #rrggbb / the color name (same names as CSS color names).
  • css (string): Additional custom CSS code
defaultInput(string) Default text if input field

◆ AddOutput()

SDialog::AddOutput ( string  label,
string  output,
Object  labParams = {},
Object  outParams = {} 
)

Adds a new output line to the Dialog.

Parameters
label(string) Label text
output(string) Output text
labParams(Object) Label text parameters, as associative array. Available key parameters :
  • align (string): text alignment
  • size (number): text size in points (pt)
  • color (string): text color. You can specify a color using different formats (like with CSS):either #rgb / #rrggbb / the color name (same names as CSS color names).
  • css (string): Additional custom CSS code
outParams(Object) Output text parameters (same usage as with labParams)
  • align (string): text alignment
  • size (number): text size in points (pt)
  • color (string): text color. You can specify a color using different formats (like with CSS):either #rgb / #rrggbb / the color name (same names as CSS color names).
  • css (string): Additional custom CSS code

◆ Execute()

Object SDialog::Execute ( )

Executes the dialog box.

Return values
ret.ErrorCode(number) The error code
  • 0: The OK button was pressed
  • 1: The Dialog was canceled / closed or an error occurred
ret.InputTbl(Array<string>) The resulting user input strings (in the same order as the input lines)

◆ New()

static SDialog SDialog::New ( string  title = "Dialog")
static

Dialog constructor.

Parameters
title(string) Window title
Returns
(SDialog) The new SDialog.

◆ toString()

string SDialog::toString ( )

Get the type of the variable.

Returns
(string) The type name