# 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

        super(ProgressBar, self).__init__(left, top, width, height, parent, pinning, color, ID, None, rotation, style)

        if styleHint in (StyleHintsEnum.Raised, StyleHintsEnum.Sunken):
            self.gradientType = GradientTypesEnum.Horizontal
        else:
            self.gradientType = GradientTypesEnum.noGradient

        self.borderColor = style.borderColor
        borderSize = style.borderSize
        self._label = Label(borderSize, borderSize, width - (borderSize * 2), str(value), self,
                            pinning=PinningEnum.TopLeftRight, ID=self.ID + '_label',
                            outlineLength=OutlineLenghtEnum.NoOutline)
        label = self._label
        label.borderSize = 0
        label.color = vec4(0)
        x, y, z = self.getAlignedPosition(label.size, self.size, self.borderSize, hAlign=self._hTextAlign)
        label.top = y
        label.vTextAlign = Align2DEnum.Center

        self._styleHint = styleHint
        barStyle = style._copy()
        barStyle.baseColor = self._barColor
        self._backgroundSize = 0
        bsize = self._backgroundSize
        dbsize = bsize * 2
        self._pbar = Panel(bsize, bsize, (self.width - dbsize) * (value / 100.0), self.height - dbsize, self,
                           PinningEnum.all, self._barColor, self.ID + '_bar', style=barStyle)
        self._pbar.gradientType = self.gradientType
        self._pbar.borderSize = 0

# 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


        super(ProgressBar, self).__init__(left, top, width, height, parent, pinning, color, ID, None, rotation, style)

        if styleHint in (StyleHintsEnum.Raised, StyleHintsEnum.Sunken):
            self.gradientType = GradientTypesEnum.Horizontal
        else:
            self.gradientType = GradientTypesEnum.noGradient

        self.borderColor = style.borderColor
        borderSize = style.borderSize
        self._label = Label(borderSize, borderSize, width - (borderSize * 2), str(value), self,
                            pinning=PinningEnum.TopLeftRight, ID=self.ID + '_label',
                            outlineLength=OutlineLenghtEnum.NoOutline)
        label = self._label
        label.borderSize = 0
        label.color = vec4(0)
        x, y, z = self.getAlignedPosition(label.size, self.size, self.borderSize, hAlign=self._hTextAlign)
        label.top = y
        label.vTextAlign = Align2DEnum.Center

        self._styleHint = styleHint
        barStyle = style._copy()
        barStyle.baseColor = self._barColor
        self._backgroundSize = 0
        bsize = self._backgroundSize
        dbsize = bsize * 2
        self._pbar = Panel(bsize, bsize, (self.width - dbsize) * (value / 100.0), self.height - dbsize, self,
                           PinningEnum.all, self._barColor, self.ID + '_bar', style=barStyle)
        self._pbar.gradientType = self.gradientType
        self._pbar.borderSize = 0

        self._PbarImage = Panel(bsize, bsize, (self.width - dbsize), self.height - dbsize, self._pbar, PinningEnum.all,