Button press and release in different Windows (Regions?)

Hi.

How do you track a button release on a different window (region), other than
the window (region) where the button press occurred?

I would like to implement a similar multi item selection scheme, such as in
Phab for my app.

Where do you draw the selection rectangle from? I noticed that in Phab the
selection rectangle goes outside Phab main window (region).

Any source code examples would be much appreciated.

Thanks

Augie

Augie Henriques <augiehenriques@hotmail.com> wrote:

Hi.

Hi Augie

How do you track a button release on a different window (region), other than
the window (region) where the button press occurred?

Register a raw callback on the button – look for button release
events with subtype phantom. One of these is always sent to the
widget that got the button press event, regardless of where the
eventual (real) release takes place.


I would like to implement a similar multi item selection scheme, such as in
Phab for my app.

Where do you draw the selection rectangle from? I noticed that in Phab the
selection rectangle goes outside Phab main window (region).

Don’t know for sure how they’re doing that, but my first guess is
a transparent region that covers the entire console. That would
let you initiate bounding boxes (just a varient on dragging – see
the docs). When the user releases, having established a box, it
would be up to you to translate those coordinates and see what
elements you have within your window that lie within.

Any source code examples would be much appreciated.

Haven’t got anything to hand that does just this, sorry. You
took the Photon course at one point, I believe, so you should
have a sample that puts up a region from code. Take that as your
starting point. You’ve also got code from the same samples
directory that does dragging. It shouldn’t take you too long to
convert from dragging to bounding if you play with it for a bit.

Hope this is of some help.



Norbert Black
QSSL Training Services

Norbert Black <nblack@qnx.com> wrote:

Augie Henriques <> augiehenriques@hotmail.com> > wrote:
I would like to implement a similar multi item selection scheme, such as in
Phab for my app.

Where do you draw the selection rectangle from? I noticed that in Phab the
selection rectangle goes outside Phab main window (region).

Don’t know for sure how they’re doing that, but my first guess is
a transparent region that covers the entire console. That would
let you initiate bounding boxes (just a varient on dragging – see
the docs). When the user releases, having established a box, it
would be up to you to translate those coordinates and see what
elements you have within your window that lie within.

Nah, the bounding box selection uses drag events. Check out
PhInitDrag() in the docs.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.