fm_user_cancelled


bool fm_user_cancelled ( void )


 

Description


Allows you to determine if the user has pressed the cancel button on a progress bar.

 

Parameters


There are no parameters for this function.

 

Return


Returns true if the user has cancelled.

 

Errors


There are no errors for this function.

 

Example 1 - Concatenate 3 strings
$name = 'Test';
$steps = 10;
$message = 'Testing, one moment please...';
$left = 25;
$top = 50;
$enableCancelButton = true;
$cancelButtonLabel = 'Stop';
fm_new_progress_bar($name, $steps, $message, $left, $top, $enableCancelButton, $cancelButtonLabel);
for ($i = 0; $i < $steps ; $i++) {
   sleep(1); // this is where you would do your processing
   fm_update_progress_bar($name, 1, $message . " step " . ($i + 1));
   if (fm_user_cancelled() === true) break;
}
// Make sure to close the progress bar.
fm_close_progress_bar($name);

Change Log

VersionDescription
3.0.0New function – returns true if the user has pressed the cancel button on a progress bar.