Class: RWDProgressBar

Inherits:
RWDWindow show all
Defined in:
lib/rwd/rwd.rb

Instance Method Summary collapse

Methods inherited from RWDWindow

#render

Constructor Details

#initialize(refresh, progress) ⇒ RWDProgressBar

Returns a new instance of RWDProgressBar.



747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
# File 'lib/rwd/rwd.rb', line 747

def initialize(refresh, progress)
  s	= ""
  s << "<window title='RWD Progress' nobackbuttons noclosebutton refresh='#{refresh}'>"
  if progress.length == 1
    progress.each do |caption, value|
      s << "<p>#{caption}</p><progressbar value='#{value}'/><p>#{(100*value).to_i}%%</p>"
    end
  else
    s << "<table>"
    progress.each do |caption, value|
      s << "<row><p align='left'>#{caption}</p><progressbar value='#{value}'/><p align='right'>#{(100*value).to_i}%%</p></row>"
    end
    s << "</table>"
  end
  s << "<cancel/>"
  s << "</window>"
  super(s)
end