[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire/org/fenfire/demo fenpdfcontext.py
From: |
Matti Katila |
Subject: |
[Gzz-commits] fenfire/org/fenfire/demo fenpdfcontext.py |
Date: |
Mon, 11 Aug 2003 08:42:34 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Matti Katila <address@hidden> 03/08/11 08:42:34
Modified files:
org/fenfire/demo: fenpdfcontext.py
Log message:
mouse menu shrinks to clicked point, detaching links, linking to
directions
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/demo/fenpdfcontext.py.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/demo/fenpdfcontext.py
diff -u fenfire/org/fenfire/demo/fenpdfcontext.py:1.21
fenfire/org/fenfire/demo/fenpdfcontext.py:1.22
--- fenfire/org/fenfire/demo/fenpdfcontext.py:1.21 Mon Aug 11 08:07:31 2003
+++ fenfire/org/fenfire/demo/fenpdfcontext.py Mon Aug 11 08:42:34 2003
@@ -167,30 +167,30 @@
class MouseMenu:
class Action:
+ def __init__(self, states):
+ self.s = states
def run(self):
pass
class LinkL(Action):
- def __init__(self, states):
- self.s = states
def run(self):
obj = self.s.objectOnPlane
pp = self.s.pp
- pp.assocNotes(obj, 1, self.s.cursor.getAccursed())
+ pp.assocNotes(obj, -1, self.s.cursor.getAccursed())
class LinkR(Action):
- def __init__(self, states):
- self.s = states
def run(self):
obj = self.s.objectOnPlane
pp = self.s.pp
pp.assocNotes(obj, 1, self.s.cursor.getAccursed())
- class UnLinkBuoy(Action):
- def __init__(self, states):
- self.s = states
+ class UnlinkBuoy(Action):
def run(self):
+ link = self.s.mgr.buoyHit.link
+ #(otherNode, linkId, otherAnchor, into)
+ if dbg:
p('linkid',link[1],'otheranchor',link[2],'othernode',link[0])
pp = self.s.pp
- pp.detachNotes(obj, 1, self.s.cursor.getAccursed())
- pp.detachNotes(obj, -1, self.s.cursor.getAccursed())
+ a,b = link[1].first, link[1].second
+ pp.detachNotes(a, 1, b)
+ pp.detachNotes(a, -1, b)
def __init__(self, states):
self.states = states
@@ -201,17 +201,17 @@
def makeMainList(self):
self.list = vob.vobs.SelectListVob(self.style)
- self.list.add('Test', 'test')
+ self.list.add('Destroy this paper', 'KillPlane(self.states)')
if self.link:
- self.list.add('Link nodes to left', self.LinkL(self.states))
- self.list.add('Link nodes to rigth', self.LinkR(self.states))
+ self.list.add('Link node to left', self.LinkL(self.states))
+ self.list.add('Link node to rigth', self.LinkR(self.states))
self.list.add('Go to home', 'home')
self.list.add('Save & Quit', 'save_quit')
self.list.add('Quit without save', 'quit')
def makeBuoyList(self):
self.list = vob.vobs.SelectListVob(self.style)
- self.list.add('Unlink buoy', 'unlink')
+ self.list.add('Unlink buoy', self.UnlinkBuoy(self.states))
self.list.add('Go to home', 'home')
def render(self, vs):
@@ -233,7 +233,9 @@
self.x, self.y = x, y
def hideList(self):
- self.x, self.y = 0,0
+ if hasattr(self.states, 'lastEvent'):
+ self.x, self.y = self.states.lastEvent.getX(),
self.states.lastEvent.getY()
+ else: self.x, self.y = 0,0
self.w, self.h = .0, .0
def mouse(self, ev, vs):
- [Gzz-commits] fenfire/org/fenfire/demo fenpdfcontext.py,
Matti Katila <=