How to click and drag form one panel and focus on another panel?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to click and drag form one panel and focus on another panel?

steve
Hi,

I have a main panel, and on this panel there are 4 sub-panels. I want to left-click on PANEL 1 and then drag mouse to another panel (say PANEL 4) and when I release the left click button, it should print "You dragged from PANEL 1 to PANEL 4". Do you know how to do this?


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to click and drag form one panel and focus on another panel?

Chris Barker - NOAA Federal


On Mon, Aug 6, 2018 at 1:13 PM, steve <[hidden email]> wrote:
I have a main panel, and on this panel there are 4 sub-panels. I want to left-click on PANEL 1 and then drag mouse to another panel (say PANEL 4) and when I release the left click button, it should print "You dragged from PANEL 1 to PANEL 4". Do you know how to do this?


I don't have time to work out the details for you, but one way is to use CaptureMouse:


In a Mouse Down event, and then do the right thing on mouse up.

Alternatively, you could set a "mouse clicked in a panel" value on Mouse down on all your panels, and then check that flag when there is a mouse up event in any of the panels.

But you'll have to be sure to clear that flag whenever the mouse is released anywhere else.

-CHB


--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.