Selecting the isigraph to the event source is necessary
not only for paint event, but for all isigraph events.
For example, the capture scenario:
- mouse-down, you need it for capture
- mouse-move, you need it for glqwh, if you
are tracking (relative) mouse position
- mouse-up, you need it for release capture
(That's what's not hapenning in grid)
Also,
- size, you need it for glqwh
On Windows it is set implicitly for most cases,
except mouse-down. But in Java you need for all
of them (maybe except paint) to set it explicitly.
To demo see Splitter and the new idea of real-time
dragging, which is very cool, and was just implemeted
right now. For clear case, nothing is done to conceal
many breakdowns as it runs under Java.
See http://www.jsoftware.com/jwiki/Scripts/Splitter
To reduce the chance of painting from a different event,
there is wd 'setinvalid' (only for win32 though), which
will ensure that paint is invoked with correct id selected.
Then even if you resize a form or capture with
one isigraph, but paint the other, when the other
receives the paint event, it is also already
selected automatically.
And selecting the current isigraph for all events
automatically is a very cheap operation, compared
to other overhead.
On the other hand, having to do it in user code
is both more expensive and bloats the code.
--- Eric Iverson <[EMAIL PROTECTED]> wrote:
> I haven't looked at your example yet. The intent is that when the paint
> handler is called the isigraph with the event is automatically set as
> the target for gl commands in the paint handler. The only time you need
> glsel is for code not under a paint handler or when you want to gl stuff
> to a control other than the one the handler was called for. Do you
> observe otherwise?
>
> Ah, just read your message more carefully and see the magic word
> capture. This is a capture problem, not a glsel problem. Until capture
> is released all mouse events go to the isigraph that did the capture (no
> matter where the mouse is). My guess/hope is that this is a bug in the
> grid J code that is just not doing the capture release in some case.
> We'll try to reproduce the problem and see what if going on.
>
> ----- Original Message -----
> From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
> To: "Beta forum" <[email protected]>
> Sent: Wednesday, August 16, 2006 12:26 PM
> Subject: [Jbeta] Grid fails on "default gl control" issue
>
>
> > To reproduce
> > * run the script below
> > * click inside second grid
> > * drag the thumb of scrollbar on first grid
> >
> > As a result, the first grid is locked
> > together with any other J windows and controls,
> > except the second grid. Capture was invoked
> > on behalf of the other grid, because on the
> > mouse down event, there wasn't a "glsel" for it.
> >
> > There is a simple solution to simplify and
> > foolproof all gl2 code: to issue glsel on
> > any isigraph event, implicitly inside WD.
> >
> > The only exception is when you control painting
> > of one isigraph from external events.
> > That's the only case when explicit glsel
> > will be needed.
> >
> > The "default gl control" issue is described at
> > http://www.jsoftware.com/jwiki/System/Library/Bugs
> >
> >
> > NB. =========================================================
> > F=: 0 : 0
> > pc f;
> > xywh 6 6 80 80;cc g1 isigraph rightscale bottommove;
> > xywh 94 6 80 80;cc g2 isigraph leftscale rightmove bottommove;
> > pas 6 6;pcenter;
> > rem form end;
> > )
> >
> > f_run=: 3 : 0
> > wd F
> >
> > g1=: '' conew 'jzgrid'
> > GRIDID__g1=: 'g1'
> > CELLDATA__g1=: i.100 100
> > show__g1''
> >
> > g2=: '' conew 'jzgrid'
> > GRIDID__g2=: 'g2'
> > CELLDATA__g2=: i.100 100
> > show__g2''
> >
> > wd 'pshow;'
> > )
> >
> > f_close=: 3 : 0
> > wd'pclose'
> > )
> >
> > f_run''
> >
> > NB. =========================================================
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm