Dialog Class Reference

The Dialog JavaScript class. A simplified version of the Qt dialog. More...

Public Slots

void newTab (String &label)
 Adds a new tab to the dialog. More...
 
void newColumn ()
 Add a new column to the dialog. More...
 
void addSpace (int space)
 Adds spacers to the dialog layout. More...
 
void add (SCRIPT_QSWidget *widget)
 Adds a widget to the dialog. More...
 
bool exec ()
 Run the dialog in modal mode. Pressing ok accepts the dialog input. Pressing cancel cancels the dialog. More...
 

Properties

String title
 The title of the dialog. More...
 
String caption
 The title of the dialog. (Legacy, but still supported) More...
 
int width
 The width of the dialog in pixels. More...
 
String okButtonText
 The label of the OK button. More...
 
String cancelButtonText
 The label of the Cancel button. More...
 

Detailed Description

The Dialog JavaScript class. A simplified version of the Qt dialog.

This class and the associated widget classes are used to build simple dialogs.

function sampleDialog()
{
var d = new Dialog();
d.title = "Sample Dialog";
var inputL = new LineEdit;
inputL.label = "Sample Line Edit";
d.add( inputL );
if ( d.exec() )
{
var sampleText = inputL.text;
MessageLog.trace("The input text is " + sampleText + ".");
}
}

The widgets you can add to a Dialog are: LineEdit, NumberEdit, TimeEdit, DateEdit, SpinBox, CheckBox, RadioButton, ComboBox, GroupBox, Slider, Button and Label

Member Function Documentation

◆ add

void Dialog::add ( SCRIPT_QSWidget *  widget)
slot

Adds a widget to the dialog.

◆ addSpace

void Dialog::addSpace ( int  space)
slot

Adds spacers to the dialog layout.

myDialog.addSpace( 25 );

◆ exec

bool Dialog::exec ( )
slot

Run the dialog in modal mode. Pressing ok accepts the dialog input. Pressing cancel cancels the dialog.

◆ newColumn

void Dialog::newColumn ( )
slot

Add a new column to the dialog.

myDialog.newColumn();

◆ newTab

void Dialog::newTab ( String &  label)
slot

Adds a new tab to the dialog.

myDialog.newTab(“This is your tab label”);

Property Documentation

◆ cancelButtonText

String Dialog::cancelButtonText
readwrite

The label of the Cancel button.

myDialog.cancelButtonText = “Click here to reject”;

◆ caption

String Dialog::caption
readwrite

The title of the dialog. (Legacy, but still supported)

myDialog.caption = “My First Dialog”;

◆ okButtonText

String Dialog::okButtonText
readwrite

The label of the OK button.

myDialog.okButtonText = “Click here to accept”;

◆ title

String Dialog::title
readwrite

The title of the dialog.

myDialog.title = “My First Dialog”;

◆ width

int Dialog::width
readwrite

The width of the dialog in pixels.

myDialog.width = 500;