Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

bool fm_user_cancelled 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.

 

Code Block
languagephp
themeEclipse
titleExample 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.