LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Pop-up Menu in the Table

I have a problem with a pop up menu in the table control. Currently, I have set my table to HOT and i have 3 columns in my table which are set to Indicator, which allows me to select/highlight the cell but yet dosen't change the content in the cell.

But when i highlight let's say 3 cells in the same column and right click, a popup menu appears with 3 functions. Goto, Find and sort. I think this came together with the table control. I would like to disable the sort function as it rearranges the cell which are highlighted but not the rest of the cells in the next 2 columns. In my case this is not very good for me as all 3 columns are related to each other like column 1 = Name, column 2 = value, etc... Is it possible to disable to the sort function??

Cheers
AL
0 Kudos
Message 1 of 5
(3,347 Views)
You can hide some of the built-in menu item with HideBuiltInCtrlMenuItem () function.

In case you need it, you can add your own funtions to the popup menu using NewCtrlMenuItem ().


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,343 Views)
Hi Roberto,

thanks for the help, it works!! Didn't know there was such a function.

cheers
AL
0 Kudos
Message 3 of 5
(3,328 Views)

I have a program with 3 different tables and wanted to make my own menu for the right click menu.  When doing so, my menu appears first.  And then after click elsewehere or a function, the default one appears with the Goto, Find, Sort items.  I obviously do not want these so my question is how to resolve this?

 

Do I need to use the function HideBuiltInCtrlMenuItem to every single table for each of those three?  It seems if I hide all three of those items, the menu does not appear at all which solves my issue.  Is this the correct way to do this?  Otherwise adding items to the built in list would work, but have no idea how to do that, or if it's possible.

 

Thanks

0 Kudos
Message 4 of 5
(2,936 Views)

It seems strange to me that the built-ion popup menu appears after your own menu is displayed: how are you displaying your popup menu? If you are using RunPopupMenu to handle the right-click event and display your menu it is possible that it fires the built-in menu also.

 

If you don't need the built-in popup menu you do not need to remove every single item from it: you can use SetCtrlAttribute (panelHandle, PANEL_TABLE, ATTR_ENABLE_POPUP_MENU, 0); instead.

In every case, this is a control attribute: you must isse this line for every single table you want to customize: SetAttributeForCtrls ( ) from the Programmer'sToolbox is very useful in this matter.

 

As already mentioned in this thread, to add items to the built-in menu you can use NewCtrlMenuItem ()



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(2,904 Views)