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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

EVENT_LEFT_DOUBLE_CLICK in a table

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

 

0 Kudos
Message 1 of 5
(2,352 Views)

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.

Message 2 of 5
(2,315 Views)

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 

0 Kudos
Message 3 of 5
(2,290 Views)

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)



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(2,287 Views)

Thanks a lot.

That solved it. I understand the difference

My fault

 

 

0 Kudos
Message 5 of 5
(2,273 Views)