FormProgressDialog

A progress dialog provides feedback for actions that take a long time to execute.When the progress value reaches 100 the dialog automatically closes.

Example

app = cf.GetApplication()
project = app:NewProject()

form = cf.Form.New()

    -- Create a 'FormProgressDialog' item
    
formProgressDialog = cf.FormProgressDialog.New("Loop example","Progress")

    -- Log the progress while work is done

for i = 1, 100 do
    for j = 1, 1000 do    
        -- Do some interesting calculations or work
    end    
    -- formProgressDialog:LogProgress(i)
end

Usage locations

The FormProgressDialog object can be accessed from the following locations:

Property List

Cancelled
This property is true if the cancel button was pressed, else it remains false.It is reset when the Reset method is called. (Read only boolean)
Height
The height in pixels of the form window. (Read only number)
Label
The label of the progress dialog. (Read/Write string)
Title
The title that will be displayed in the title bar at the top of the form. (Read/Write string)
Type
The object type string. (Read only string)
Value
The progress bar's current progress value from 0 to 100. (Read only number)
Width
The width in pixels of the form window. (Read only number)

Method List

LogProgress (progress number)
This method shows the progress dialog form and updates the progress value. Pressing the Cancel button will close the form.
LogProgress (progress number, label string)
This method shows the progress dialog form and updates the progress value and caption. Pressing the Cancel button will close the form.
Reset ()
Resets the progress dialog. This sets the progress value back to zero, resets the cancelled status and hides the dialog.The label of the dialog remains unchanged.
SetSize (width number, height number)
Set the width and height of the form in pixels. The width and height must be larger than zero and they cannot exceed the current screen resolution. If the size is set the dialog will no longer auto-resize.

Constructor Function List

New (title string, label string)
Creates a new progress dialog form with a specified label. (Returns a FormProgressDialog object.)
New ()
Creates a new progress dialog form. (Returns a FormProgressDialog object.)

Property Details

Cancelled
This property is true if the cancel button was pressed, else it remains false.It is reset when the Reset method is called.
Type
boolean
Access
Read only
Height
The height in pixels of the form window.
Type
number
Access
Read only
Label
The label of the progress dialog.
Type
string
Access
Read/Write
Title
The title that will be displayed in the title bar at the top of the form.
Type
string
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only
Value
The progress bar's current progress value from 0 to 100.
Type
number
Access
Read only
Width
The width in pixels of the form window.
Type
number
Access
Read only

Method Details

LogProgress (progress number)
This method shows the progress dialog form and updates the progress value. Pressing the Cancel button will close the form.
Input Parameters
progress(number)
Updates the progress value of the progress bar on the dialog. Progress is only valid from 0 to 100. If values outside this range are given an error will be thrown.
LogProgress (progress number, label string)
This method shows the progress dialog form and updates the progress value and caption. Pressing the Cancel button will close the form.
Input Parameters
progress(number)
Updates the progress value of the progress bar on the dialog. Progress is only valid from 0 to 100. If values outside this range are given an error will be thrown.
label(string)
Updates the label of the progress dialog.
Reset ()
Resets the progress dialog. This sets the progress value back to zero, resets the cancelled status and hides the dialog.The label of the dialog remains unchanged.
SetSize (width number, height number)
Set the width and height of the form in pixels. The width and height must be larger than zero and they cannot exceed the current screen resolution. If the size is set the dialog will no longer auto-resize.
Input Parameters
width(number)
Width of the form in pixels.
height(number)
Height of the form in pixels.

Static Function Details

New (title string, label string)
Creates a new progress dialog form with a specified label.
Input Parameters
title(string)
The form window title.
label(string)
The form label.
Return
FormProgressDialog
The newly created progress dialog form.
New ()
Creates a new progress dialog form.
Return
FormProgressDialog
The newly created progress dialog form.