main_screen.py 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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
  19. from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable
  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("Eurostile20")
  110. _IconFont = MyLangManager.TrFont("Eurostile12")
  111. _SkinManager = None
  112. _Closed = False
  113. _CounterScreen = None
  114. _LastKey = -1
  115. _LastKeyDown = -1
  116. def __init__(self):
  117. self._Pages = []
  118. self._MyPageStack = PageStack()
  119. def Init(self):
  120. self._CanvasHWND = pygame.Surface((self._Width,self._Height))
  121. self._MsgBox= MessageBox()
  122. self._MsgBox._Parent= self
  123. self._MsgBox.Init(" ", self._MsgBoxFont)
  124. self._SkinManager = MySkinManager
  125. self._CounterScreen = CounterScreen()
  126. self._CounterScreen._HWND = self._HWND
  127. self._CounterScreen.Init()
  128. def FartherPages(self):
  129. self._PageMax = len(self._Pages)
  130. for i in range(0,self._PageMax):
  131. self._Pages[i]._Index = i
  132. self._Pages[i]._CanvasHWND = self._CanvasHWND
  133. self._Pages[i]._IconNumbers = len(self._Pages[i]._Icons)
  134. self._Pages[i]._Screen = self
  135. self._Pages[i].Adjust()
  136. if self._Pages[i]._IconNumbers > 1:
  137. self._Pages[i]._PsIndex = 1
  138. self._Pages[i]._IconIndex = self._Pages[i]._PsIndex
  139. self._CurrentPage = self._Pages[self._PageIndex]
  140. self._CurrentPage._OnShow = True
  141. def GetMyRightSidePage(self):
  142. ret = self._PageIndex +1
  143. if ret > (self._PageMax -1):
  144. ret = self._PageMax -1
  145. return ret
  146. def PageMoveLeft(self):
  147. self._Pages[self._PageIndex]._OnShow = False
  148. if self._PageIndex < (self._PageMax - 1):
  149. my_right_side_page = self.GetMyRightSidePage()
  150. for i in range(0,self._PageMax):
  151. if i!= self._PageIndex and i != my_right_side_page:
  152. self._Pages[i].MoveLeft(Width)
  153. self._Pages[self._PageIndex].EasingLeft(Width)
  154. if self._PageIndex != my_right_side_page:
  155. self._Pages[my_right_side_page].EasingLeft(Width)
  156. self._Pages[self._PageIndex].ResetPageSelector()
  157. self._PageIndex+=1
  158. if self._PageIndex > (self._PageMax -1):
  159. self._PageIndex = (self._PageMax -1)
  160. self._Pages[self._PageIndex]._OnShow = True
  161. self._CurrentPage = self._Pages[self._PageIndex]
  162. def GetMyLeftSidePage(self):
  163. ret = self._PageIndex -1
  164. if ret < 0:
  165. ret = 0
  166. return ret
  167. def PageMoveRight(self):
  168. self._Pages[self._PageIndex]._OnShow = False
  169. if self._PageIndex > 0:
  170. my_left_side_page = self.GetMyLeftSidePage()
  171. for i in range(0,self._PageMax):
  172. if i!= self._PageIndex and i!= my_left_side_page:
  173. pass
  174. #self._Pages[i].MoveRight(Width)
  175. self._Pages[self._PageIndex].EasingRight(Width)
  176. if self._PageIndex != my_left_side_page:
  177. self._Pages[my_left_side_page].EasingRight(Width)
  178. self._Pages[self._PageIndex].ResetPageSelector()
  179. self._PageIndex-=1
  180. if self._PageIndex < 0:
  181. self._PageIndex = 0
  182. self._Pages[self._PageIndex]._OnShow = True
  183. self._CurrentPage = self._Pages[self._PageIndex]
  184. def EasingAllPageLeft(self):
  185. current_time = 0.0
  186. start_posx = 0.0
  187. current_posx = start_posx
  188. final_posx = float(Width)
  189. posx_init = 0
  190. dur = 30
  191. last_posx = 0.0
  192. all_last_posx = []
  193. if self._PageIndex >= (self._PageMax - 1):
  194. return
  195. for i in range(0,Width*dur):
  196. current_posx = easing.SineIn(current_time,start_posx,final_posx-start_posx,float(dur))
  197. if current_posx >= final_posx:
  198. current_posx = final_posx
  199. dx = current_posx - last_posx
  200. all_last_posx.append(int(dx))
  201. current_time+=1
  202. last_posx = current_posx
  203. if current_posx >= final_posx:
  204. break
  205. c = 0
  206. for i in all_last_posx:
  207. c+=i
  208. if c < final_posx - start_posx:
  209. all_last_posx.append( final_posx - c )
  210. for i in all_last_posx:
  211. self.ClearCanvas()
  212. for j in self._Pages:
  213. j._PosX -= i
  214. j.DrawIcons()
  215. j._Screen.SwapAndShow()
  216. self._Pages[self._PageIndex]._OnShow = False
  217. self._PageIndex+=1
  218. if self._PageIndex > (self._PageMax -1):
  219. self._PageIndex = (self._PageMax -1)
  220. self._Pages[self._PageIndex]._OnShow = True
  221. self._CurrentPage = self._Pages[self._PageIndex]
  222. def EasingAllPageRight(self):
  223. current_time = 0.0
  224. start_posx = 0.0
  225. current_posx = start_posx
  226. final_posx = float(Width)
  227. posx_init = 0
  228. dur = 30
  229. last_posx = 0.0
  230. all_last_posx = []
  231. if self._PageIndex <= 0:
  232. return
  233. for i in range(0,Width*dur):
  234. current_posx = easing.SineIn(current_time,start_posx,final_posx-start_posx,float(dur))
  235. if current_posx >= final_posx:
  236. current_posx = final_posx
  237. dx = current_posx - last_posx
  238. all_last_posx.append(int(dx))
  239. current_time+=1
  240. last_posx = current_posx
  241. if current_posx >= final_posx:
  242. break
  243. c = 0
  244. for i in all_last_posx:
  245. c+=i
  246. if c < final_posx - start_posx:
  247. all_last_posx.append( final_posx - c )
  248. for i in all_last_posx:
  249. self.ClearCanvas()
  250. for j in reversed(self._Pages):
  251. j._PosX += i
  252. j.DrawIcons()
  253. j._Screen.SwapAndShow()
  254. self._Pages[self._PageIndex]._OnShow = False
  255. self._PageIndex-=1
  256. if self._PageIndex < 0:
  257. self._PageIndex = 0
  258. self._Pages[self._PageIndex]._OnShow = True
  259. self._CurrentPage = self._Pages[self._PageIndex]
  260. def CurPage(self):
  261. return self._CurrentPage
  262. def PushCurPage(self):
  263. self._MyPageStack.Push(self._CurrentPage)
  264. def SetCurPage(self,page):
  265. self._CurrentPage = page
  266. on_load_cb = getattr(self._CurrentPage,"OnLoadCb",None)
  267. if on_load_cb != None:
  268. if callable( on_load_cb ):
  269. self._CurrentPage.OnLoadCb()
  270. def PushPage(self,page):
  271. self.PushCurPage()
  272. self.SetCurPage(page)
  273. def AppendPage(self,Page):
  274. self._Pages.append(Page)
  275. def ClearCanvas(self):
  276. self._CanvasHWND.fill(self._SkinManager.GiveColor('White'))
  277. def SwapAndShow(self):
  278. if self._Closed == True:
  279. return
  280. if self._HWND != None:
  281. self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
  282. pygame.display.update()
  283. def ExtraName(self,name):
  284. ## extra name like 1_xxx to be => xxx,
  285. parts = name.split("_")
  286. if len(parts) > 1:
  287. return parts[1]
  288. elif len(parts) == 1:
  289. return parts[0]
  290. else:
  291. return name
  292. def IsExecPackage(self,dirname):
  293. files = os.listdir(dirname)
  294. bname = os.path.basename(dirname)
  295. bname = self.ExtraName(bname)
  296. for i in sorted(files):
  297. if i == bname+".sh":
  298. return True
  299. return False
  300. def IsEmulatorPackage(self,dirname):
  301. files = os.listdir(dirname)
  302. for i in sorted(files):
  303. if i.endswith(emulator_flag):
  304. return True
  305. return False
  306. def IsCommercialPackage(self,dirname):
  307. files = os.listdir(dirname)
  308. for i in sorted(files):
  309. if i.endswith(commercialsoftware_flag):
  310. return True
  311. return False
  312. def IsPythonPackage(self,dirname):
  313. files = os.listdir(dirname)
  314. for i in sorted(files):
  315. if i.endswith(python_package_flag):
  316. return True
  317. return False
  318. def ReunionPagesIcons(self): #This is for combining /home/cpi/apps/Menu and ~/launcher/Menu/GameShell
  319. for p in self._Pages:
  320. tmp = []
  321. for i,x in enumerate(p._Icons):
  322. tup = ('',0)
  323. if hasattr(x, '_FileName'):
  324. if str.find(x._FileName,"_") < 0:
  325. tup = ("98_"+x._FileName,i) # prefer to maintain PowerOFF in last position if the filename has no order labels
  326. else:
  327. tup = (x._FileName, i)
  328. else:
  329. tup = ("",i)
  330. tmp.append(tup)
  331. tmp = sorted(tmp, key=itemgetter(0))
  332. retro_games_idx = []
  333. retro_games_dir = "20_Retro Games"
  334. for i,x in enumerate(tmp):
  335. if retro_games_dir in x[0]:
  336. retro_games_idx.append(x[1])
  337. if len(retro_games_idx) > 1:
  338. for i in range(1,len(retro_games_idx)):
  339. 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"],
  340. tmp_swap = []
  341. for i, x in enumerate(tmp):
  342. if retro_games_dir not in x[0]:
  343. tmp_swap.append(x)
  344. if retro_games_dir in x[0] and i == retro_games_idx[0]:
  345. tmp_swap.append(x)
  346. tmp = tmp_swap
  347. #print(tmp)
  348. new_icons = []
  349. for x in tmp:
  350. new_icons.append( p._Icons[ x[1] ] )
  351. p._Icons = new_icons
  352. def ReadTheDirIntoPages(self,_dir,pglevel,cur_page):
  353. global commercialsoftware_flag
  354. if FileExists(_dir) == False and os.path.isdir(_dir) == False:
  355. return
  356. files = os.listdir(_dir)
  357. for i in sorted(files):
  358. if os.path.isdir(_dir+"/"+i) and i.startswith(".") == False: # TOPLEVEL only is dir
  359. if pglevel == 0:
  360. page = Page()
  361. page._Name = self.ExtraName(i)
  362. page._Icons = []
  363. self._Pages.append(page)
  364. self.ReadTheDirIntoPages(_dir+"/"+i, pglevel+1 ,self._Pages[ len(self._Pages) -1])
  365. else: ## On CurPage now
  366. i2 = self.ExtraName(i)
  367. iconitem = IconItem()
  368. iconitem._FileName = i
  369. iconitem._CmdPath = ""
  370. iconitem.AddLabel(MyLangManager.Tr(i2),self._IconFont)
  371. if FileExists( _dir+"/"+i+"/"+i2+".png"): ### 20_Prog/Prog.png , cut 20_
  372. iconitem._ImageName = _dir+"/"+i+"/"+i2+".png"
  373. elif FileExists( MySkinManager.GiveIcon(_dir+"/"+i2+".png") ):
  374. iconitem._ImageName = MySkinManager.GiveIcon(_dir+"/"+i2+".png")
  375. else:
  376. untitled = UntitledIcon()
  377. untitled.Init()
  378. if len(i2) > 1:
  379. untitled.SetWords(i2[:2])
  380. elif len(i2) == 1:
  381. untitled.SetWords([i2[0],i2[0]])
  382. else:
  383. untitled.SetWords(["G","s"])
  384. iconitem._ImgSurf = untitled.Surface()
  385. iconitem._ImageName = ""
  386. if self.IsPythonPackage(_dir+"/"+i):
  387. iconitem._MyType = ICON_TYPES["FUNC"]
  388. sys.path.append(_dir)
  389. iconitem._CmdPath = __import__(i)
  390. init_cb = getattr(iconitem._CmdPath,"Init",None)
  391. if init_cb != None:
  392. if callable(init_cb):
  393. iconitem._CmdPath.Init(self)
  394. cur_page._Icons.append(iconitem)
  395. elif self.IsEmulatorPackage(_dir+"/"+i):
  396. obj = {}
  397. obj["ROM"] = ""
  398. obj["ROM_SO"] =""
  399. obj["EXT"] = []
  400. obj["EXCLUDE"] = []
  401. obj["FILETYPE"] = "file"
  402. obj["LAUNCHER"] = ""
  403. obj["TITLE"] = "Game"
  404. obj["SO_URL"] = ""
  405. obj["RETRO_CONFIG"] = "" ##
  406. try:
  407. f = open(_dir+"/"+i+"/"+emulator_flag)
  408. except IOError:
  409. print("action config open failed")
  410. return
  411. else:
  412. with f:
  413. content = f.readlines()
  414. content = [x.strip() for x in content]
  415. for c in content:
  416. pis = c.split("=")
  417. if len(pis) > 1:
  418. if "EXT" in pis[0]:
  419. obj[pis[0]] = pis[1].split(",")
  420. elif "EXCLUDE" in pis[0]:
  421. obj[pis[0]] = pis[1].split(",")
  422. else:
  423. obj[pis[0]] = pis[1]
  424. if FileExists(_dir+"/"+i+"/retroarch-local.cfg"):
  425. obj["RETRO_CONFIG"] = CmdClean(os.path.abspath( _dir+"/"+i+"/retroarch-local.cfg" ))
  426. print("a local retroarch cfg:", obj["RETRO_CONFIG"])
  427. em = MyEmulator()
  428. em._Emulator = obj
  429. em.Init(self)
  430. iconitem._CmdPath = em
  431. iconitem._MyType = ICON_TYPES["Emulator"]
  432. cur_page._Icons.append(iconitem)
  433. elif self.IsCommercialPackage( os.path.join(_dir,i)):
  434. data = None
  435. em = MyCommercialSoftwarePackage()
  436. with open(os.path.join(_dir,i) +"/"+commercialsoftware_flag) as f:
  437. data = json.load(f)
  438. if FileExists( _dir+"/"+i+"/.done"):
  439. print(_dir+"/"+i+"/.done")
  440. em._Done = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
  441. em._ComPkgInfo = data
  442. else:
  443. em._ComPkgInfo = data
  444. em._Done = ""
  445. em._InvokeDir = os.path.realpath( os.path.join(_dir,i))
  446. em.Init(self)
  447. iconitem._CmdPath = em
  448. iconitem._MyType = ICON_TYPES["Commercial"]
  449. cur_page._Icons.append(iconitem)
  450. elif self.IsExecPackage(_dir+"/"+i): ## ExecPackage is the last one to check
  451. iconitem._MyType = ICON_TYPES["EXE"]
  452. iconitem._CmdPath = os.path.realpath(_dir+"/"+i+"/"+i2+".sh")
  453. MakeExecutable(iconitem._CmdPath)
  454. cur_page._Icons.append(iconitem)
  455. else:
  456. iconitem._MyType = ICON_TYPES["DIR"]
  457. iconitem._LinkPage = Page()
  458. iconitem._LinkPage._Name = i2
  459. cur_page._Icons.append(iconitem)
  460. self.ReadTheDirIntoPages(_dir+"/"+i,pglevel+1,iconitem._LinkPage)
  461. elif os.path.isfile(_dir+"/"+i) and i.startswith(".") == False and pglevel > 0:
  462. if i.lower().endswith(icon_ext):
  463. i2 = self.ExtraName(i)
  464. #cmd = ReadTheFileContent(_dir+"/"+i)
  465. iconitem = IconItem()
  466. iconitem._FileName = i
  467. iconitem._CmdPath = os.path.realpath(_dir+"/"+i)
  468. MakeExecutable(iconitem._CmdPath)
  469. iconitem._MyType = ICON_TYPES["EXE"]
  470. if FileExists( MySkinManager.GiveIcon( _dir+"/"+ReplaceSuffix(i2,"png"))):
  471. iconitem._ImageName = MySkinManager.GiveIcon(_dir+"/"+ReplaceSuffix(i2,"png"))
  472. else:
  473. untitled = UntitledIcon()
  474. untitled.Init()
  475. if len(i2) > 1:
  476. untitled.SetWords(i2[:2])
  477. elif len(i2) == 1:
  478. untitled.SetWords([i2[0],i2[0]])
  479. else:
  480. untitled.SetWords(["G","s"])
  481. iconitem._ImgSurf = untitled.Surface()
  482. iconitem._ImageName = ""
  483. iconitem.AddLabel(MyLangManager.Tr(i2.split(".")[0]),self._IconFont)
  484. iconitem._LinkPage = None
  485. cur_page._Icons.append(iconitem)
  486. def RunEXE(self,cmdpath):
  487. self.DrawRun()
  488. self.SwapAndShow()
  489. pygame.time.delay(1000)
  490. cmdpath = cmdpath.strip()
  491. cmdpath = CmdClean(cmdpath)
  492. pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
  493. def OnExitCb(self,event):
  494. ## leave rest to Pages
  495. on_exit_cb = getattr(self._CurrentPage,"OnExitCb",None)
  496. if on_exit_cb != None:
  497. if callable( on_exit_cb ):
  498. self._CurrentPage.OnExitCb(event)
  499. return
  500. def KeyDown(self,event):
  501. """
  502. if event.key == pygame.K_PAGEUP:
  503. self.EasingAllPageLeft()
  504. #self.SwapAndShow()
  505. if event.key == pygame.K_PAGEDOWN:
  506. self.EasingAllPageRight()
  507. #self.SwapAndShow()
  508. """
  509. if event.key == pygame.K_t:
  510. self.DrawRun()
  511. self.SwapAndShow()
  512. """
  513. if event.key == CurKeys["Space"]:
  514. self._CounterScreen.Draw()
  515. self._CounterScreen.SwapAndShow()
  516. self._CounterScreen.StartCounter()
  517. """
  518. ## leave rest to Pages
  519. current_page_key_down_cb = getattr(self._CurrentPage,"KeyDown",None)
  520. if current_page_key_down_cb != None:
  521. if callable( current_page_key_down_cb ):
  522. self._CurrentPage.KeyDown(event)
  523. self._LastKey = event.key
  524. def DrawRun(self):
  525. self._MsgBox.SetText(MyLangManager.Tr("Launching"))
  526. self._MsgBox.Draw()
  527. def Draw(self):
  528. if self._Closed == True:
  529. return
  530. self._CurrentPage.Draw()
  531. #if self._HWND != None:
  532. # self._HWND.blit(self._CanvasHWND,(self._PosX,self._PosY,self._Width,self._Height))
  533. if self._TitleBar != None:
  534. self._TitleBar.Draw(self._CurrentPage._Name)
  535. if self._FootBar != None:
  536. if hasattr(self._CurrentPage,"_FootMsg"):
  537. self._FootBar.SetLabelTexts(self._CurrentPage._FootMsg)
  538. self._FootBar.Draw()