Progress bar

You will find a general example for the use of progress here.

Version :
06.02.2024, 10:21 Uhr

Progress bar

static int start(char* titel, int steps = 24)

Show the progress bar.When processing several scripts (Panel actions for several selected document frames) a progress bar will be opened and closed again at the end of the batch processing. In this case each script may use 24 steps. The progress will be automatically closed again at the end of the script.

The funktion is empty under comet_pdf.

Name Type Default Description
Return int   0 or ErrorCode
titel String or char* - window title. At the start the windows title and the caption will be used for the chapter.
steps int 24 number of steps.
progress::start (title);

The number of steps can be defined as of Version 1.1.10 (25 May 2005) angegeben werden.

priint:comet InDesign® Plug-Ins, comet_pdf

progress::unit
progress::stop
comet.progress.start

static int stop()

Close the progress bar. Scripts can only close the progress provided they themselves opened it.

The funktion is empty under comet_pdf.

Name Type Default Description
Return int   0 or ErrorCode
progress::stop ();


priint:comet InDesign® Plug-Ins, comet_pdf

progress::start
comet.progress.stop

static int unit(char* chapter, int index = 0)

Chanage the chapter caption for the bar. If an index is defined, it will be attached to the chapter caption.

The funktion is empty under comet_pdf.

Name Type Default Description
Return int   0 or ErrorCode
chapter String oder char* - Chapter caption
index int 0 Chapter number
progress::unit ("Chapter", 3);


priint:comet InDesign® Plug-Ins, comet_pdf

static int step(char* label, int n = 0)

Call this before processing a task. Calling this will move the progress bar for any previously called tasks. The label is changed immediately.

Due to an InDesign® bug, the first call to the function does NOT change the label. Obviously Adobe repaints the window after progress bar changes only.

The funktion is empty under comet_pdf.

In the batch operation the maximum number of 24 steps for scripts must be observed.

Name Type Default Description
Return int   0 or ErrorCode
label char* - New sub-title under the bar
n int 0 Number of steps that the bar is to be repositioned forwards


priint:comet InDesign® Plug-Ins, comet_pdf

comet.progress.step

int one_step (int t)
{
    int 			i;
    char			task [256];
sprintf (task, "%d ...", t); progress::step(task, 1);
for (i=0; i < 1000000; i++) { }
return 0; }
int main () { int i; int m = 5;
progress::start ("It' a test", m);
for (i = 1; i <= m; i++) { one_step (i); }
progress::step ("Done", 0); progress::stop();
return 0; }

Author
Paul Seidel
Version
06.02.2024, 10:21 Uhr
Since
Plugin Version 1.0.14

Alphabetic index HTML hierarchy of classes or Java