01-03-2009 03:36 PM
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. 🙂
01-03-2009 03:49 PM - edited 01-03-2009 03:50 PM
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.
01-03-2009 04:02 PM - edited 01-03-2009 04:03 PM
And actually, the stripped down version is rather compact ! 😉 😄
01-05-2009 01:47 AM
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
01-05-2009 06:44 AM
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... 😉
01-05-2009 06:50 AM
01-05-2009 07:49 AM
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
01-05-2009 01:41 PM - edited 01-05-2009 01:48 PM
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.
01-06-2009 01:50 AM
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
01-06-2009 03:22 AM
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.