LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you de-select a numeric control?

CVI 2013SP1, Win7.

 

I have a touchscreen application with a bunch of numerics on the GUI.  The numeric control callback receives an EVENT_LEFT_CLICK when the operator touches a numeric.  The program pops up a keypad, operator enters a number, touches ENTER, the new value is sent to the numeric control, and the popup is dismissed. 

 

Problem is, the numeric control is still selected.  It resonds to mouse-over by selecting part of or all the numeric contents.  It requires another click, or a mouse-click on another control to de-select the numeric.  That's a problem.

 

I have tried all of the following, and the numeric is NOT de-selected:

   SetActiveCtrl to another control on the same panel.

   SetCtrlVal to another control on the same panel

   CallCtrlCallback to the numeric control with EVENT_COMMIT

 

Isn't there a simple way to de-select a control programmatically? 

 

(PS.  It would sure be nice to be able to disable mouse-over events.  Like an attribute, ATTR_DISABLE_MOUSE_OVER_EVENTS.  Mouse-over events are just a pain in a touch-screen only application.)

0 Kudos
Message 1 of 2
(3,952 Views)

Hello there!

 

Using SetActiveCtrl on another control on the same panel should  have normally changed the active control to the other control, in a regular CVI application. However, in a touch-screen environment, I suspect that the touch action of the user might prevent the other control to be activated.

 

Have you checked whether after the user touches <ENTER>, whether activation events get continuously sent to the numeric control, thus, preventing the focus change? This is how something similar can happen in a regular CVI application (might not be very similar to your case, though):

  1. User activates numeric control A, by doing a right-click (doesn't let go of the click).
  2. In the meantime, SetActiveCtrl tries to make another control, as the active control on that panel.
  3. This activation change is prevented due to the fact that the user didn't let go of the control (this may be something similar to what can happen in an environment with touch support).
  4. The user lets go of the click.
  5. The first control is still the active control on that panel.

Thoughts:

  1. Have you tried dimming the first control on the panel?
  2. Have you tried swallowing mouse events in the first control on the panel?
  3. Have you determined whether there are (mouse) events sent to the first numeric control that prevent the activation change (this could be probably triggered by the user touch action)? Logging such possible events may help understand the issue.

Best regards,

- Johannes

0 Kudos
Message 2 of 2
(3,927 Views)