# Path: e3d/gui/TextEnums.py
# class FontWeightEnum(object):
#     Light = .4
#     Normal = .6
#     Bold = .9
# 
# Path: e3d/gui/PanelClass.py
# class Panel(BaseControl):
#     """
#         Flat container for Gui objects.
# 
#        @rtype : Panel
#     """
# 
#     def __init__(self, left, top, width, height, parent, pinning=PinningEnum.TopLeft, color=None, ID=None,
#                  imgID=None, rotation=None, style=None):
#         style = style or DefaultStyle(color)
#         if color is None:
#             color = style.backgroundColor
#         super(Panel, self).__init__(left, top, width, height, parent, pinning, color, ID, imgID, rotation,
#                                     style)
#         self._passEventDown = True
# 
# Path: e3d/commonValues.py
# def scaleNumber(val, src, dst):
#     """
#     http://stackoverflow.com/a/4155197
# 
#     Scale the given value from the scale of src to the scale of dst.
# 
#     @rtype : int
#     @type dst: list
#     @type src: list
#     @type val: int
# 
#     Examples:
#     >> scaleNumber(0, (0.0, 99.0), (-1.0, 1.0))
#     -1.0
#     >> scaleNumber(99, (0.0, 99.0), (-1.0, 1.0))
#     1
#     >> scaleNumber(1, (0.0, 2.0), (0.0, 1.0))
#     0.5
#     """
#     try:
#         return ((val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]
#     except ZeroDivisionError:
#         return dst[1] / 2.0


from .LabelClass import *
from .TextEnums import FontWeightEnum
from ..Colors import *
from .Styling import *
from .PanelClass import Panel
from ..commonValues import scaleNumber

    def _setFont(self, fontID):
        self._label.fontID = fontID

    def _getFont(self):
        return self._label.fontID

    fontID = property(_getFont, _setFont)

    def _reStyle(self):
        super(ProgressBar, self)._reStyle()
        barStyle = self.style._copy()
        self._pbar.style = barStyle
        self._pbar.borderSize = 0
        self._buildColors()

    @property
    def value(self):
        return self._value

    @value.setter
    def value(self, val):
        self._dirty = True
        self._value = val
        self._buildValues()

    def _getPercentage(self):
        maximum = self.maximum
        minimum = self.minimum
        value = self._clampValue()

# Path: e3d/gui/TextEnums.py
# class FontWeightEnum(object):
#     Light = .4
#     Normal = .6
#     Bold = .9
# 
# Path: e3d/gui/PanelClass.py
# class Panel(BaseControl):
#     """
#         Flat container for Gui objects.
# 
#        @rtype : Panel
#     """
# 
#     def __init__(self, left, top, width, height, parent, pinning=PinningEnum.TopLeft, color=None, ID=None,
#                  imgID=None, rotation=None, style=None):
#         style = style or DefaultStyle(color)
#         if color is None:
#             color = style.backgroundColor
#         super(Panel, self).__init__(left, top, width, height, parent, pinning, color, ID, imgID, rotation,
#                                     style)
#         self._passEventDown = True
# 
# Path: e3d/commonValues.py
# def scaleNumber(val, src, dst):
#     """
#     http://stackoverflow.com/a/4155197
# 
#     Scale the given value from the scale of src to the scale of dst.
# 
#     @rtype : int
#     @type dst: list
#     @type src: list
#     @type val: int
# 
#     Examples:
#     >> scaleNumber(0, (0.0, 99.0), (-1.0, 1.0))
#     -1.0
#     >> scaleNumber(99, (0.0, 99.0), (-1.0, 1.0))
#     1
#     >> scaleNumber(1, (0.0, 2.0), (0.0, 1.0))
#     0.5
#     """
#     try:
#         return ((val - src[0]) / (src[1] - src[0])) * (dst[1] - dst[0]) + dst[0]
#     except ZeroDivisionError:
#         return dst[1] / 2.0


# Path: e3d/gui/ProgressbarClass.py
from .LabelClass import *
from .TextEnums import FontWeightEnum
from ..Colors import *
from .Styling import *
from .PanelClass import Panel
from ..commonValues import scaleNumber


    def _setFont(self, fontID):
        self._label.fontID = fontID

    def _getFont(self):
        return self._label.fontID

    fontID = property(_getFont, _setFont)

    def _reStyle(self):
        super(ProgressBar, self)._reStyle()
        barStyle = self.style._copy()
        self._pbar.style = barStyle
        self._pbar.borderSize = 0
        self._buildColors()

    @property
    def value(self):
        return self._value

    @value.setter
    def value(self, val):
        self._dirty = True
        self._value = val
        self._buildValues()

    def _getPercentage(self):
        maximum = self.maximum
        minimum = self.minimum
        value = self._clampValue()

        value = scaleNumber(value, (minimum, maximum), (0, 100))