LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

edit values in table

Hello group

I have a panel with an 10x5 cells table on it. I like the user to input data
to the table. I like the cursor to move horizontaly from cell to cell when
the user pushes the key, but the cursor moves to the next cell
verticaly.
e.g. I lik ethe cursor to go from 1,1 to 2,1, but the corsor goes to 2,1 (I
hope you know what I mean)

How can I change this? I have changed the "Table Mode" with the UIR Editor,
but it makes no difference. Any suggestion is welcome.

Stephan
0 Kudos
Message 1 of 2
(3,132 Views)
You can use the Event_Keypress event in the Table's callback function to catch the Enter key's action and programatically set the Active Table Cell with SetActiveTAbleCell( ).

Here is an example of the callback function.

int CVICALLBACK Table (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event) {
case EVENT_KEYPRESS:
if (eventData1 == VAL_ENTER_VKEY) {
GetActiveTableCell (panelHandle, PANEL_TABLE, &previousCell);
printf("Enter pressed in table!\n");
SetActiveTableCell (panelHandle, PANEL_TABLE,
MakePoint ((previousCell.x + 1), (previousCell.y)));
}
break;
}
return 0;
}

Jason Foster
Measurement Studio Support Engineer
National INstruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,132 Views)