LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Made a window with no toolbar draggable

Solved!
Go to solution

Hi Guys,

 

I have a popup window with no toolbar.  I'd like to be able to drag it around the screen, but am having issues coming up with a good way..

 

I think using a mouse-down event on the pane is good, but I can't come up with a way to set the windows cordinates. Have any ideas?

 

Thanks!
Christopher

0 Kudos
Message 1 of 17
(3,446 Views)

Hi,

I think I can get you started, clearly there is more to do but you get the idea...  I put this together for you to demonstrate:

move pane.PNG

Hope it helps!

Michael

0 Kudos
Message 2 of 17
(3,412 Views)

Can you alt-space, "m" to "m"ove the window?

 

Are you looking for a way to do it with kbd/mouse in the UI, or do it programmatically?

0 Kudos
Message 3 of 17
(3,404 Views)

I guess he means no title bar, or there would be no problem.  You cant do Alt Space if you dont have a title bar, and guess he wants to do it with the kbd/mouse as he is asking about events.  or maybe i am guessing too much Smiley Wink

0 Kudos
Message 4 of 17
(3,402 Views)

I'd probably stick with a title bar and disable the buttons if you are afraid someone is going to resize or dismiss it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 17
(3,393 Views)
I usually do as the events method can get messy. But there are times where a neat little popup is better without the title bar and the programming effort is worthwhile.
0 Kudos
Message 6 of 17
(3,390 Views)

Thanks, great start!  I think some code from this demo will finish it off -

https://decibel.ni.com/content/groups/ui/blog/2010/11/14/iphone-like-scrolling-through-controls

 

0 Kudos
Message 7 of 17
(3,371 Views)

So, its draging, but has the shakes 🙂  Also, it doesn't quite keep up with the mouse. Are the increments that the mouse uses different than the fp.bounds increments?

 

Check out this vi. Do you have any ideas on smoothing out the shakes?

 

Thanks!
Christopher

0 Kudos
Message 8 of 17
(3,366 Views)

I remember doing this a long time ago, i think the mouse coords are relative to the pane so you'll need to set the same offset each time.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 17
(3,347 Views)

@Michael_78 wrote:
I usually do as the events method can get messy. But there are times where a neat little popup is better without the title bar and the programming effort is worthwhile.

I understand that a custom interface is desirable, but there are other things to consider also.

 

1) Efficiency.  Using the title bar to drag a window is efficient because you are using aomething already included in the Windows API and you aren't reinventing the wheel.

 

2) Usability.  Will the customer have to ask you how to drag the window around?

 

3) Is it worth spending time (and money) developing this custom interface?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 17
(3,341 Views)