LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

move pane by mouse

i want to use mouse to move pane, by registering three events: mouse down?, mouse move, and mouse up
 
in mouse down? handler: i get the current mouse coordinate and register pane mouse move event.
in mouse up handler: i unregister pane mouse move event.
in mouse move handler: i calculate the distance of mouse, then change the origin of pane.
 
throught this way, i can move pane, but it is not nice, the move is not smooth as i expected, i try several times, still same?
 
any suggestion?
 
Thanks
0 Kudos
Message 1 of 13
(4,034 Views)

Hi

Your idea is not that bad. What you could do to improve, is just to move the pane after the mouse up event. Instead of moving the pane in each mouse move event, you could calculate dx and dy.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 13
(4,024 Views)
Hi becktho,
 
I've just been trying this one.  Any chance you could back-save it to LV 7.1?
 
 

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 3 of 13
(4,018 Views)

No problem. Here you are...

 

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 13
(4,016 Views)

i get it, thank you so much.

by the way, do you know whether it is the same way in vc++

 

0 Kudos
Message 5 of 13
(4,011 Views)

Hi Becktho,

Thanks - although LV didn't like it. I guess it's probably down to the fact that panes aren't in LV7.1

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 6 of 13
(4,011 Views)

Yes you're right - didn't think about that.

But basically you should be able to do it the same way by setting the panel origin.

If it is the same in VC++ I can't tell you. The basic idea should be useable there as well.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 7 of 13
(4,008 Views)
hi becktho
 
i create a vi without menu, window title, toolbar. i resize the window to fit a control. refer to the following vi, how can i move it smoothly using mouse event?
 
thanks
0 Kudos
Message 8 of 13
(3,997 Views)

Hmm - two brians with the same type of task. Seems to be some school exercise.

Well brian005 - you can look at the other answers. I don't want to post the same thing twice.

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 9 of 13
(3,989 Views)

it is different, in this case, you cannot get mouse event over pane, instead, get mouse event over the control, the difference between control and pane is: you always can get mouse up event of pane, but for control, you always lost the mouse up event, because the mouse move out the control, so the way should be different.

you can try the following vi

any suggestion?

thanks for reply

0 Kudos
Message 10 of 13
(3,986 Views)