add bluetooth info page

This commit is contained in:
cuu
2018-08-20 22:10:50 +08:00
parent 586a76d37b
commit da2d61366f
5 changed files with 318 additions and 78 deletions

View File

@@ -17,62 +17,12 @@ from UI.scroller import ListScroller
from UI.confirm_page import ConfirmPage
from UI.skin_manager import SkinManager
from UI.info_page_list_item import InfoPageListItem
from net_item import NetItem
import myvars
class InfoPageListItem(object):
_PosX = 0
_PosY = 0
_Width = 0
_Height = 30
_Labels = {}
_Icons = {}
_Fonts = {}
_LinkObj = None
def __init__(self):
self._Labels = {}
self._Icons = {}
self._Fonts = {}
def SetSmallText(self,text):
l = Label()
l._PosX = 40
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["small"])
self._Labels["Small"] = l
def Init(self,text):
#self._Fonts["normal"] = fonts["veramono12"]
l = Label()
l._PosX = 10
l.SetCanvasHWND(self._Parent._CanvasHWND)
l.Init(text,self._Fonts["normal"])
self._Labels["Text"] = l
def Draw(self):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw()
if "Small" in self._Labels:
self._Labels["Small"]._PosX = self._Width - self._Labels["Small"]._Width-5
self._Labels["Small"]._PosY = self._PosY + (self._Height - self._Labels["Small"]._Height)/2
self._Labels["Small"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,SkinManager().GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)
class WifiDisconnectConfirmPage(ConfirmPage):
_ConfirmText = "Confirm Disconnect?"