Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2009-07-24 02:07:50 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2009-07-24 02:07:50 (GMT)
commit1b7186813cb33c42e4127d092b91131a82a9c4e0 (patch)
treeec463e36e259c2157fabaea127bb3069c7b98fc6
parent77430dece86f0627cade4f5729361868b8f43aaa (diff)
enabled boxes to hold strings and journal objects
-rw-r--r--talogo.py30
-rw-r--r--tasetup.py2
-rw-r--r--tawindow.py9
3 files changed, 22 insertions, 19 deletions
diff --git a/talogo.py b/talogo.py
index e44e2ee..0b0d264 100644
--- a/talogo.py
+++ b/talogo.py
@@ -538,9 +538,9 @@ def lcNew(tw):
lc.gplay = None
lc.ag = None
lc.nobox = ""
- lc.title_height = int((tw.turtle.height/30)*tw.scale)
- lc.body_height = int((tw.turtle.height/60)*tw.scale)
- lc.bullet_height = int((tw.turtle.height/45)*tw.scale)
+ lc.title_height = int((lc.tw.turtle.height/30)*lc.tw.scale)
+ lc.body_height = int((lc.tw.turtle.height/60)*lc.tw.scale)
+ lc.bullet_height = int((lc.tw.turtle.height/45)*lc.tw.scale)
lc.iline, lc.cfun, lc.arglist, lc.ufun = None, None, None, None
@@ -672,7 +672,7 @@ def show_template1(lc, title, media):
# set body text size
settextsize(lc.tw.turtle, lc.body_height)
# render media object
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, media)
x = 0
@@ -698,7 +698,7 @@ def show_template2(lc, title, media1, media2):
# set body text size
settextsize(lc.tw.turtle, lc.body_height)
# render four quadrents
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, media1)
x = 0
@@ -726,25 +726,25 @@ def show_template3(lc, title, s1, s2, s3, s4, s5, s6, s7):
show(lc,title)
# set body text size
settextsize(lc.tw.turtle, lc.bullet_height)
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, s1)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s2)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s3)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s4)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s5)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s6)
- y -= (lc.bullet_height*2)
+ y -= int(lc.bullet_height*2*lc.tw.lead)
setxy(lc.tw.turtle, x, y)
show(lc, s7)
# restore text size
@@ -767,7 +767,7 @@ def show_template6(lc, title, media1, media2):
# set body text size
settextsize(lc.tw.turtle, lc.body_height)
# render four quadrents
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, media1)
x = 0
@@ -799,7 +799,7 @@ def show_template7(lc, title, media1, media2, media3, media4):
# set body text size
settextsize(lc.tw.turtle, lc.body_height)
# render four quadrents
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, media1)
x = 0
@@ -832,7 +832,7 @@ def show_template8(lc, title, media1):
# set body text size
settextsize(lc.tw.turtle, lc.body_height)
# render media object
- y -= (lc.title_height*2) # leave some space below the title
+ y -= int(lc.title_height*2*lc.tw.lead) # leave some space below the title
setxy(lc.tw.turtle, x, y)
show(lc, media1)
# restore text size
diff --git a/tasetup.py b/tasetup.py
index 2959c6a..99f63c4 100644
--- a/tasetup.py
+++ b/tasetup.py
@@ -163,7 +163,7 @@ dockdetails = {
'noarg2': (('flow',True,37,5),('flow',False,37,59)),
'onearg': (('flow',True,37,5),('num',False,74,21),('flow',False,37,44)),
'onesarg': (('flow',True,37,5),('string',False,74,21),('flow',False,37,44)),
- 'onecarg': (('flow',True,37,5),('media',False,86,21),('flow',False,37,44)),
+ 'onecarg': (('flow',True,37,5),('media',False,74,21),('flow',False,37,44)),
'1arg': (('flow',True,37,5),('num',False,74,29),('flow',False,37,59)),
'twoargs': (('flow',True,37,5),('num',False,74,21),('num',False,74,58), \
('flow',False,37,81)),
diff --git a/tawindow.py b/tawindow.py
index bed16f3..f43767d 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -117,8 +117,11 @@ def twNew(win, path, lang, parent=None):
# tw.window.textentry = gtk.Entry()
# on an OLPC-XO-1, there is a scaling factor
if os.path.exists('/sys/power/olpc-pm'):
- tw.scale = 1
- else: tw.scale = 1.6
+ tw.lead = 1.6
+ tw.scale = 1.0
+ else:
+ tw.lead = 1.0
+ tw.scale = 1.6
tw.cm = tw.gc.get_colormap()
tw.rgb = [255,0,0]
tw.bgcolor = tw.cm.alloc_color('#fff8de')
@@ -492,7 +495,7 @@ def dock_dx_dy(block1,dock1n,block2,dock2n):
if d2type == 'num' or d2type == 'string':
pass
# some blocks can take strings, nums, or Journal
- elif block1.proto.name in ('show', 'push'):
+ elif block1.proto.name in ('show', 'push', 'storein'):
if d2type == 'num' or d2type == 'string' or d2type == 'journal':
pass
# some blocks can take media, audio, movies, of descriptions