2 |
from gzz.view import View |
from gzz.view import View |
3 |
from test.tools import tools |
from test.tools import tools |
4 |
|
|
5 |
style = GraphicsAPI.getInstance().getTextStyle("serif", 0, 14) |
style_date = GraphicsAPI.getInstance().getTextStyle("serif", 0, 14) |
6 |
|
style_n = GraphicsAPI.getInstance().getTextStyle("serif", 0, 14) |
7 |
|
|
8 |
class ViewScene: |
class ViewScene: |
9 |
def __init__(self): |
def __init__(self): |
18 |
self.bgcolor = (0.6, 0.7, 0.8) |
self.bgcolor = (0.6, 0.7, 0.8) |
19 |
putnoc(vs, background(self.bgcolor)) |
putnoc(vs, background(self.bgcolor)) |
20 |
|
|
21 |
|
#for i in range(1, 12): |
22 |
|
# cs_cal = vs.coords.affineCoordsys(0, 0, w/2 - ((w/3 + self.tx) * (self.scale -1) ) , |
23 |
|
# ((h/6) *i) - ((h/3.5 + self.ty) *(self.scale-1)), |
24 |
|
# w/7*0.2* self.scale, 0, 0, ((h/12)/5) * self.scale) |
25 |
|
#print 'w: ', w,' h: ', h |
26 |
|
|
27 |
|
# vs.matcher.add(cs_cal, "cs_cal") |
28 |
|
# gzz.vob.CalendarVob.setStatics(style_date, style_n, 5) |
29 |
|
# gzz.vob.CalendarVob.setBounds(0.7, 0.5, 1.0) |
30 |
|
# vs.map.put(gzz.vob.CalendarVob(2002, i), cs_cal) |
31 |
|
|
32 |
cs_cal = vs.coords.affineCoordsys(0, 0, w/2 - ((w/3 + self.tx) * (self.scale -1) ) , |
cs_cal = vs.coords.affineCoordsys(0, 0, w/2 - ((w/3 + self.tx) * (self.scale -1) ) , |
33 |
h/2 - ((h/3.5 + self.ty) *(self.scale-1)), |
h/2 - ((h/3.5 + self.ty) *(self.scale-1)), |
34 |
w/6 * self.scale, 0, 0, h/7 * self.scale) |
w/6 * self.scale, 0, 0, h/5 * self.scale) |
35 |
#print 'w: ', w,' h: ', h |
print 'w: ', w,' h: ', h |
36 |
|
|
37 |
vs.matcher.add(cs_cal, "cs_cal") |
vs.matcher.add(cs_cal, "cs_cal") |
38 |
|
|
39 |
vs.map.put(gzz.vob.CalendarVob(style, 5), cs_cal) |
# these don't efect |
40 |
|
gzz.vob.CalendarVob.setStatics(style_date, style_n, 5) |
41 |
|
|
42 |
|
# week number width, weekday height, month name height |
43 |
|
gzz.vob.CalendarVob.setBounds(0.9, 1.1, 0.8) |
44 |
|
vs.map.put(gzz.vob.CalendarVob(2002, 12), cs_cal) |
45 |
|
|
46 |
|
|
47 |
def key(self, k): |
def key(self, k): |
48 |
if k == "+": |
if k == "+": |