LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with right clicking a table cell

I put a callback on a table and then check to see if the cell is right clicked in the callback. Then I popup a dialog using MessagePopup. However, when I right click a table cell that has been selected, and my popup dialog pops up and has been dismissed, I also get a popup which says "GoTo, Find, Sort" in a panel. Does anyone know how to disable this from popping up? Also, I notice that I have to select the cell first before I right click. Is there anyway to be able to just right click in the cell of a table without having to select the cell first with a left click?
Thanks,
Donna
0 Kudos
Message 1 of 2
(2,745 Views)
1. The popup menu can be disabled via SetCtrlAttribute (panel, control, ATTR_ENABLE_POPUP_MENU, 0);

2. Highlight a region in the table without need to click on a cell. In the table callback insert this code:
case EVENT_LEFT_CLICK:
case EVENT_RIGHT_CLICK:
GetTableCellFromPoint (panel, control, MakePoint (eventData2, eventData1), &cell);
if (cell.x == 0 && cell.y == 0) return 1; // Clicked outside the table area: swallow the mouse event
// Your code goes here for highlighting or managing cell content

Hope this helps
Roberto


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 2
(2,733 Views)