LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a event fired from a text ring when re-selecting the curretly selected value?

Solved!
Go to solution

Hello. I have a text ring from which i need to get a event fired when any text (value) is selected. Now i have a event for Value change and it works ok when selecting a different value form the current, but what i would need is the same event fired even if i select the same text (value) that was selected previously. I can not use the mouse down event on the same control, because it will fire the event before any text (value) is selected.

 

If i create a property node (Val(Sgnl)) i can "remotely" fire the event, and in this case the Value change event for the text ring will fire even if i write the same value to the property node (Val(Sgnl)) many times. This is actually the behaviour i would like to have when clicking any of the values in the text ring with the mouse.

 

Any ideas on how to solve this?

0 Kudos
Message 1 of 11
(6,078 Views)
What I do is set the control back to a default state.  I typically use an empty string or (select command) string that has no events associated with it.  That way you can always fire all events.  If you need to display the last command simple add an indicator for the user.
Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 2 of 11
(6,064 Views)

Can you use the mouse up event, this returns a reference to the control, from this you can get value and strings[] property to determine the selected item, which should still work if an item is reselected.  You might need to register for several events togetehe like key up, mouse leave ... to capture all permutations.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 11
(6,053 Views)
Solution
Accepted by topic author carl-oskar
Just have a look at it : that's a very simple way to do what you need...
Message 4 of 11
(6,033 Views)

Setting aside the how, my question is why. Why would you need to execute the event again if nothing has changed?

 

Note: The wiring of the constant of 100 is completely unnecessary. This simply forces the while loop to do exactly nothing every 100 msec. Delete the constant. The event case will fire whenever a registered event occurs. In this case there is no need for polling. 

0 Kudos
Message 5 of 11
(6,009 Views)

Thank you krsone for this solution!

 

The answer to why i need the event executed if nothing has changed is that in my application the text ring will hold some predefined settings for some other controls. If the user selects one of the predefined settings from the text ring a bunch of other controls will take predefined values. These values in the other controls can now be altered by the user. If the user now wants to re-apply the same set of pre-defined settings as last time it should be as simple as selecting the pre-defined settings from the text ring. If now the same value is selected from the text ring, no event will be executed. (krsones solution will deal with this).

 

I would like to have this behaviour as a standard event.

0 Kudos
Message 6 of 11
(5,982 Views)

krsone,

 

     Very nice solution,Yesterday i also tried for a few mins but i failed Smiley Sadkeep rocking and keep posting.

Message Edited by Baji on 06-02-2009 11:12 AM
Balaji PK (CLA)
Ever tried. Ever failed. No matter. Try again. Fail again. Fail better

Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
0 Kudos
Message 7 of 11
(5,978 Views)

krsone wrote:
Just have a look at it : that's a very simple way to do what you need...

 

Youre kidding right? There is nothing "simple" about this solution. 😞
0 Kudos
Message 8 of 11
(5,974 Views)

calle111 wrote:

The answer to why i need the event executed if nothing has changed is that in my application the text ring will hold some predefined settings for some other controls. If the user selects one of the predefined settings from the text ring a bunch of other controls will take predefined values. These values in the other controls can now be altered by the user. If the user now wants to re-apply the same set of pre-defined settings as last time it should be as simple as selecting the pre-defined settings from the text ring. If now the same value is selected from the text ring, no event will be executed.


 

What you should do instead is change the value of the ring to a "special" value (e.g. using a local variable) whenever one of the other settings change, indicating that the settings have been modified. It seems wrong to show an inconsistent value in the ring, right?

 

Now, whenever you change it back to one of the default settings, is IS a value changed event and there is no problem. ;).

 

Here's a quick draft.

Message 9 of 11
(5,957 Views)

Based on your description of the way the user uses things, perhaps it would be better to have the user set up things and then hit an "Enter" button.  In the Enter Value Changed event case, read all the rings and apply the process according to the values.  The Enter button approach avoids all the issues of selecting what is already displayed.  If the user likes what is shown, just hit Enter!

 

Lynn 

0 Kudos
Message 10 of 11
(5,932 Views)