comparison frontends/sortilege/boxsizer.py @ 70:8f2ed279784b

i18n - gettext support added in frontends - first draft of frontends french translation
author Goffi <goffi@goffi.org>
date Fri, 05 Mar 2010 20:33:10 +1100
parents a5b5fb5fc9fd
children
comparison
equal deleted inserted replaced
69:86f1f7f6d332 70:8f2ed279784b
20 """ 20 """
21 21
22 22
23 from window import Window 23 from window import Window
24 import os,pdb 24 import os,pdb
25
26
27 def echo(message):
28 return
29 os.system('echo "'+str(message)+'" >> /tmp/toto')
30
31 25
32 class BoxSizer: 26 class BoxSizer:
33 """This class manage the position of the window like boxes.""" 27 """This class manage the position of the window like boxes."""
34 28
35 29
64 if win.isHidden(): 58 if win.isHidden():
65 if len(current_row)>1 and win is row[-1]: 59 if len(current_row)>1 and win is row[-1]:
66 #if the last win is hidden, we expand previous visible one 60 #if the last win is hidden, we expand previous visible one
67 current_row[-1][2] = current_row[-1][2] + (win.getX() - oriX)+win.getWidth() 61 current_row[-1][2] = current_row[-1][2] + (win.getX() - oriX)+win.getWidth()
68 else: 62 else:
69 echo ("ajout de %s à current row" % (win.__class__.__name__))
70 current_row.append([win, h+y-oriY, w+x-oriX, oriY, oriX]) 63 current_row.append([win, h+y-oriY, w+x-oriX, oriY, oriX])
71 oriX=oriX+w 64 oriX=oriX+w
72 65
73 if oriX!=0: 66 if oriX!=0:
74 echo ("ligne visible (dernier: %s)" % win.__class__.__name__)
75 oriY=oriY+h 67 oriY=oriY+h
76 visible_row.append(current_row) 68 visible_row.append(current_row)
77 elif visible_row: 69 elif visible_row:
78 #if all the row is empty, we take the space 70 #if all the row is empty, we take the space
79 for box in visible_row[-1]: 71 for box in visible_row[-1]:
80 echo ("on augmente %s de %d" % (box[0].__class__.__name__, h))
81 box[1]=box[1]+h 72 box[1]=box[1]+h
82 oriY=oriY+h #this only happen if it's not the first visible row 73 oriY=oriY+h #this only happen if it's not the first visible row
83 else:
84 echo ("ligne invisible")
85 74
86 for row in visible_row: 75 for row in visible_row:
87 for win in row: 76 for win in row:
88 win[0].resize(win[1], win[2], win[3], win[4]) 77 win[0].resize(win[1], win[2], win[3], win[4])