LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Click on Command Button does not COMMIT

Solved!
Go to solution

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

0 Kudos
Message 1 of 10
(4,877 Views)

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.



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 2 of 10
(4,874 Views)

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

0 Kudos
Message 3 of 10
(4,867 Views)

It's in Hot control mode. I've tried every mode and nothing seems to create any event.

0 Kudos
Message 4 of 10
(4,866 Views)

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

0 Kudos
Message 5 of 10
(4,865 Views)

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".

0 Kudos
Message 6 of 10
(4,862 Views)

Let's see:

  • Is it the only button that exposes this behavior? Are there other buttons on the user interface that behave regularly?
  • Which type of button is it?
  • Can you temporarily install a new control callback to the button with only some MessagePopup associated to the events and see if it behaves regularly?
  • Which release of CVI and TestStand are you using?


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 7 of 10
(4,839 Views)

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

 

0 Kudos
Message 8 of 10
(4,826 Views)
Solution
Accepted by topic author JulianC

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.



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 9 of 10
(4,804 Views)

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

0 Kudos
Message 10 of 10
(4,796 Views)