gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/demo keymap-test.py


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx/demo keymap-test.py
Date: Thu, 09 Jan 2003 04:42:25 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   03/01/09 04:42:25

Modified files:
        gfx/demo       : keymap-test.py 

Log message:
        why is it so *easy* in trivial test?

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/keymap-test.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/keymap-test.py
diff -u gzz/gfx/demo/keymap-test.py:1.4 gzz/gfx/demo/keymap-test.py:1.5
--- gzz/gfx/demo/keymap-test.py:1.4     Wed Jan  8 15:18:55 2003
+++ gzz/gfx/demo/keymap-test.py Thu Jan  9 04:42:25 2003
@@ -5,8 +5,10 @@
 
 class ViewScene:
     def __init__(self):
-        self.a = 0
+        self.a = 150
         self.chg = 0
+        self.x = 200
+        self.y = 200
     
     def scene(self, vs):
         size = vs.getSize()
@@ -15,22 +17,38 @@
        self.bgcolor = (0.5, 0.4, 0.7)
         putnoc(vs, background(self.bgcolor))
 
-        # Put a Text Vob 
+
         colchars = 60
         tscale = min(size.width*1.0, size.height*4.0/3) / colchars
 
-       self.cs1 = vs.coords.affineCoordsys(0, 10, 0, self.a, tscale, 0, 0, 
tscale)
-        vs.matcher.add(self.cs1, "1")
-        putText(vs, self.cs1, 'Text Vob', color=(0,0,0), h=4, y = 3)
+        # Put two Text Vobs
+        cs_a = vs.coords.affineCoordsys(0, 10, 500,150, tscale, 0, 0, tscale)
+        vs.matcher.add(cs_a, "A")
+        putText(vs, cs_a, 'A', color=(0,0,0), h=4, y = 3)
+
+
+        # Second is nadir
+        # text cs
+       cs_text = vs.coords.affineCoordsys(0, 10, 50, self.a, tscale, 0, 0, 
tscale)
+        vs.matcher.add(cs_text, "TEXT")
+        # nadir point
+        nadir_point = vs.coords.ortho(0,0, self.x,self.y, 1,1)
+        vs.matcher.add(nadir_point, "nadir_point")
+        # nadir
+        cs_nadir = vs.coords.nadirOrigin(cs_text, nadir_point)
+        vs.matcher.add(cs_nadir, "nadir")
+
+        putText(vs, cs_nadir, 'Text Vob', color=(0,0,0), h=4, y = 3)
 
+        self.NEW = cs_text
        # Note how we map the OLD cs2 to the NEW cs1
        #if hasattr(self,"cs2"):
        if self.chg:
             print 'AND IT MAKES!'
-           vs.matcher.keymapSingleCoordsys(self.cs1, self.cs2)
+           vs.matcher.keymapSingleCoordsys(self.NEW, self.OLD)
 
        # and now store the NEW cs2
-        self.cs2 = vs.translateCS(0, "X", 550,550,0)
+        self.OLD = cs_a
         self.vs = vs
 
 
@@ -46,6 +64,7 @@
         if ev.getID() == ev.MOUSE_CLICKED:
             print 'NOW MAKE SOMETHING'
            self.chg = 1
+            self.x, self.y = ev.getX(), ev.getY()
            gzz.client.AbstractUpdateManager.chg()
         
 currentScene = ViewScene()




reply via email to

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