Class: Iup::ProgressBar

Inherits:
Widget
  • Object
show all
Defined in:
lib/wrapped/progressbar.rb

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

#handle

Instance Method Summary collapse

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

#define_callback

Constructor Details

#initialize {|_self| ... } ⇒ ProgressBar

Creates an instance of a progress bar. If a block is given, the new instance is yielded to it.

Yields:

  • (_self)

Yield Parameters:



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

#dashedObject

: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

#expandObject

: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

#marqueeObject

:attr: marquee Displays an undefined state if set. Values ‘yes’ / ‘no’.



49
# File 'lib/wrapped/progressbar.rb', line 49

define_attribute :marquee

#maxObject

:attr: max maximum value, default 1.



54
# File 'lib/wrapped/progressbar.rb', line 54

define_attribute :max

#minObject

:attr: min minimum value, default 0.



59
# File 'lib/wrapped/progressbar.rb', line 59

define_attribute :min

#orientationObject

:attr: orientation ‘horizontal’ / ‘vertical’.



64
# File 'lib/wrapped/progressbar.rb', line 64

define_attribute :orientation

#positionObject

:attr_reader: position returns position in pixels within client window as “x,y”.



69
# File 'lib/wrapped/progressbar.rb', line 69

define_reader :position

#rastersizeObject

:attr: rastersize Size of the widget, in pixels, value as “widthxheight”.



74
# File 'lib/wrapped/progressbar.rb', line 74

define_attribute :rastersize

#screenpositionObject

:attr_reader: screenposition returns position in pixels on screen as “x,y”.



79
# File 'lib/wrapped/progressbar.rb', line 79

define_reader :screenposition

#tipObject

:attr: tip Tooltip string.



84
# File 'lib/wrapped/progressbar.rb', line 84

define_attribute :tip

#valueObject

:attr: value number between min and max, for current position.



89
# File 'lib/wrapped/progressbar.rb', line 89

define_attribute :value