[Top][All Lists]
[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: |
Wed, 08 Jan 2003 12:13:05 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Matti Katila <address@hidden> 03/01/08 12:13:05
Modified files:
gfx/demo : keymap-test.py
Log message:
mouse problem
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/keymap-test.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: gzz/gfx/demo/keymap-test.py
diff -u gzz/gfx/demo/keymap-test.py:1.2 gzz/gfx/demo/keymap-test.py:1.3
--- gzz/gfx/demo/keymap-test.py:1.2 Tue Jan 7 07:36:57 2003
+++ gzz/gfx/demo/keymap-test.py Wed Jan 8 12:13:05 2003
@@ -1,9 +1,12 @@
import gzz
from gzz.view import View
+from java.awt.event import *
+
class ViewScene:
def __init__(self):
self.a = 0
+ self.chg = 0
def scene(self, vs):
size = vs.getSize()
@@ -16,22 +19,34 @@
colchars = 60
tscale = min(size.width*1.0, size.height*4.0/3) / colchars
- cs1 = vs.coords.affineCoordsys(0, 10, 0, self.a, tscale, 0, 0, tscale)
- vs.matcher.add(cs1, "1")
- putText(vs, cs1, 'Text Vob', color=(0,0,0), h=4, y = 3)
+ 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)
# Note how we map the OLD cs2 to the NEW cs1
- if hasattr(self,"cs2"):
- vs.matcher.keymapSingleCoordsys(cs1, self.cs2)
+ #if hasattr(self,"cs2"):
+ if self.chg:
+ print 'AND IT MAKES!'
+ vs.matcher.keymapSingleCoordsys(self.cs1, self.cs2)
# and now store the NEW cs2
- self.cs2 = vs.translateCS(0, "X", 150,150,0)
+ self.cs2 = vs.translateCS(0, "X", 550,550,0)
+ self.vs = vs
def key(self, k):
print 'simsalapim!'
+ self.vs.matcher.keymapSingleCoordsys(self.cs1, self.cs2)
self.a = self.a + 5
+ def mouse(self, ev):
+ if ev.getID() == ev.MOUSE_PRESSED:
+ self.chg = 0
+
+ if ev.getID() == ev.MOUSE_CLICKED:
+ print 'NOW MAKE SOMETHING'
+ self.chg = 1
+
currentScene = ViewScene()
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Matti Katila, 2003/01/07
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Tuomas J. Lukka, 2003/01/07
- [Gzz-commits] gzz/gfx/demo keymap-test.py,
Matti Katila <=
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Tuomas J. Lukka, 2003/01/08
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Matti Katila, 2003/01/09
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Matti Katila, 2003/01/13
- [Gzz-commits] gzz/gfx/demo keymap-test.py, Matti Katila, 2003/01/13