03-26-2014 02:17 PM
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
Solved! Go to Solution.
03-26-2014 06:40 PM
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:
Hope it helps!
Michael
03-26-2014 06:44 PM
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?
03-26-2014 06:49 PM
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
03-26-2014 07:03 PM
I'd probably stick with a title bar and disable the buttons if you are afraid someone is going to resize or dismiss it.
03-26-2014 07:06 PM
03-27-2014 06:39 AM
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
03-27-2014 07:40 AM
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
03-27-2014 09:38 AM
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
03-27-2014 10:10 AM
@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?