02-17-2013 10:05 AM
Hi
I want to highlight the whole row when either cell is clicked on. This works with the below code
but i loose the collumn number. It is always 1
case EVENT_ACTIVE_CELL_CHANGE :
case EVENT_SELECTION_CHANGE :
GetActiveTableCell(panel,control,&cell);
SetTableSelection(panel,control,MakeRect(row,1,1,9));
break;
I would like to get the correct collumn when the event EVENT_LEFT_DOUBLE_CLICK is invoked
and then enable edeting the cell.
Anyone ?
Regards Per
02-17-2013 06:24 PM
I don't think you can maintain the selection on the whole table row while editing a single cell in the row. What you can do is to change the background color of row cells with for example SetTableCellRangeAttribute (panelHandle, PANEL_TABLE, VAL_TABLE_ROW_RANGE (row), ATTR_TEXT_BGCOLOR, VAL_BLUE);
The problem will then be to correctly detect that the user has moved the focus to another row and move highlighting accordingly.
02-18-2013 07:27 AM
Hi
The problem is that when I call
GetActiveTableCell(panel,control,&cell) it always returns 1 in cell.x
after the call to
SetTableSelection(panel,control,MakeRect(cell.y,1,1,9));
Thereby I have no longer acces to which collumn the click was made on.
What I want to do further then the the example code is to acces the correct cell on
the event EVENT_LEFT_DOUBLE_CLICK
Regards Per
02-18-2013 07:58 AM
Per,
You can use the GetTableCellFromPoint function with the panel coordinates that are passed to the callback function:
GetTableCellFromPoint (panel, control, MakePoint(eventData2, eventData1), &cell);
Luis
02-18-2013 08:02 AM
Well, it seems obvious, but...
What if you call GetActiveTableCell BEFORE selecting the row? As you can see in the help,
If you set the cell selection to be nonempty, the table control sets its active cell to be the first cell in the new selection.