update scroll func

This commit is contained in:
hi80482 2020-07-31 18:39:23 +08:00 committed by GitHub
parent fd75bef052
commit 8fbeb22c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,30 +152,28 @@ class LanguagesPage(Page):
self._Scroller.Init() self._Scroller.Init()
self._Scroller.SetCanvasHWND(self._HWND) self._Scroller.SetCanvasHWND(self._HWND)
# def ScrollDown(self):
# if len(self._MyList) == 0:
# return
# self._PsIndex +=1
# if self._PsIndex >= len(self._MyList):
# self._PsIndex = len(self._MyList) -1
def ScrollDown(self): # cur_li = self._MyList[self._PsIndex]
if len(self._MyList) == 0: # if cur_li._PosY +cur_li._Height > self._Height:
return # for i in range(0,len(self._MyList)):
self._PsIndex +=1 # self._MyList[i]._PosY -= self._MyList[i]._Height
if self._PsIndex >= len(self._MyList):
self._PsIndex = len(self._MyList) -1
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY +cur_li._Height > self._Height:
for i in range(0,len(self._MyList)):
self._MyList[i]._PosY -= self._MyList[i]._Height
def ScrollUp(self):
if len(self._MyList) == 0:
return
self._PsIndex -= 1
if self._PsIndex < 0:
self._PsIndex = 0
cur_li = self._MyList[self._PsIndex]
if cur_li._PosY < 0:
for i in range(0, len(self._MyList)):
self._MyList[i]._PosY += self._MyList[i]._Height
# def ScrollUp(self):
# if len(self._MyList) == 0:
# return
# self._PsIndex -= 1
# if self._PsIndex < 0:
# self._PsIndex = 0
# cur_li = self._MyList[self._PsIndex]
# if cur_li._PosY < 0:
# for i in range(0, len(self._MyList)):
# self._MyList[i]._PosY += self._MyList[i]._Height
def Click(self): def Click(self):
if len(self._MyList) == 0: if len(self._MyList) == 0:
@ -216,7 +214,8 @@ class LanguagesPage(Page):
thelang = thelang.strip() thelang = thelang.strip()
if thelang == "": if thelang == "":
thelang = "English" # thelang = "English"
thelang = "DEOT"
for i in self._MyList: for i in self._MyList:
if thelang in i._Value: if thelang in i._Value:
@ -305,5 +304,3 @@ def Init(main_screen):
OBJ.Init(main_screen) OBJ.Init(main_screen)
def API(main_screen): def API(main_screen):
OBJ.API(main_screen) OBJ.API(main_screen)