02-25-2015 12:29 AM - edited 02-25-2015 12:36 AM
Hi,
On a control, I need a click to switch display between 2 values, and a double click to enter a new value for the value actually shown.
I wrote something like that :
int CVICALLBACK OkCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
// do something
break;
case EVENT_RIGHT_CLICK:
// If value A displayed, display value B else display value A
break;
case EVENT_RIGHT_DOUBLE_CLICK:
// If value A displayed, enter new value A else enter new value B
break;
}
return 0;
}
The problem is that if I double click on the control, the callback is called twice. A fisrt time with EVENT_RIGHT_CLICK and a second time with EVENT_RIGHT_DOUBLE_CLICK event
How can I do ?
I tried to replace EVENT_RIGHT_CLICK with EVENT_MOUSE_WHEEL_SCROLL but when I scroll the wheel this event is not sent. Why ?
Regards.
03-12-2015 03:23 AM
Hello I tested this code it works well
http://digital.ni.com/public.nsf/allkb/9C37374EDA404D02862569ED00566B5F?OpenDocument
Regards
Samuel G. | GEMESIS
Certified LabVIEW Architect
Certified TestStand Developer
03-12-2015 09:54 AM
Hello,
Thank you for your answer.
I created a new project with this code :
int CVICALLBACK MouseClickTest (int panel, int control, int event,void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_LEFT_DOUBLE_CLICK: // Catch double left-clicks
MessagePopup("Debug", "DOUBLE_CLICK");
break;
case EVENT_LEFT_CLICK: // Catch single left-clicks
MessagePopup("Debug", "CLICK");
break;
}
return 0;
}
and it does not work.
I can't see DOUBLE_CLICK message popup, even if I click the mouse button extremely fast, as it is sait at the end of the link you posted.
Regards.
03-12-2015 10:03 AM
hello,
I used the code of callback exemple and I added the case structure.
Could you try it
Regards.
Samuel G. | GEMESIS
Certified LabVIEW Architect
Certified TestStand Developer
03-13-2015 05:16 AM - edited 03-13-2015 05:16 AM
Hello,
Thank you for your help.
It doesn't work. Same problem.
Code of "EVENT_LEFT_CLICK" is executed first when I make a double click.