From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-18-2018 03:52 AM
Dear all,
I have a little problem ( or I dont know how to manage it) with the double click detection in a table.
I am using CVI 2017.
I have a scroll bar to change the viewing. As soon as I use double click inside the scroll bar, the EVENT DOUBLE CLICK is sent,
Correct.
But I have no ( or I didnt found any ) possibility to detect whether I am inside the scroll bars or inside the panel
the values of eventdata1 and eventdata2 shows me always the latest selection !
Does anybody have an idea how to manage ?
Thanks a lot
06-22-2018 02:09 AM
Hello Jurgen,
If I understand correctly you want to know whether the double-click happened inside a cell of a table control. If that's the case then GetTableCellFromPoint is what you need. If the selection is not in a table cell, GetTableCellFromPoint will return {0, 0}, otherwise the cell that was doulbe-clicked in.
06-25-2018 11:48 PM
I included this command in the source code.
But I always get {0,0} as a result. Independent whether I double click in the title of the table, the slider or on a table cell
The control mode of the table is HOT,
the source code I used is below.
if (event == EVENT_LEFT_DOUBLE_CLICK )
{
Point point = {0},
cell = {0};
i = GetActiveTableCell ( panel, control , &point);
i = GetTableCellFromPoint (panel, control, point, &cell);
}
Any Idea ?
Returncode is always 0
Thanks
06-26-2018 01:20 AM - edited 06-26-2018 01:23 AM
I have used double click event on tables but with a slightly different coding. Knowing that (from userint.h):
#define EVENT_LEFT_DOUBLE_CLICK 4 /* eventData1 = mouse vertical pos. */ /* eventData2 = mouse horizontal pos. */
the correct code appears to be this one:
case EVENT_LEFT_DOUBLE_CLICK: GetTableCellFromPoint (panel, control, MakePoint (eventData2, eventData1), &cell); if (cell.x && cell.y) { // We are on an actual table cell } break;
(As you can see in the help for the function, GetTableCellFromPoint expects point to be in pixel coordinates, not in cell indexes)
06-26-2018 06:05 AM
Thanks a lot.
That solved it. I understand the difference
My fault