51e51afe75853d77b5ce2e1118be4a504d0d097a
2 Created on 17 dec. 2009
7 import pgu
.gui
as pguGui
11 class MINWiiDialog(pguGui
.FileDialog
):
16 def __init__(self
, font
= None, width
= 800, height
= 600,path
=None):
17 pguGui
.FileDialog
.__init
__(self
,title_txt
= "Choisir une chanson", customFont
= font
,customWidth
= width
, customHeight
= height
,folderText
= "", fileText
= "",path
=path
,showCurDir
= False)
20 self
.input_dir
.value
= self
.curdir
21 self
.input_dir
.pos
= len(self
.curdir
)
22 self
.input_dir
.vpos
= 0
26 for i
in os
.listdir(self
.curdir
):
27 if os
.path
.isdir(os
.path
.join(self
.curdir
, i
)): dirs
.append(i
)
30 self
.input_file
.value
= "Opps! no access"
31 #if '..' not in dirs: dirs.append('..')
37 #item = ListItem(image=self.dir_img, text=i, value=i)
38 if self
.customFont
== None :
39 self
.list.add(i
,image
=self
.dir_img
,value
=i
)
41 if i
== ".." or i
[0] != ".":
42 label
= pguGui
.basic
.Label(i
,font
= self
.customFont
)
43 self
.list.add(label
,image
=self
.dir_img
,value
=i
)
45 #item = ListItem(image=None, text=i, value=i)
46 if self
.customFont
== None :
47 self
.list.add(i
,value
=i
)
49 if i
.endswith(".smwi"):
51 if key
in constants
.reversedReadabilityDict
:
52 label
= pguGui
.basic
.Label(constants
.reversedReadabilityDict
[key
],font
= self
.customFont
)
54 label
= pguGui
.basic
.Label(key
,font
= self
.customFont
)
55 self
.list.add(label
,value
=i
)
57 self
.list.set_vertical_scroll(0)
58 #self.list.repaintall()