def Draw(self):
        self.ClearCanvas()

        if is_wifi_connected_now() == False:
            self._Icons["needwifi_bg"].NewCoord(self._Width/2, self._Height/2)
            self._Icons["needwifi_bg"].Draw()
            return
        
        self._Icons["bg"].NewCoord(self._Width/2,self._Height/2-20)
        self._Icons["bg"].Draw()
        
        percent = self._Value
        if percent < 10:
            percent = 10

        
        rect_ = midRect(self._Width/2,self._Height/2+33,170,17, Width,Height)
        aa_round_rect(self._CanvasHWND,rect_,MySkinManager.GiveColor('TitleBg'),5,0,MySkinManager.GiveColor('TitleBg'))
        
        rect2 = midRect(self._Width/2,self._Height/2+33,int(170*(percent/100.0)),17, Width,Height)
        rect2.left = rect_.left
        rect2.top  = rect_.top
        aa_round_rect(self._CanvasHWND,rect2,MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front'))

        rect3 = midRect(self._Width/2,self._Height/2+53,self._FileNameLabel._Width, self._FileNameLabel._Height,Width,Height)

        rect4 = midRect(self._Width/2,self._Height/2+70,self._SizeLabel._Width, self._SizeLabel._Height,Width,Height)

        self._FileNameLabel.NewCoord(rect3.left,rect3.top)
        self._SizeLabel.NewCoord(rect4.left, rect4.top)

        self._FileNameLabel.Draw()
        self._SizeLabel.Draw()
Beispiel #2
0
    def Draw(self):
        self.ClearCanvas()

        self._BGpng.NewCoord(self._Width / 2, self._Height / 2 - 10)
        self._BGpng.Draw()
        self._BGlabel.NewCoord(self._Width / 2 - 28, self._Height / 2 - 30)
        self._BGlabel.Draw()

        self._FreeLabel.NewCoord(self._BGlabel._PosX + 10, self._Height / 2)
        self._FreeLabel.Draw()

        #bgcolor = (238,238,238), fgcolor = (126,206,244)
        #aa_round_rect
        usage_percent = (self._DskUsg[0] / self._DskUsg[1])
        if usage_percent < 0.1:
            usage_percent = 0.1

        rect_ = midRect(self._Width / 2, self._Height - 30, 170, 17, Width,
                        Height)

        aa_round_rect(self._CanvasHWND, rect_, MySkinManager.GiveColor('Line'),
                      5, 0, MySkinManager.GiveColor('Line'))

        rect2 = midRect(self._Width / 2, self._Height - 30,
                        int(170 * (1.0 - usage_percent)), 17, Width, Height)

        rect2.left = rect_.left
        rect2.top = rect_.top

        aa_round_rect(self._CanvasHWND, rect2,
                      MySkinManager.GiveColor('Front'), 5, 0,
                      MySkinManager.GiveColor('Front'))
Beispiel #3
0
    def Draw(self):
        _contWidth = 280
        _contHeight = 40
        _contRadius = 4
        _segWidth = 20
        _segHeight = 20
        _segSpace = 10

        _contX = (Width - _contWidth) / 2
        _contY = Height - (_contHeight * 3)  # Offset from bottom

        # Draw the container
        container_rect = pygame.Rect(_contX, _contY, _contWidth, _contHeight)

        aa_round_rect(self._CanvasHWND, container_rect,
                      MySkinManager.GiveColor("UI_Base"), _contRadius)

        # Draw the empty segments
        for i in range(0, len(self.snd_segs)):
            segment_rect = pygame.Rect(
                _contX + _segSpace + (i * (_segWidth + _segSpace)),
                _contY + _segSpace, _segWidth, _segHeight)
            self._CanvasHWND.fill(MySkinManager.GiveColor("UI_Background"),
                                  segment_rect)

        # Draw the segments for the current volume
        for i in range(0, self._Needle + 1):
            segment_rect = pygame.Rect(
                _contX + _segSpace + (i * (_segWidth + _segSpace)),
                _contY + _segSpace, _segWidth, _segHeight)
            self._CanvasHWND.fill(MySkinManager.GiveColor("UI_Foreground"),
                                  segment_rect)
Beispiel #4
0
    def Draw(self):
        #aa_round_rect(self._CanvasHWND, (4,24.5+6,312,60),self._BackgroundColor,4,0,self._BackgroundColor)

        aa_round_rect(self._CanvasHWND,
                      (self._PosX, self._PosY, self._Width, self._Height),
                      self._BackgroundColor, 4, 0, self._BackgroundColor)

        self.BlitText()
    def Draw(self):

        start_rect = midRect(self._PosX + self._StartX,
                             self._StartY + self._Value, self._Width,
                             self._Height, self._Parent._Width,
                             self._Parent._Height)
        aa_round_rect(self._CanvasHWND, start_rect, self._Color, 3, 0,
                      self._Color)
Beispiel #6
0
    def Draw(self):
        # 200 total width
        # h = 40
        for i in range(0, self._Needle + 1):
            #w = 10,h = 40
            vol_rect = pygame.Rect(80 + i * 20, self._Height / 2 + 20, 10, 40)

            aa_round_rect(self._CanvasHWND, vol_rect,
                          MySkinManager.GiveColor("Front"), 3, 0,
                          MySkinManager.GiveColor("Front"))
Beispiel #7
0
 def Draw(self):
     idx = self._Parent._PsIndex
     if idx < len(self._Parent._MyList):
         y = self._Parent._MyList[idx]._PosY+1
         h = self._Parent._MyList[idx]._Height -3
         
         self._PosY = y
         self._Height = h
         
         aa_round_rect(self._Parent._CanvasHWND,  
                       (self._PosX,self._PosY,self._Width-4,self._Height),self._BackgroundColor,4,0,self._BackgroundColor)
Beispiel #8
0
    def Draw(self):
        idx = self._Parent._PsIndex
        if idx < len( self._Parent._WirelessList):
            x = self._Parent._WirelessList[idx]._PosX+11
            y = self._Parent._WirelessList[idx]._PosY+1
            h = self._Parent._WirelessList[idx]._Height -3
        
            self._PosX = x
            self._PosY = y
            self._Height = h

            aa_round_rect(self._Parent._CanvasHWND,  
                          (x,y,self._Width,h),self._BackgroundColor,4,0,self._BackgroundColor)
Beispiel #9
0
    def Draw(self):
        sec_idx = self._Parent._SectionIndex
        row_idx = self._Parent._RowIndex
        idx     = self._Parent._PsIndex
        
        x       = self._Parent._SecsKeys[sec_idx][row_idx][idx]._PosX
        y       = self._Parent._SecsKeys[sec_idx][row_idx][idx]._PosY
        w       = self._Parent._SecsKeys[sec_idx][row_idx][idx]._Width+6
        h       = self._Parent._SecsKeys[sec_idx][row_idx][idx]._Height+1

        rect    = midRect(x,y,w,h,self._Parent._Width,self._Parent._Height)
        if rect.width <=0 or rect.height <= 0 :
            return

        aa_round_rect(self._Parent._CanvasHWND,rect, (126,206,244),3,0,(126,206,244))
Beispiel #10
0
    def Draw(self):
        # 200 total width
        # h = 40
        ge = 0
        for i, v in enumerate(self.snd_segs):
            if self._Value >= v[0] and self._Value <= v[1]:
                ge = i
                break

        for i in range(0, ge + 1):
            #w = 10,h = 40
            vol_rect = pygame.Rect(80 + i * 20, self._Height / 2 + 20, 10, 40)

            aa_round_rect(self._CanvasHWND, vol_rect, self._ValColor, 3, 0,
                          self._ValColor)
Beispiel #11
0
    def Draw(self):
        idx = self._Parent._PsIndex
        if idx > (len(self._Parent._MyList) - 1):
            idx = len(self._Parent._MyList)
            if idx > 0:
                idx -= 1
            elif idx == 0:  #Nothing
                return

        x = self._Parent._MyList[idx]._PosX + 2
        y = self._Parent._MyList[idx]._PosY + 1
        h = self._Parent._MyList[idx]._Height - 3

        self._PosX = x
        self._PosY = y
        self._Height = h

        aa_round_rect(self._Parent._CanvasHWND, (x, y, self._Width - 4, h),
                      self._BackgroundColor, 4, 0, self._BackgroundColor)
Beispiel #12
0
    def Draw(self):
        start_rect = midRect(self._PosX, self._PosY, self._Width, self._Height,
                             Width, Height)
        aa_round_rect(self._CanvasHWND, start_rect, self._Color, 3, 0,
                      self._Color)

        if self._Value > 10:
            vol_height = int(self._Height * (float(self._Value) / 100.0))
            dheight = self._Height - vol_height

            vol_rect = pygame.Rect(self._PosX - self._Width / 2,
                                   self._PosY - self._Height / 2 + dheight,
                                   self._Width, vol_height)

            aa_round_rect(self._CanvasHWND, vol_rect, self._ValColor, 3, 0,
                          self._ValColor)

        else:
            vol_height = 10
            dheight = self._Height - vol_height
            vol_rect = pygame.Rect(self._PosX - self._Width / 2,
                                   self._PosY - self._Height / 2 + dheight,
                                   self._Width, vol_height)

            aa_round_rect(self._CanvasHWND, vol_rect, self._ValColor, 3, 0,
                          self._ValColor)