Package pyforms :: Package terminal :: Package Controls :: Module ControlProgress |
[hide private]
[frames] | no frames]

# Source Code for Module pyforms.terminal.Controls.ControlProgress

     1  from pyforms.terminal.Controls.ControlBase import ControlBase
     2
     3 -class ControlProgress(ControlBase):
     4
     5      _min = 0
     6      _max = 100
     7
     8 -    def __init__(self, label = "%p%", defaultValue = 0, min = 0, max = 100, helptext=None):
     9          self._updateSlider = True
    10          self._min = min
    11          self._max = max
    12          ControlBase.__init__(self, label, defaultValue)
    13
    14
    15 -    def initControl(self):
    16          #return """<div id='id%s' class='progressbar' ></div>""" %  ( self._name )
    17          return "controls.push(new ControlProgress('"+self._name+"'));"
    18
    19      @property
    20 -    def value(self): return self._value
    21
    22      @value.setter
    23 -    def value(self, value): self._form.horizontalSlider.setValue( value )
    24
    25      @property
    26 -    def min(self): return self._form.horizontalSlider.minimum()
    27
    28      @min.setter
    29 -    def min(self, value): self._form.horizontalSlider.setMinimum(value)
    30
    31      @property
    32 -    def max(self): return self._form.horizontalSlider.maximum()
    33
    34      @max.setter
    35 -    def max(self, value): self._form.horizontalSlider.setMaximum(value)
    36