LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RE: Creation of drop down menu

Hi to all Labview Pros out there!

 

I would like to create a drop down menu using the ring menu function. I am able to do it. The problem is I would want the menu to drop down when my mouse is over the ring control(while the program is running). This I am unable to do it and would like some help in implementing my idea. Another issue is that, the drop down should occur 2 seconds after the mouse is over the ring button. Afterwhich, the user is able to click a selection from the menu. (Currently, by default the drop down takes place when the mouse is clicked on the button. I would want to do away wiht this style.

 

Eagerly awaiting responses!

 

Thank you!

 

0 Kudos
Message 1 of 6
(4,249 Views)

Unfortunately, there is currently no way to programatically activate the drop-down menu of a ring.  You have a couple of options.  The first is to use user32.dll calls in Windows (assuming you're using Windows) to simulate a mouse click in the correct area of the screen that would activate the ring (i.e. the little down arrow of the ring).  The second option is to use a picture control with transparent borders and draw a picture that looks exactly like the ring drop-down, and position it exactly on the front panel where the drop-down would be.  If there's a chance that the drop-down would go past the border of the panel, you would need to have the picture be on the front panel of a VI that you spawn and position in the correct location.  You would make the picture (or VI) visible after 2 seconds, then when the user clicks on it, you would make it invisible, and change the value of the ring to correspond to whatever "menu" option they picked.

 

Neither of these solutions is trivial.  If you come up with a modular (i.e. reusable) solution, make sure to post it here!

 

Good luck,

-D

 

P.S. - It might not be a bad idea to submit a product suggestion that the drop-down menu of a ring could be programmatically invoked.

 

P.P.S. - I just had another idea...perhaps there's a .NET control (again, on Windows) that natively behaves in the manner you're looking for?

0 Kudos
Message 2 of 6
(4,237 Views)

Hi Darren

 

Thanks for the reply.

 

 Is it possible to trigger the mouse enter event to trigger after specific amount of time(for instance, the mouse is at a button for two seconds)? For now, in LV, the mouse enter event happens instantaneously the moment the mouse is onto the button. Is the a way to modify the event? If the mouse is moved from the button before the 2 s time frame, the mouse enter event must not trigger.

0 Kudos
Message 3 of 6
(4,232 Views)

Hi,

 I don't think you can modify the mouse enter event in itself, but instead perhaps you could use this event to begin a timer. Then, add another case into your event structure for the mouse leave event. If this event is triggered before 2 seconds expires, then the timer should stop and reset.

You'd need to program the timer in a separate loop, ie: not in the same loop as your event structure. Once the timer reaches 2 seconds, you could use that to generate a programmed user event, that would then get triggered in your event structure and perform the drop-down box operation.

Have you given any thought to using an xcontrol? I would think it well suited to handle this type of operation.

 

Regards,

Andy

0 Kudos
Message 4 of 6
(4,221 Views)
What is XControl? How do I use XControl? An example would be nice 
0 Kudos
Message 5 of 6
(4,190 Views)

There's a example that comes with Labview called Dual-Mode thermometer, try having a look at that first of all. It's a good starting point to understanding how xcontrols work.

I'll try and post another example of an xcontrol on here tomorrow.

 

Regards,

Andy

0 Kudos
Message 6 of 6
(4,186 Views)