Class: CWM::ProgressBar
- Inherits:
-
CustomWidget
- Object
- AbstractWidget
- CustomWidget
- CWM::ProgressBar
- Defined in:
- library/cwm/src/lib/cwm/progress_bar.rb
Overview
Widget for a progress bar
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from AbstractWidget
#handle_all_events, #widget_id
Instance Method Summary collapse
- #contents ⇒ Object
-
#forward ⇒ Object
Moves the progress forward and sets the next step as label if needed (see #show_steps?).
-
#initialize ⇒ ProgressBar
constructor
Constructor.
-
#steps ⇒ Array<String>
Steps for the progress bar.
Methods inherited from CustomWidget
#cwm_contents, #cwm_definition, #find_ids, #ids_in_contents
Methods inherited from AbstractWidget
#cleanup, #cwm_definition, #disable, #displayed?, #enable, #enabled?, #focus, #fun_ref, #handle, #help, #init, #label, #my_event?, #opt, #refresh_help, #store, #validate, widget_type=
Constructor Details
#initialize ⇒ ProgressBar
Constructor
41 42 43 44 45 |
# File 'library/cwm/src/lib/cwm/progress_bar.rb', line 41 def initialize super @current_step_index = 0 end |
Instance Method Details
#contents ⇒ Object
48 49 50 |
# File 'library/cwm/src/lib/cwm/progress_bar.rb', line 48 def contents ProgressBar(Id(), current_label, total_steps, current_step_index) end |
#forward ⇒ Object
Moves the progress forward and sets the next step as label if needed (see #show_steps?)
53 54 55 56 57 58 59 |
# File 'library/cwm/src/lib/cwm/progress_bar.rb', line 53 def forward return if complete? @current_step_index += 1 refresh end |
#steps ⇒ Array<String>
Steps for the progress bar
66 |
# File 'library/cwm/src/lib/cwm/progress_bar.rb', line 66 abstract_method :steps |