LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

move panel

how can i move panel without draging the title bar?
0 Kudos
Message 1 of 9
(4,362 Views)
In your program, you can call SetPanelPos() to explicitly set a position.
Or, when the program is running, you can press , then press M (for Move), then use the cursor keys to move the window, then press to accept the position. The won't work if in Edit Panel >> Other Attributes you disabled Movable or Title Bar Visible.
0 Kudos
Message 2 of 9
(4,363 Views)

I think there was something lost when the forums were migrated. At least i don't get any results when I press the comma and then the M 🙂

I would like to be able to move title-bar-less child panels around, so if anyone has any ideas 🙂

Regards,

 

Erwin Timmerman

0 Kudos
Message 3 of 9
(4,307 Views)

Als probably meant Alt + < Space bar> and then hitting M. This allows you to move the active window using the keyboard.

You could use the Extended mouse events to move the panel based on the mouse position.

Bilal Durrani
NI
0 Kudos
Message 4 of 9
(4,299 Views)

How is it possible to move the panel with holding down the mouse on an object? (i.e. I want to make my own custom titlebar on top of the program and have the panel-moving option while the mouse left key is held down)

0 Kudos
Message 5 of 9
(3,904 Views)

Arash:

 

If I understand your question correctly, you want to replace the built-in title bar with a custom bar, and you want to be able to move your panel by clicking and dragging on your custom bar.

 

Take a look at the attached sample.  I set the panel attribute Title Bar Visible to false.  I added a picture at the top of the panel as the new title bar.  I used mouse events to know when the title bar is clicked on, when the mouse is moved, and when the mouse button is released.  I move the panel when the title bar is clicked and dragged.

I used the "obsolete" extended mouse events to allow the mouse event EVENT_LEFT_MOUSE_UP to be trapped even if the mouse moves off the panel.
Using the new built in event EVENT_LEFT_CLICK_UP, if the mouse is moved fast enough to move off the panel before the panel is moved to it, EVENT_LEFT_CLICK_UP is not seen.  Since, in my sample, I use the event generated by releasing the mouse button to know when to stop moving the panel, if EVENT_LEFT_CLICK_UP is missed because the mouse was moved so fast that it was temporarily off the panel, the panel keeps moving even after the mouse button is released.

 

I tested it in CVI 6.0 and 9.0.1.

 

0 Kudos
Message 6 of 9
(3,838 Views)

This was a great response. It worked and thank you very much for the source code

0 Kudos
Message 7 of 9
(3,831 Views)

Hi,


Just what I want, though when I incorporated the code, I am not detecting EVENT_MOUSE_MOVE.

I tried to run the demonstration code.

This compiles OK when when I run it, I get the error

Library function error .... The format of the file is newer than this version of CVI

I am using CVI 6.0

Is it possible to post a version that operates under CVI 6.0 please?

0 Kudos
Message 8 of 9
(3,453 Views)

Belay that request, I have sorted it

I created my own uir file (under CVI 6.0) and then discovered that I had forgotten the call EnableExtendedMouseEvents(...)

0 Kudos
Message 9 of 9
(3,439 Views)