Class: Conquer::Dzen::Graphics::ProgressBar

Inherits:
Graphic
  • Object
show all
Defined in:
lib/conquer/dzen/graphics/progress_bar.rb

Direct Known Subclasses

Battery

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Graphic

#move, #to_s

Methods included from Positioning

#ignore_bg, #lock_x, #shift, #unlock_x

Constructor Details

#initialize(progress, width, height, orientation = :horizontal) ⇒ ProgressBar

Returns a new instance of ProgressBar.



10
11
12
13
14
15
16
17
18
19
# File 'lib/conquer/dzen/graphics/progress_bar.rb', line 10

def initialize(progress, width, height, orientation = :horizontal)
  super()
  @progress = progress
  @width = width
  @height = height
  @orientation = orientation
  @template = '^ib(1)^p(_LOCK_X)%s%s^p(_UNLOCK_X)^ib(0)'
  @template << shift(width, 0)
  @template_args = [outline, fill]
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



8
9
10
# File 'lib/conquer/dzen/graphics/progress_bar.rb', line 8

def height
  @height
end

#orientationObject (readonly)

Returns the value of attribute orientation.



8
9
10
# File 'lib/conquer/dzen/graphics/progress_bar.rb', line 8

def orientation
  @orientation
end

#progressObject (readonly)

Returns the value of attribute progress.



8
9
10
# File 'lib/conquer/dzen/graphics/progress_bar.rb', line 8

def progress
  @progress
end

#widthObject (readonly)

Returns the value of attribute width.



8
9
10
# File 'lib/conquer/dzen/graphics/progress_bar.rb', line 8

def width
  @width
end