Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 68914

Using the "Acquire Input Data" is stopping Value Change Events in an XControl

$
0
0

First off, the code is attached.  This might be a little hard to explain.

 

I have created a Color Slider XControl.  It allows the user to set an array of colors, calculates gradient transitions between the colors, saves the colors and transitions to an array called Color Table, and then displays the colors with transitions behind a Slider control.  As the slider is moved the value of the slider is the index to the Color Table which is the color under the slider pointer.  The data type of the XControl is output as a color.

 

As part of the XControl, I wanted a Tip Strip that hovers above the slider pointer but instead of giving the numeric value of the slider, it gives the hex value of the color in RGB.  I couldn't use the built-in tip strip because the value of the colors might not be in numeric order (sliders require numeric order).  So, to create my own I used a string control that I control the visibility.  I wanted this to have the same the same behavior as the built-in.  

 

The built-in behavior is as follows:

  1. It becomes visible on mouse down on the slider (which starts the slider causing Value Change Events).
  2. Value change events will continue even if the mouse moves off the control as long as the mouse button is still pressed and the tip strip stays visible.
  3. Becomes invisible on mouse up no matter where the mouse is located.

 

In order to see a mouse up event outside of the XControl I launch a polling VI launched asynchronously which watches for the mouse to stop being pressed.  It does this by using the Acquire Input Data for the mouse.

 

Now finally the question (or undesired behavior the title states).  When I enable this polling VI the Value Changes occur normally for about 1 second and the the XControl does not fire any more Value Change Events.  It does this no matter what the delay in the polling loop is set to.  But I do get the desired behaviour of my tip strip becoming invisible on mouse up even outside of the control.

 

If I disable the launch of this polling VI, Value Changes occur normally except now I can't make the tip strip dissapear when the mouse up is outside of the control.  

 

There is a Color Slider Tester.vi included to test the XControl and a disable diagram around the launcher of the polling VI which is in the Slider:Mouse Down event in the Facade.

 

This might be a bug with LabVIEW, or am I doing something wrong?  Or is there a workaround? Or maybe a different way to look at getting the desired results?


Viewing all articles
Browse latest Browse all 68914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>