Class: Iup::ProgressBar
Overview
A progress bar control, showing a percent-complete value. Typically used to show the progress of a long-running task running within a Timer.
Example
The following creates a vertical bar, starting at a value of 25 out of 50.
Iup::ProgressBar.new do |p|
p.orientation = 'vertical'
p.bgcolor = '255 0 128'
p.fgcolor = '0 128 0'
p.rastersize = '30x100'
p.max = 50
p.value = 25
end
Also see: ProgressDialog, Timer.
Instance Attribute Summary
Attributes inherited from Widget
Instance Method Summary collapse
-
#dashed ⇒ Object
:attr: dashed Changes style of progress bar to a dashed pattern, as ‘yes’ / ‘no’.
-
#expand ⇒ Object
:attr: expand Allows bar to fill available space in indicated direction.
-
#initialize {|_self| ... } ⇒ ProgressBar
constructor
Creates an instance of a progress bar.
-
#marquee ⇒ Object
:attr: marquee Displays an undefined state if set.
-
#max ⇒ Object
:attr: max maximum value, default 1.
-
#min ⇒ Object
:attr: min minimum value, default 0.
-
#orientation ⇒ Object
:attr: orientation ‘horizontal’ / ‘vertical’.
-
#position ⇒ Object
:attr_reader: position returns position in pixels within client window as “x,y”.
-
#rastersize ⇒ Object
:attr: rastersize Size of the widget, in pixels, value as “widthxheight”.
-
#screenposition ⇒ Object
:attr_reader: screenposition returns position in pixels on screen as “x,y”.
-
#tip ⇒ Object
:attr: tip Tooltip string.
-
#value ⇒ Object
:attr: value number between
minandmax, for current position.
Methods inherited from Widget
#active, #assign_handle, #bgcolor, #destroy, #enterwindow_cb=, #fgcolor, #font, #getfocus_cb=, #help_cb=, #k_any=, #killfocus_cb=, #leavewindow_cb=, #map_cb=, #maxsize, #minsize, #open_controls, #size, #unmap_cb=, #visible, #wid, #zorder
Methods included from AttributeBuilders
#define_attribute, #define_id_attribute, #define_id_reader, #define_id_writer, #define_property_attribute, #define_property_reader, #define_property_writer, #define_reader, #define_writer
Methods included from CallbackSetter
Constructor Details
#initialize {|_self| ... } ⇒ ProgressBar
Creates an instance of a progress bar. If a block is given, the new instance is yielded to it.
26 27 28 29 30 31 |
# File 'lib/wrapped/progressbar.rb', line 26 def initialize @handle = IupLib.IupProgressBar # run any provided block on instance, to set up further attributes yield self if block_given? end |
Instance Method Details
#dashed ⇒ Object
:attr: dashed Changes style of progress bar to a dashed pattern, as ‘yes’ / ‘no’.
38 |
# File 'lib/wrapped/progressbar.rb', line 38 define_attribute :dashed |
#expand ⇒ Object
:attr: expand Allows bar to fill available space in indicated direction. Values ‘no’ / ‘horizontal’ / ‘vertical’ / ‘yes’.
44 |
# File 'lib/wrapped/progressbar.rb', line 44 define_attribute :expand |
#marquee ⇒ Object
:attr: marquee Displays an undefined state if set. Values ‘yes’ / ‘no’.
49 |
# File 'lib/wrapped/progressbar.rb', line 49 define_attribute :marquee |
#max ⇒ Object
:attr: max maximum value, default 1.
54 |
# File 'lib/wrapped/progressbar.rb', line 54 define_attribute :max |
#min ⇒ Object
:attr: min minimum value, default 0.
59 |
# File 'lib/wrapped/progressbar.rb', line 59 define_attribute :min |
#orientation ⇒ Object
:attr: orientation ‘horizontal’ / ‘vertical’.
64 |
# File 'lib/wrapped/progressbar.rb', line 64 define_attribute :orientation |
#position ⇒ Object
:attr_reader: position returns position in pixels within client window as “x,y”.
69 |
# File 'lib/wrapped/progressbar.rb', line 69 define_reader :position |
#rastersize ⇒ Object
:attr: rastersize Size of the widget, in pixels, value as “widthxheight”.
74 |
# File 'lib/wrapped/progressbar.rb', line 74 define_attribute :rastersize |
#screenposition ⇒ Object
:attr_reader: screenposition returns position in pixels on screen as “x,y”.
79 |
# File 'lib/wrapped/progressbar.rb', line 79 define_reader :screenposition |
#tip ⇒ Object
:attr: tip Tooltip string.
84 |
# File 'lib/wrapped/progressbar.rb', line 84 define_attribute :tip |
#value ⇒ Object
:attr: value number between min and max, for current position.
89 |
# File 'lib/wrapped/progressbar.rb', line 89 define_attribute :value |