gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/util demo.py


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gfx/util demo.py
Date: Thu, 12 Dec 2002 13:41:24 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        02/12/12 13:41:24

Modified files:
        gfx/util       : demo.py 

Log message:
        Use the __doc__ strings in demos: press '?'

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/util/demo.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text

Patches:
Index: gzz/gfx/util/demo.py
diff -u gzz/gfx/util/demo.py:1.2 gzz/gfx/util/demo.py:1.3
--- gzz/gfx/util/demo.py:1.2    Thu Dec 12 05:04:40 2002
+++ gzz/gfx/util/demo.py        Thu Dec 12 13:41:24 2002
@@ -83,6 +83,7 @@
                loadScenes()
            elif s == "?":
                showHelp = 1-showHelp
+               AbstractUpdateManager.setNoAnimation()
            elif not globalkey(s):
                currentScene.key(s)
        else:
@@ -104,6 +105,34 @@
 def addHelp(vs):
     help = currentScene.__class__.__doc__ + currentScene.key.__doc__
     print "Doc: ",help
+    lines = help.split("\n")
+    ys = min(vs.size.height / len(lines), 25)
+    cury = 0
+    style = vs.gfxapi.getTextStyle("sans", 0, 25)
+    vobs = []
+    for l in lines:
+       vobs.append((
+           TextVob(style, l), str(("HL",cury)), cury))
+       cury += ys
+    # Draw white frame
+    vs.map.put(getDListNocoords("""
+       Color 1 1 1 1
+       Disable BLEND
+    """))
+    s = 1.0
+    for v in vobs:
+       vs.put(v[0], "1"+v[1], -45, 0 + s, v[2] + s, ys, ys)
+       vs.put(v[0], "2"+v[1], -45, 0 - s, v[2] + s, ys, ys)
+       vs.put(v[0], "3"+v[1], -45, 0 + s, v[2] - s, ys, ys)
+       vs.put(v[0], "4"+v[1], -45, 0 - s, v[2] - s, ys, ys)
+    vs.map.put(getDListNocoords("""
+       Color 0 0 0 1
+       Disable BLEND
+    """))
+    for v in vobs:
+       vs.put(v[0], v[1], -45, 0, v[2], ys, ys)
+
+
 
 class Show(AbstractShower):
     def generate(self):
@@ -118,6 +147,8 @@
        else:
            vs = w.createVobScene()
            currentScene.scene(vs)
+           if showHelp:
+               addHelp(vs)
        return vs
 
 def replaceNewScene(vs):



reply via email to

[Prev in Thread] Current Thread [Next in Thread]