main_screen.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. # -*- coding: utf-8 -*-
  2. import pygame
  3. from pygame.locals import *
  4. from sys import exit
  5. import os
  6. import sys
  7. import json
  8. from operator import itemgetter
  9. from libs import easing
  10. from datetime import datetime
  11. from beeprint import pp
  12. ## local package import
  13. from constants import ICON_TYPES,icon_ext,icon_width,icon_height,RUNEVT
  14. from icon_item import IconItem
  15. from page import Page,PageStack
  16. from title_bar import TitleBar
  17. from foot_bar import FootBar
  18. from constants import Width,Height,bg_color
  19. from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable,SkinMap
  20. from keys_def import CurKeys
  21. from label import Label
  22. from untitled_icon import UntitledIcon
  23. from Emulator import MyEmulator
  24. from CommercialSoftwarePackage import MyCommercialSoftwarePackage
  25. from skin_manager import MySkinManager
  26. from lang_manager import MyLangManager
  27. from widget import Widget
  28. from counter_screen import CounterScreen
  29. class MessageBox(Label):
  30. _Parent = None
  31. def __init__(self):
  32. pass
  33. def Init(self,text,font_obj,color=MySkinManager.GiveColor('Text')):
  34. self._Color = color
  35. self._FontObj = font_obj
  36. self._Text = text
  37. self._Width = 0
  38. self._Height = 0
  39. self._CanvasHWND = pygame.Surface( ( int(self._Parent._Width),int(self._Parent._Height)))
  40. self._HWND = self._Parent._CanvasHWND
  41. def SetText(self,text):
  42. self._Text = MyLangManager.Tr(text)
  43. def PreDraw(self):
  44. self._Width = 0
  45. self._Height = 0
  46. self._CanvasHWND.fill(MySkinManager.GiveColor('White'))
  47. words = self._Text.split(' ')
  48. space = self._FontObj.size(' ')[0]
  49. max_width = self._Parent._Width-40
  50. x ,y = (0,0)
  51. row_total_width = 0
  52. lines = 0
  53. for word in words:
  54. word_surface = self._FontObj.render(word, True, self._Color)
  55. word_width = word_surface.get_width()
  56. word_height = word_surface.get_height()
  57. row_total_width += word_width
  58. if lines == 0:
  59. lines += word_height
  60. if row_total_width+space >= max_width:
  61. x = 0 # Reset the x.
  62. y += word_height # Start on new row.
  63. row_total_width = word_width
  64. lines += word_height
  65. self._CanvasHWND.blit(word_surface, (x, y))
  66. if len(words) == 1: # single line
  67. x += word_width
  68. else:
  69. x += word_width + space
  70. if x > self._Width:
  71. self._Width = x
  72. if lines >= (self._Parent._Height - 40):
  73. break
  74. self._Height = lines
  75. def DrawWith(self, x_,y_, withborder):
  76. self.PreDraw()
  77. x_ = x_ - self._Width/2
  78. y_ = y_ - self._Height/2
  79. padding = 5
  80. pygame.draw.rect(self._HWND,MySkinManager.GiveColor('White'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2))
  81. if self._HWND != None:
  82. rect = pygame.Rect(x_,y_,self._Width,self._Height)
  83. self._HWND.blit(self._CanvasHWND,rect,(0,0,self._Width,self._Height))
  84. #self._HWND.blit(self._CanvasHWND,rect)
  85. if withborder == True:
  86. pygame.draw.rect(self._HWND,MySkinManager.GiveColor('Black'),(x_-padding,y_-padding, self._Width+padding*2,self._Height+padding*2),1)
  87. def Draw(self):
  88. x = (self._Parent._Width)/2
  89. y = (self._Parent._Height)/2
  90. self.DrawWith(x,y,True)
  91. python_package_flag = "__init__.py"
  92. emulator_flag = "action.config"
  93. commercialsoftware_flag = "compkginfo.json"
  94. ##Abstract object for manage Pages ,not the pygame's physic screen
  95. class MainScreen(Widget):
  96. _Pages = []
  97. _PageMax = 0
  98. _PageIndex = 0
  99. _PosY = TitleBar._BarHeight+1
  100. _Width = Width
  101. _Height = Height -FootBar._BarHeight -TitleBar._BarHeight
  102. _MyPageStack = None
  103. _CurrentPage = None # pointer to the current displaying Page Class
  104. _CanvasHWND = None
  105. _HWND = None
  106. _TitleBar = None
  107. _FootBar = None
  108. _MsgBox = None
  109. _MsgBoxFont = MyLangManager.TrFont("veramono20")
  110. _IconFont = MyLangManager.TrFont("varela15")
  111. _SkinManager = None
  112. _Closed = False
  113. _CounterScreen = None
  114. def __init__(self):
  115. self._Pages = []
  116. self._MyPageStack = PageStack()
  117. def Init(self):
  118. self._CanvasHWND = pygame.Surface((self._Width,self._Height))
  119. self._MsgBox= MessageBox()
  120. self._MsgBox._Parent= self
  121. self._MsgBox.Init(" ", self._MsgBoxFont)
  122. self._SkinManager = MySkinManager
  123. self._CounterScreen = CounterScreen()
  124. self._CounterScreen._HWND = self._HWND
  125. self._CounterScreen.Init()
  126. def FartherPages(self):
  127. self._PageMax = len(self._Pages)
  128. for i in range(0,self._PageMax):
  129. self._Pages[i]._Index = i
  130. self._Pages[i]._CanvasHWND = self._CanvasHWND
  131. self._Pages[i]._IconNumbers = len(self._Pages[i]._Icons)
  132. self._Pages[i]._Screen = self
  133. self._Pages[i].Adjust()
  134. if self._Pages[i]._IconNumbers > 1:
  135. self._Pages[i]._PsIndex = 1
  136. self._Pages[i]._IconIndex = self._Pages[i]._PsIndex
  137. self._CurrentPage = self._Pages[self._PageIndex]
  138. self._CurrentPage._OnShow = True
  139. def GetMyRightSidePage(self):
  140. ret = self._PageIndex +1
  141. if ret > (self._PageMax -1):
  142. ret = self._PageMax -1
  143. return ret
  144. def PageMoveLeft(self):
  145. self._Pages[self._PageIndex]._OnShow = False
  146. if self._PageIndex < (self._PageMax - 1):
  147. my_right_side_page = self.GetMyRightSidePage()
  148. for i in range(0,self._PageMax):
  149. if i!= self._PageIndex and i != my_right_side_page:
  150. self._Pages[i].MoveLeft(Width)
  151. self._Pages[self._PageIndex].EasingLeft(Width)
  152. if self._PageIndex != my_right_side_page:
  153. self._Pages[my_right_side_page].EasingLeft(Width)
  154. self._Pages[self._PageIndex].ResetPageSelector()
  155. self._PageIndex+=1
  156. if self._PageIndex > (self._PageMax -1):
  157. self._PageIndex = (self._PageMax -1)
  158. self._Pages[self._PageIndex]._OnShow = True
  159. self._CurrentPage = self._Pages[self._PageIndex]
  160. def GetMyLeftSidePage(self):
  161. ret = self._PageIndex -1
  162. if ret < 0:
  163. ret = 0
  164. return ret
  165. def PageMoveRight(self):
  166. self._Pages[self._PageIndex]._OnShow = False
  167. if self._PageIndex > 0:
  168. my_left_side_page = self.GetMyLeftSidePage()
  169. for i in range(0,self._PageMax):
  170. if i!= self._PageIndex and i!= my_left_side_page:
  171. pass
  172. #self._Pages[i].MoveRight(Width)
  173. self._Pages[self._PageIndex].EasingRight(Width)
  174. if self._PageIndex != my_left_side_page:
  175. self._Pages[my_left_side_page].EasingRight(Width)
  176. self._Pages[self._PageIndex].ResetPageSelector()
  177. self._PageIndex-=1
  178. if self._PageIndex < 0:
  179. self._PageIndex = 0
  180. self._Pages[self._PageIndex]._OnShow = True
  181. self._CurrentPage = self._Pages[self._PageIndex]
  182. def EasingAllPageLeft(self):
  183. current_time = 0.0
  184. start_posx = 0.0
  185. current_posx = start_posx
  186. final_posx = float(Width)
  187. posx_init = 0
  188. dur = 30
  189. last_posx = 0.0
  190. all_last_posx = []
  191. if self._PageIndex >= (self._PageMax - 1):
  192. return
  193. for i in range(0,Width*dur):
  194. current_posx = easing.SineIn(current_time,start_posx,final_posx-start_posx,float(dur))
  195. if current_posx >= final_posx:
  196. current_posx = final_posx
  197. dx = current_posx - last_posx
  198. all_last_posx.append(int(dx))
  199. current_time+=1
  200. last_posx = current_posx
  201. if current_posx >= final_posx:
  202. break
  203. c = 0
  204. for i in all_last_posx:
  205. c+=i
  206. if c < final_posx - start_posx:
  207. all_last_posx.append( final_posx - c )
  208. for i in all_last_posx:
  209. self.ClearCanvas()
  210. for j in self._Pages:
  211. j._PosX -= i
  212. j.DrawIcons()
  213. j._Screen.SwapAndShow()
  214. self._Pages[self._PageIndex]._OnShow = False
  215. self._PageIndex+=1
  216. if self._PageIndex > (self._PageMax -1):
  217. self._PageIndex = (self._PageMax -1)
  218. self._Pages[self._PageIndex]._OnShow = True
  219. self._CurrentPage = self._Pages[self._PageIndex]
  220. def EasingAllPageRight(self):
  221. current_time = 0.0
  222. start_posx = 0.0
  223. current_posx = start_posx
  224. final_posx = float(Width)
  225. posx_init = 0
  226. dur = 30
  227. last_posx = 0.0
  228. all_last_posx = []
  229. if self._PageIndex <= 0:
  230. return
  231. for i in range(0,Width*dur):
  232. current_posx = easing.SineIn(current_time,start_posx,final_posx-start_posx,float(dur))
  233. if current_posx >= final_posx:
  234. current_posx = final_posx
  235. dx = current_posx - last_posx
  236. all_last_posx.append(int(dx))
  237. current_time+=1
  238. last_posx = current_posx
  239. if current_posx >= final_posx:
  240. break
  241. c = 0
  242. for i in all_last_posx:
  243. c+=i
  244. if c < final_posx - start_posx:
  245. all_last_posx.append( final_posx - c )
  246. for i in all_last_posx:
  247. self.ClearCanvas()
  248. for j in reversed(self._Pages):
  249. j._PosX += i
  250. j.DrawIcons()
  251. j._Screen.SwapAndShow()
  252. self._Pages[self._PageIndex]._OnShow = False
  253. self._PageIndex-=1
  254. if self._PageIndex < 0:
  255. self._PageIndex = 0
  256. self._Pages[self._PageIndex]._OnShow = True
  257. self._CurrentPage = self._Pages[self._PageIndex]
  258. def CurPage(self):
  259. return self._CurrentPage
  260. def PushCurPage(self):
  261. self._MyPageStack.Push(self._CurrentPage)
  262. def SetCurPage(self,page):
  263. self._CurrentPage = page
  264. on_load_cb = getattr(self._CurrentPage,"OnLoadCb",None)
  265. if on_load_cb != None:
  266. if callable( on_load_cb ):
  267. self._CurrentPage.OnLoadCb()
  268. def PushPage(self,page):
  269. self.PushCurPage()
  270. self.SetCurPage(page)
  271. def AppendPage(self,Page):
  272. self._Pages.append(Page)
  273. def ClearCanvas(self):
  274. self._CanvasHWND.fill(self._SkinManager.GiveColor('White'))
  275. def SwapAndShow(self):
  276. if self._Closed == True:
  277. return
  278. if self._HWND != None:
  279. self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
  280. pygame.display.update()
  281. def ExtraName(self,name):
  282. ## extra name like 1_xxx to be => xxx,
  283. parts = name.split("_")
  284. if len(parts) > 1:
  285. return parts[1]
  286. elif len(parts) == 1:
  287. return parts[0]
  288. else:
  289. return name
  290. def IsExecPackage(self,dirname):
  291. files = os.listdir(dirname)
  292. bname = os.path.basename(dirname)
  293. bname = self.ExtraName(bname)
  294. for i in sorted(files):
  295. if i == bname+".sh":
  296. return True
  297. return False
  298. def IsEmulatorPackage(self,dirname):
  299. files = os.listdir(dirname)
  300. for i in sorted(files):
  301. if i.endswith(emulator_flag):
  302. return True
  303. return False
  304. def IsCommercialPackage(self,dirname):
  305. files = os.listdir(dirname)
  306. for i in sorted(files):
  307. if i.endswith(commercialsoftware_flag):
  308. return True
  309. return False
  310. def IsPythonPackage(self,dirname):
  311. files = os.listdir(dirname)
  312. for i in sorted(files):
  313. if i.endswith(python_package_flag):
  314. return True
  315. return False
  316. def ReunionPagesIcons(self): #This is for combining /home/cpi/apps/Menu and ~/launcher/Menu/GameShell
  317. for p in self._Pages:
  318. tmp = []
  319. for i,x in enumerate(p._Icons):
  320. tup = ('',0)
  321. if hasattr(x, '_FileName'):
  322. if str.find(x._FileName,"_") < 0:
  323. tup = ("98_"+x._FileName,i) # prefer to maintain PowerOFF in last position if the filename has no order labels
  324. else:
  325. tup = (x._FileName, i)
  326. else:
  327. tup = ("",i)
  328. tmp.append(tup)
  329. tmp = sorted(tmp, key=itemgetter(0))
  330. retro_games_idx = []
  331. retro_games_dir = "20_Retro Games"
  332. for i,x in enumerate(tmp):
  333. if retro_games_dir in x[0]:
  334. retro_games_idx.append(x[1])
  335. if len(retro_games_idx) > 1:
  336. for i in range(1,len(retro_games_idx)):
  337. p._Icons[retro_games_idx[0]]._LinkPage._Icons.extend( p._Icons[retro_games_idx[i]]._LinkPage._Icons) ### assumes the folder of ~/apps/Menu/20_Retro Games is legalzip","sfc"],
  338. tmp_swap = []
  339. for i, x in enumerate(tmp):
  340. if retro_games_dir not in x[0]:
  341. tmp_swap.append(x)
  342. if retro_games_dir in x[0] and i == retro_games_idx[0]:
  343. tmp_swap.append(x)
  344. tmp = tmp_swap
  345. #print(tmp)
  346. new_icons = []
  347. for x in tmp:
  348. new_icons.append( p._Icons[ x[1] ] )
  349. p._Icons = new_icons
  350. def ReadTheDirIntoPages(self,_dir,pglevel,cur_page):
  351. global commercialsoftware_flag
  352. if FileExists(_dir) == False and os.path.isdir(_dir) == False:
  353. return
  354. files = os.listdir(_dir)
  355. for i in sorted(files):
  356. if os.path.isdir(_dir+"/"+i): # TOPLEVEL only is dir
  357. if pglevel == 0:
  358. page = Page()
  359. page._Name = self.ExtraName(i)
  360. page._Icons = []
  361. self._Pages.append(page)
  362. self.ReadTheDirIntoPages(_dir+"/"+i, pglevel+1 ,self._Pages[ len(self._Pages) -1])
  363. else: ## On CurPage now
  364. i2 = self.ExtraName(i)
  365. iconitem = IconItem()
  366. iconitem._FileName = i
  367. iconitem._CmdPath = ""
  368. iconitem.AddLabel(MyLangManager.Tr(i2),self._IconFont)
  369. if FileExists( _dir+"/"+i+"/"+i2+".png"): ### 20_Prog/Prog.png , cut 20_
  370. iconitem._ImageName = _dir+"/"+i+"/"+i2+".png"
  371. elif FileExists( SkinMap(_dir+"/"+i2+".png") ):
  372. iconitem._ImageName = SkinMap(_dir+"/"+i2+".png")
  373. else:
  374. untitled = UntitledIcon()
  375. untitled.Init()
  376. if len(i2) > 1:
  377. untitled.SetWords(i2[:2])
  378. elif len(i2) == 1:
  379. untitled.SetWords([i2[0],i2[0]])
  380. else:
  381. untitled.SetWords(["G","s"])
  382. iconitem._ImgSurf = untitled.Surface()
  383. iconitem._ImageName = ""
  384. if self.IsPythonPackage(_dir+"/"+i):
  385. iconitem._MyType = ICON_TYPES["FUNC"]
  386. sys.path.append(_dir)
  387. iconitem._CmdPath = __import__(i)
  388. init_cb = getattr(iconitem._CmdPath,"Init",None)
  389. if init_cb != None:
  390. if callable(init_cb):
  391. iconitem._CmdPath.Init(self)
  392. cur_page._Icons.append(iconitem)
  393. elif self.IsEmulatorPackage(_dir+"/"+i):
  394. obj = {}
  395. obj["ROM"] = ""
  396. obj["ROM_SO"] =""
  397. obj["EXT"] = []
  398. obj["EXCLUDE"] = []
  399. obj["FILETYPE"] = "file"
  400. obj["LAUNCHER"] = ""
  401. obj["TITLE"] = "Game"
  402. obj["SO_URL"] = ""
  403. obj["RETRO_CONFIG"] = "" ##
  404. try:
  405. f = open(_dir+"/"+i+"/"+emulator_flag)
  406. except IOError:
  407. print("action config open failed")
  408. return
  409. else:
  410. with f:
  411. content = f.readlines()
  412. content = [x.strip() for x in content]
  413. for c in content:
  414. pis = c.split("=")
  415. if len(pis) > 1:
  416. if "EXT" in pis[0]:
  417. obj[pis[0]] = pis[1].split(",")
  418. elif "EXCLUDE" in pis[0]:
  419. obj[pis[0]] = pis[1].split(",")
  420. else:
  421. obj[pis[0]] = pis[1]
  422. if FileExists(_dir+"/"+i+"/retroarch-local.cfg"):
  423. obj["RETRO_CONFIG"] = CmdClean(os.path.abspath( _dir+"/"+i+"/retroarch-local.cfg" ))
  424. print("a local retroarch cfg:", obj["RETRO_CONFIG"])
  425. em = MyEmulator()
  426. em._Emulator = obj
  427. em.Init(self)
  428. iconitem._CmdPath = em
  429. iconitem._MyType = ICON_TYPES["Emulator"]
  430. cur_page._Icons.append(iconitem)
  431. elif self.IsCommercialPackage( os.path.join(_dir,i)):
  432. data = None
  433. em = MyCommercialSoftwarePackage()
  434. if FileExists( _dir+"/"+i+"/.done"):
  435. print(_dir+"/"+i+"/.done")
  436. em._Done = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
  437. else:
  438. with open(os.path.join(_dir,i) +"/"+commercialsoftware_flag) as f:
  439. data = json.load(f)
  440. em._ComPkgInfo = data
  441. em._Done = ""
  442. em._InvokeDir = os.path.realpath( os.path.join(_dir,i))
  443. em.Init(self)
  444. iconitem._CmdPath = em
  445. iconitem._MyType = ICON_TYPES["Commercial"]
  446. cur_page._Icons.append(iconitem)
  447. elif self.IsExecPackage(_dir+"/"+i): ## ExecPackage is the last one to check
  448. iconitem._MyType = ICON_TYPES["EXE"]
  449. iconitem._CmdPath = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
  450. MakeExecutable(iconitem._CmdPath)
  451. cur_page._Icons.append(iconitem)
  452. else:
  453. iconitem._MyType = ICON_TYPES["DIR"]
  454. iconitem._LinkPage = Page()
  455. iconitem._LinkPage._Name = i2
  456. cur_page._Icons.append(iconitem)
  457. self.ReadTheDirIntoPages(_dir+"/"+i,pglevel+1,iconitem._LinkPage)
  458. elif os.path.isfile(_dir+"/"+i) and pglevel > 0:
  459. if i.lower().endswith(icon_ext):
  460. i2 = self.ExtraName(i)
  461. #cmd = ReadTheFileContent(_dir+"/"+i)
  462. iconitem = IconItem()
  463. iconitem._FileName = i
  464. iconitem._CmdPath = os.path.realpath(_dir+"/"+i)
  465. MakeExecutable(iconitem._CmdPath)
  466. iconitem._MyType = ICON_TYPES["EXE"]
  467. if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))):
  468. iconitem._ImageName = SkinMap(_dir+"/"+ReplaceSuffix(i2,"png"))
  469. else:
  470. untitled = UntitledIcon()
  471. untitled.Init()
  472. if len(i2) > 1:
  473. untitled.SetWords(i2[:2])
  474. elif len(i2) == 1:
  475. untitled.SetWords([i2[0],i2[0]])
  476. else:
  477. untitled.SetWords(["G","s"])
  478. iconitem._ImgSurf = untitled.Surface()
  479. iconitem._ImageName = ""
  480. iconitem.AddLabel(MyLangManager.Tr(i2.split(".")[0]),self._IconFont)
  481. iconitem._LinkPage = None
  482. cur_page._Icons.append(iconitem)
  483. def RunEXE(self,cmdpath):
  484. self.DrawRun()
  485. self.SwapAndShow()
  486. pygame.time.delay(1000)
  487. cmdpath = cmdpath.strip()
  488. cmdpath = CmdClean(cmdpath)
  489. pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
  490. def OnExitCb(self,event):
  491. ## leave rest to Pages
  492. on_exit_cb = getattr(self._CurrentPage,"OnExitCb",None)
  493. if on_exit_cb != None:
  494. if callable( on_exit_cb ):
  495. self._CurrentPage.OnExitCb(event)
  496. return
  497. def KeyDown(self,event):
  498. """
  499. if event.key == pygame.K_PAGEUP:
  500. self.EasingAllPageLeft()
  501. #self.SwapAndShow()
  502. if event.key == pygame.K_PAGEDOWN:
  503. self.EasingAllPageRight()
  504. #self.SwapAndShow()
  505. """
  506. if event.key == pygame.K_t:
  507. self.DrawRun()
  508. self.SwapAndShow()
  509. """
  510. if event.key == CurKeys["Space"]:
  511. self._CounterScreen.Draw()
  512. self._CounterScreen.SwapAndShow()
  513. self._CounterScreen.StartCounter()
  514. """
  515. ## leave rest to Pages
  516. current_page_key_down_cb = getattr(self._CurrentPage,"KeyDown",None)
  517. if current_page_key_down_cb != None:
  518. if callable( current_page_key_down_cb ):
  519. self._CurrentPage.KeyDown(event)
  520. def DrawRun(self):
  521. self._MsgBox.SetText(MyLangManager.Tr("Launching"))
  522. self._MsgBox.Draw()
  523. def Draw(self):
  524. if self._Closed == True:
  525. return
  526. self._CurrentPage.Draw()
  527. #if self._HWND != None:
  528. # self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
  529. if self._TitleBar != None:
  530. self._TitleBar.Draw(self._CurrentPage._Name)
  531. if self._FootBar != None:
  532. if hasattr(self._CurrentPage,"_FootMsg"):
  533. self._FootBar.SetLabelTexts(self._CurrentPage._FootMsg)
  534. self._FootBar.Draw()