NAME

IUP::ProgressDlg - [pre-defined dialog] displaying the progress of an operation

DESCRIPTION

Creates a progress dialog element. It is a predefined dialog for displaying the progress of an operation. The dialog is meant to be shown with the show functions Popup or ShowXY.

USAGE

CREATION - new() method

 $progressdlg = IUP::ProgressDlg->new( TITLE=>"Hello" );

Returns: the identifier of the created element, or undef if an error occurs.

NOTE: You can pass to new() other ATTRIBUTE=>'value' or CALLBACKNAME=>\&func pairs relevant to this element - see IUP::Manual::02_Elements.

ATTRIBUTES

For more info about concept of attributes (setting/getting values etc.) see IUP::Manual::03_Attributes. Attributes specific to this element:

Supports all the IUP::Dialog attributes. But some attributes where changed to configure the dialog. We recommend changing only the following attributes:

TITLE

(non inheritable) Dialog’s title. If not set the title bar will not be displayed and the dialog will occupy less space on screen.

VISIBLE

Simply call Show or Hide for the dialog.

PARENTDIALOG

(creation only) Name of a dialog to be used as parent. This dialog will be always in front of the parent dialog.

TITLE

Dialog title.

New attributes (all non inheritable):

COUNT

current count of iterations.

INC

(write-only) increment the current count by the given amount. If set to undef will increment +1.

PERCENT

current percent of iterations.

TOTALCOUNT

total number of iterations.

STATE

describe the state of the iteration. Can be: 'IDLE', 'PROCESSING', 'UNDEFINED' or 'ABORTED'. Default is 'IDLE'. When INC, COUNT or PERCENT are set the state is changed to 'PROCESSING'. If the user pressed the Cancel button the state is changed to 'ABORTED', but check the CANCEL_CB callback for other options. If the state is set to 'UNDEFINED' by the application the progress bar will display an undefined state animation (same as setting MARQUEE=Yes in IUP::ProgressBar), to resume processing set the state attribute to 'PROCESSING'.

DESCRIPTION

text description to be shown at the dialog.

CALLBACKS

For more info about concept of callbacks (setting callback handlers etc.) see IUP::Manual::04_Callbacks. Callbacks specific to this element:

Supports all the IUP::Dialog callbacks + following new callbacks:

CANCEL_CB

Action generated when the user clicked on the Cancel button.

Callback handler prototype:

 sub cancel_cb_handler {
   my ($self) = @_;
   #...
 }

$self: reference to the element (IUP::ProgressDlg) that activated the event

Returns: if different from IUP_CONTINUE then STATE will be changed to ABORTED, same behavior as if the callback does not exist.

NOTES

The IUP::ProgressDlg will display the iteration state using a IUP::ProgressBar control.

The dialog is not automatically closed, the application must do that manually inside the CANCEL_CB callback or inside your processing loop by checking the STATE attribute.

EXAMPLES

The element IUP::ProgressDlg is used in the following sample scripts:

SEE ALSO

IUP::ProgressBar, IUP::Dialog

The original doc: iupprogressdlg.html