You're right, this is a bug. We've fixed it and it will be included in the next release of CVI. Thanks for reporting it!
In the meanwhile, I came up with a workaround that you can use until the fix is available. It's a bit clunky, but it should work. It's based on the idea of catching the mouse click yourself, before the table control does, and perform the cell switch yourself, without allowing the table to do it. As an example, you can use the following function as the table's callback:
int CVICALLBACK CB_Table (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
Point coord, activeCell, clickedOnCell;
int state;
switch (event)
{
case EVENT_LEFT_CLICK:
GetCtrlAttribute (panel, control
, ATTR_TABLE_RUN_STATE, &state);
// the table has to be in edit mode
if (state == VAL_EDIT_STATE)
{
GetActiveTableCell (panel, control, &activeCell);
PointSet (&coord, eventData2, eventData1);
GetTableCellFromPoint (panel, control, coord, &clickedOnCell);
// the click has to take place in the grid area
if (clickedOnCell.x > 0 && clickedOnCell.y > 0)
{
// the user has to click on a cell other than the one being edited
if (activeCell.x != clickedOnCell.x || activeCell.y != clickedOnCell.y)
{
// change the active cell "manually"
SetActiveTableCell (panel, control, clickedOnCell);
return 1; // swallow the click event
}
}
}
break;
}
return 0;
}
Luis
NI