Progress |
modules/Progress.ycp |
Progress bar | |
|
|
This module has an unstable interface. |
Functions for progress bar.Dialog Title [x] Stage 1 [x] Stage 2 => Stage 3 - Stage 4 - Stage 5 Progress Title [============================90%=======================------]Example of progress bar usage (don't forget the translation marks in your code): Progress bar supposes main wizard dialog is created. Progress::Simple ("Some progress bar", "Progress runs here...", 3, ""); Progress::NextStep (); // the 1st one does nothing! Progress::NextStep (); Progress::NextStep (); Progress::NextStep ();Another example: Progress::New ("Complex progress bar", " ", 100, [ "Stage1", "Stage2", "Stage3", ], [ "Stage 1 ...", "Stage 2 ...", "Stage 3 ...", "Finished", ], "Help text"); Progress::NextStage (); Progress::NextStageStep (20); Progress::Stage (0, "I am back", 2); Progress::Title ("Still in stage 0"); Progress::NextStageStep (90); Progress::Finish ();It is possible to add a detailed subprogress above the main progress bar: // create a standard progress Progress::New(...); // add a subprogress with 42 steps Progress::SubprogressType(`progress, 42); Progress::SubprogressTitle("Subprogress label"); // set the subprogress value Progress::SubprogressValue(12); Progress::SubprogressValue(24); // remove the subprogress (it's only for the current task/stage) Progress::SubprogressType(`none, nil); // next stage Progress::NextStage();See also hand made documentation. Progress.html Imports
StructuresGlobal Functions
Local Functions |
Sets progress bar state: on = normal operation, off = All Progress:: calls return immediatelly.
- Parameters:
-
state on or off
- Return value:
-
previous state
Returns currently selected visibility status of all UI-modifying Progress:: functions.
- Return value:
-
whether the progress bar is used
This function is deprecated. Use set instead.
Turns progress bar off. All Progress:: calls return immediatelly.
This function is deprecated. Use set instead.
Turns progress bar on after calling Progress::off.
- Parameters:
-
kind `todo, `current or `done
- Return value:
-
UI mark for stages
- Parameters:
-
i stage number
- Return value:
-
widget `id(...) for the marker
New complex progress bar with stages.
- Parameters:
-
window_title title of the window progress_title title of the progress bar. Pass at least " " (one space) if you want some progress bar title. length number of steps. If 0, no progress bar is created, there are only stages and bottom title. THIS IS NOT NUMBER OF STAGES! stg list of strings - stage names. If it is nil, then there are no stages. tits Titles corresponding to stages. When stage changes, progress bar title changes to one of these titles. May be nil/empty. help_text help text
Get current subprogress type
- Return value:
-
Current type of the subprogress widget - can be `progress, `tick or `none
Set value of the subprogress
- Parameters:
-
value Current value of the subprogress, if a tick subprogress is running the value is ignored and the next tick is displayed
Create (or remove) a new subprogress above the progress bar, can be use for detailed progress of the current task
- Parameters:
-
type type of the subprogress widget, can be `progress (standard progress), `tick (tick progress) or `none (no subprogress, intended for removing the progress bar from the dialog) max_value maximum value for `progress type, for the other types it is not relevant (use any integer value or nil)
Set the label of the subprogress
- Parameters:
-
title New label for the subprogress
Function adds icon-support to progress dialog. Parameters are the same as for Progress::New() function with one parameter added.
Structure icons_definition = $[
[ // first 'visible' "/path/to/icon-highlighted.png" "/path/to/another-icon-highlighted.png", ] [ // then 'invisible' "/path/to/icon-gryscale.png", nil, // fallback icon will be used ], ]
- Parameters:
-
window_title progress_title length stg tits help_textmap icons_definition
Create simple progress bar with no stages, only with progress bar.
- Parameters:
-
window_title Title of the window. progress_title Title of the progress bar. length Number of steps. help_text Help text.
Highlights a progress icon (changes the dimmed one into a normal one).
- Parameters:
-
step_id
Uses current_step
the bar is either `ProgressBar or `Label
- Parameters:
-
s title
Some people say it is the best operating system ever. But now to the function. Advances progress bar value by 1.
Advance stage, advance step by 1 and set progress bar caption to that defined in New.
Changes progress bar value to st.
- Parameters:
-
st new value
Go to stage st, change progress bar title to title and set progress bar step to step.
- Parameters:
-
st New stage. title New title for progress bar. If nil, title specified in New is used. step New step or -1 if step should not change.
Jumps to the next stage and sets step to st.
- Parameters:
-
st new progress bar value
Change progress bar title.
- Parameters:
-
t new title. Use ""(empty string) if you want an empty progress bar.
Moves progress bar to the end and marks all stages as completed.
Creates a higher-level progress bar made of stages. Currently it is placed instead of help text.
- Parameters:
-
title title of the progress... stages list of stage descriptions
Replaces stages of superior progress by an empty help text.
Make one step in a superior progress bar.