Hello,
I have a 3x7 table. Column 1 is for label, and column 2 and 3 are for storing doubles. I was able to manipulate the cursor, to put it where I want on the right cell, and able to change the values on the table (column 2 and 3) graphically. But when the program tried to read in the new entered value from the cell using GetTableCellVal, all the data read in were zeroes (zeroes were the initial values). And the function returned zero that indicated a success call.
Please show me how I can read in the new values from the table. Thank you.
Here is my code:
switch (event)
{
case EVENT_KEYPRESS:
GetCtrlAttribute(panel, PANEL_CAL_MANUAL_CAL_TABLE, ATTR_TABLE_RUN_STATE, &state);
if (state == VAL_EDIT_STATE) {
keyCode = GetKeyPressEventVirtualKey(eventData2);
if (keyCode == VAL_ENTER_VKEY) {
GetActiveTableCell(panel, PANEL_CAL_MANUAL_CAL_TABLE, &cell);
status = GetTableCellVal(panel, PANEL_CAL_MANUAL_CAL_TABLE, cell, &tempDoubleData);
//Get the Tx Value from Column 2
if (cell.x == 2)
gManualMeas[cell.y-1].mTxVal = tempDoubleData;
//Get the Rx Value from Column 3
if (cell.x == 3)
gManualMeas[cell.y-1].mRxVal = tempDoubleData;
if (cell.x < 3) {
cell.x++;
SetActiveTableCell(panel, PANEL_CAL_MANUAL_CAL_TABLE, cell);
SetCtrlAttribute(panel, PANEL_CAL_MANUAL_CAL_TABLE, ATTR_TABLE_RUN_STATE, VAL_EDIT_STATE);
}
else {
if (cell.y != 7) {
SetActiveTableCell(panel, PANEL_CAL_MANUAL_CAL_TABLE, MakePoint(2,cell.y+1));
SetCtrlAttribute(panel, PANEL_CAL_MANUAL_CAL_TABLE, ATTR_TABLE_RUN_STATE, VAL_EDIT_STATE);
}
else {
SetActiveTableCell(panel, PANEL_CAL_MANUAL_CAL_TABLE, MakePoint(2,1));
SetCtrlAttribute(panel, PANEL_CAL_MANUAL_CAL_TABLE, ATTR_TABLE_RUN_STATE, VAL_EDIT_STATE);
}
}
return 1;
}
}
break;
}