09-30-2015 10:15 AM
Hi,
I have a single Command Button on an UIR embedded in a dll which I call from TestStand. The button does nothing when trying to click in any way, but when I press <Enter> or <Spacebar> it works just fine. Can someone tell why this is happening?
int CVICALLBACK TERMINATE_BUTTON (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
//event action
break;
case EVENT_LEFT_CLICK:
//event action
break;
case EVENT_LEFT_CLICK_UP:
//event action
break;
}
return 0;
}
Thanks in advace,
JulianC
Solved! Go to Solution.
09-30-2015 11:02 AM
It's simply that is does not fires commit event or it doesn't fire click events also?
If the first one, the button could be set as normal instead of hot, which prevents commit events to be generated: look at Cotrol mode parameter in control settings for the button.
09-30-2015 12:08 PM
You can "operate" the UI within the UI editor and watch what events are generated. Note that you will get an EVENT_LEFT_CLICK and EVENT_LEFT_CLICK_UP before the commit event (if it is HOT as Roberto suggests checking).
Ian
09-30-2015 12:09 PM
It's in Hot control mode. I've tried every mode and nothing seems to create any event.
09-30-2015 12:15 PM
You are right about the EVENT_LEFT_CLICK and EVENT_LEFT_CLICK_UP events and then I see the COMMIT one. Although this is not possible while I load it on TestStand. I insist that the <spacebar> and <enter> keys DO work on TestStand
09-30-2015 12:25 PM
I debug this and place a breakpoint in the action that must be executed if the EVENT_COMMIT occurs and this only happens when I press <spacebar> or <enter>. Although, when I click the button the CVICALLBACK function gets called but the EVENT_COMMIT "never happens".
10-01-2015 01:59 AM
Let's see:
10-01-2015 08:44 AM
I've tried this with a Toggle and Command button. I've debugged this and the events associated with the actual clicking of the mouse do not happen (EVENT_LEFT_CLICK, EVENT_LEFT_DOUBLE_CLICK, EVENT_RIGHT_CLICK, EVENT_RIGHT_DOUBLE_CLICK, EVENT_LEFT_CLICK_UP and EVENT_RIGHT_CLICK_UP). On the other hand, the following events do happen: EVENT_KEYPRESS, EVENT_GOT_FOCUS, EVENT_MOUSE_POINTER_MOVE, EVENT_MOUSE_WHEEL_SCROLL.
LabWindows CVI 2013 Full Develpment System 13.0.0 (632)
TestStand 2013
TestStand Engine Version 2013 (5.1.0.266)
Sequence Editor Version 5.1.0.226
10-02-2015 01:43 AM
Hello JulianC, a small search in the forum showed up this thread that describes almost the same situation as yours: you could find useful hints there, especially in LuisG post marked as solution and following.
10-02-2015 08:34 AM
Thanks a lot. I've tried this just hours before your response and worked. I've checked the samples from CVI and they had the RunUserInterface() and CloseUserInterface(), so I added them to my code and it was solved.
Regards,
Julian