gzz-dev
[Top][All Lists]
Advanced

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

[Gzz] events and 2002-12-19/20 (mudyc)


From: Matti Katila
Subject: [Gzz] events and 2002-12-19/20 (mudyc)
Date: Sat, 21 Dec 2002 16:17:32 +0200 (EET)

* improved handling of events in pp.
    -benja suggested that identification object should be object not 
     string. I think it's doable - althought i still don't see the reason 
     (a big program vs. small program like pp) very clearly.

Ok, fast howto for easy interface.
in View's render:
   ev_handler.cleanCallers();

   // ...

   int frameCS = vs.someCS(...);
   vs.activate(frameCS);
   ev_handler.onClick(frameCS, "Link CLICK",
                      new Object[]{ c, connectedFrom});


Now if you click the cs, "Link CLICK" event should be executed if it is 
assigned. Assigning can be done like this:

   EventHandling.i().assign("Link CLICK", new LinkPaper() );    

Where LinkPaper object implements EventHandling.EventMouseObj.

For example:

    public class LinkPaper implements EventHandling.EventMouseObj {
        public void event(MouseEvent ev,
                          EventHandling.MousePressState p_state, 
                          Object[] obs) 
        {
            context.setAccursed((Cell)obs[0]);
            AbstractUpdateManager.chg();
        }
    } 


As tjl sees, here is new interp code needed ;)

Some positive points:
  +many cs can be assigned to one handler (that's the case in pp)
  +readability
  +better dragging customizable.
Some negative points:
  -dragging is a bit kludge. anyway it's better and fully customized. it 
   wasn't at the age when the only code was jython.
  -global EventHandling (not difficult to make View's
   attribute for example)
  -cs key independent from EventObj's key. (At least Benja was unhappy 
   with this feature)
  -long names :)


   -Matti




reply via email to

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