Progress Bar Functions
Set-up a progress bar for your macro. Using a progress bar helps you and other users of your macro to estimate the remaining time for the macro execution.
gd.getProgress
This command has no return value but creates a progress bar object that is shown in GeoDict with the passed number of steps and the passed text as description. The progress bar remains visible until the object runs out of scope or is explicitly deleted. It is possible to use the progress bar as a context manager.
Input:
- progress bar name, string
- total number of steps, integer
- splash screen name, string (optional)
- Displays the given splash screen in the progress dialog. Entering a random string displays the default GeoDict splash screen. Omit parameter or enter an empty string ('') to obtain a progress dialog without a splash screen.
- show graph, bool (optional)
- Add a graph to progress dialog if True is entered. No graph is displayed if the parameter is omitted or set to False.
- show stop button (optional)
- Add a stop button to the progress dialog if set to True. No stop button will be added if parameter is omitted or set to False.
Sub functions:
.update
Updates the progress bar to the specified step. I
Input:
- Input: step number, integer
|
.updateWithGraph
Updates the progress bar to the specified step and also displays and updates a graph with the given values.
Input:
- step number, integer
- X-axis label, string
- X-value, integer or float
- Y-axis label, string
- Y-value, integer or float
|
.wasCancelled
Checks if the cancel button was hit and returns True or False.
Input: None
|
.wasStopped
Checks if the stop button was hit and returns True or False.
Input: None
|
Example 1 - simple
Example 2 - with graph
Example 3 - Use "with" instead of "del"