LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

remove run time menu


chilly charly wrote: 

Here, the challenge is to have the RTMs for the radio buttons inside still actives while the RTM for the housing control is programmatically enabled or disabled.


Yes, that's why I suggested to look at the coordinates of the mouse down and only filter if it occured in certain areas.

 

Ah yes! I just noticed that the menu activation fitering event also provides coordinates in the event terminal, so maybe that would work equally well. I have not played with this. 🙂

Message 11 of 21
(1,609 Views)

altenbach a écrit:

chilly charly wrote: 

Here, the challenge is to have the RTMs for the radio buttons inside still actives while the RTM for the housing control is programmatically enabled or disabled.


Yes, that's why I suggested to look at the coordinates of the mouse down and only filter if it occured in certain areas.

 Ah yes! I just noticed that the menu activation fitering event also provides coordinates in the event terminal, so maybe that would work equally well. I have not played with this. 🙂


I agree that this could be a working solution. However, I doubt that its implementation will be easy. What if the developper moves the buttons inside ? 😉
The difficulty comes from the fact that if you filter the mouse down event in the housing control, the event will not be passed to the "subObjects". And of course you'll be into trouble if you need to activate the radio buttons RTMs. Same situation if you decide to disable/delete the housing control RTM. In the solution I have proposed above, the logic is inverted : the default state is that the housing control has no RTM, so that the Menu activate event is passed directly to the radiobuttons inside. Eventually, a RTM is dynamically built if required.

 

Message Edité par chilly charly le 01-03-2009 10:50 PM
Chilly Charly    (aka CC)
Message 12 of 21
(1,603 Views)

And actually, the stripped down version is rather compact ! 😉 😄

 

Message Edité par chilly charly le 01-03-2009 11:03 PM
Chilly Charly    (aka CC)
Download All
Message 13 of 21
(1,599 Views)

Hi CC,

I ran both of your VIs and got an error stating "Object reference is invalid" when clicked inside the RB Control.

However, its working fine for the RS button(inside RB Control), but giving out an error for RB Control.

 

Did you run it on your system without any problem ?

 

 

Thanks,

Ritesh

0 Kudos
Message 14 of 21
(1,565 Views)

No problem on my system (WinXP, LabVIEW 8.6). Otherwise I wouldn't have posted (and discussed) it ! 😮

I'll try later on other LV versions, just in case... 😉

Chilly Charly    (aka CC)
0 Kudos
Message 15 of 21
(1,554 Views)
You will get an error if you click on the frame of the cluster control or in the background of the cluster control (i.e. not right-clicking on RS1 or RS2).  This is due to there being no sub object.  You just need to check the subobject reference to verify it is a valid reference before you attempt to execute the code.
0 Kudos
Message 16 of 21
(1,550 Views)

Hi Matthew,

I followed up your suggestion and made a case structure of Error/No Error. It just worked fine.

I wonder how is it working for Chilly Charly.

 

Thanks,

Ritesh

0 Kudos
Message 17 of 21
(1,539 Views)

There is indeed an error fired when you click in the housing control. However, there is a setting in the LabVIEW diagram options to disable automatic error handling. This is my default configuration. I don't want to be obliged to check for every possible error. This makes my diagrams much simpler ! 😉

 

And BTW, in the "Menu selection CC 2.vi" above, the true and false cases are inverted... sorry for that.

Message Edité par chilly charly le 01-05-2009 08:48 PM
Chilly Charly    (aka CC)
Message 18 of 21
(1,528 Views)

Dear all,

Thanks alot for you support and Help.

That indeed solved the problem.

 

Now, as even after disabling the Radio Button Control, it shows an empty menu item. I thought of disabling all the elements of the menu.

Is there any way to disable all the items in the menu using "set item info.vi" once, or do i need to use it to independently disable all the menu items ?

 

Thanks,

Ritesh

0 Kudos
Message 19 of 21
(1,510 Views)

Sorry Ritesh, I can't reproduce your problem. In the example VIs I have exposed, there is no such problem. Could you post a VI that shows where the difficulty is ?

Remember, as I explained above, the trick is to create an empty RTM during the edition of the VI, then to programmatically create the menu. I could not obtain a correct result when reversing the operation order.

Chilly Charly    (aka CC)
0 Kudos
Message 20 of 21
(1,502 Views)