/[fenfire]/fenfire/org/fenfire/demo/fenpdfcontext.py
ViewVC logotype

Diff of /fenfire/org/fenfire/demo/fenpdfcontext.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by mudyc, Mon Aug 11 12:07:31 2003 UTC revision 1.22 by mudyc, Mon Aug 11 12:42:34 2003 UTC
# Line 167  class ContextStates: Line 167  class ContextStates:
167                    
168  class MouseMenu:  class MouseMenu:
169      class Action:      class Action:
170            def __init__(self, states):
171                self.s = states
172          def run(self):          def run(self):
173              pass              pass
174    
175      class LinkL(Action):      class LinkL(Action):
         def __init__(self, states):  
             self.s = states  
176          def run(self):          def run(self):
177              obj = self.s.objectOnPlane              obj = self.s.objectOnPlane
178              pp = self.s.pp              pp = self.s.pp
179              pp.assocNotes(obj, 1, self.s.cursor.getAccursed())              pp.assocNotes(obj, -1, self.s.cursor.getAccursed())
180      class LinkR(Action):      class LinkR(Action):
         def __init__(self, states):  
             self.s = states  
181          def run(self):          def run(self):
182              obj = self.s.objectOnPlane              obj = self.s.objectOnPlane
183              pp = self.s.pp              pp = self.s.pp
184              pp.assocNotes(obj, 1, self.s.cursor.getAccursed())              pp.assocNotes(obj, 1, self.s.cursor.getAccursed())
185      class UnLinkBuoy(Action):      class UnlinkBuoy(Action):
         def __init__(self, states):  
             self.s = states  
186          def run(self):          def run(self):
187                link = self.s.mgr.buoyHit.link
188                #(otherNode, linkId, otherAnchor, into)
189                if dbg: p('linkid',link[1],'otheranchor',link[2],'othernode',link[0])
190              pp = self.s.pp              pp = self.s.pp
191              pp.detachNotes(obj, 1, self.s.cursor.getAccursed())              a,b = link[1].first, link[1].second
192              pp.detachNotes(obj, -1, self.s.cursor.getAccursed())              pp.detachNotes(a, 1, b)
193                pp.detachNotes(a, -1, b)
194            
195      def __init__(self, states):      def __init__(self, states):
196          self.states = states          self.states = states
# Line 201  class MouseMenu: Line 201  class MouseMenu:
201                    
202      def makeMainList(self):      def makeMainList(self):
203          self.list = vob.vobs.SelectListVob(self.style)          self.list = vob.vobs.SelectListVob(self.style)
204          self.list.add('Test', 'test')          self.list.add('Destroy this paper', 'KillPlane(self.states)')
205          if self.link:          if self.link:
206              self.list.add('Link nodes to left', self.LinkL(self.states))              self.list.add('Link node to left', self.LinkL(self.states))
207              self.list.add('Link nodes to rigth', self.LinkR(self.states))              self.list.add('Link node to rigth', self.LinkR(self.states))
208          self.list.add('Go to home', 'home')          self.list.add('Go to home', 'home')
209          self.list.add('Save & Quit', 'save_quit')          self.list.add('Save & Quit', 'save_quit')
210          self.list.add('Quit without save', 'quit')          self.list.add('Quit without save', 'quit')
211    
212      def makeBuoyList(self):      def makeBuoyList(self):
213          self.list = vob.vobs.SelectListVob(self.style)          self.list = vob.vobs.SelectListVob(self.style)
214          self.list.add('Unlink buoy', 'unlink')          self.list.add('Unlink buoy', self.UnlinkBuoy(self.states))
215          self.list.add('Go to home', 'home')          self.list.add('Go to home', 'home')
216    
217      def render(self, vs):      def render(self, vs):
# Line 233  class MouseMenu: Line 233  class MouseMenu:
233          self.x, self.y = x, y          self.x, self.y = x, y
234    
235      def hideList(self):      def hideList(self):
236          self.x, self.y = 0,0          if hasattr(self.states, 'lastEvent'):
237                self.x, self.y = self.states.lastEvent.getX(), self.states.lastEvent.getY()
238            else: self.x, self.y = 0,0
239          self.w, self.h = .0, .0          self.w, self.h = .0, .0
240    
241      def mouse(self, ev, vs):      def mouse(self, ev, vs):

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26