LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 8.6 Dialog Bug with Key Assignments

Solved!
Go to solution

I made a simple dialog that has a field for entering a value and an OK and CANCEL button.

 

I pass the field out to the caller if you click the OK button.

 

If you use the mouse, all is well.

 

I tied the RETURN key to the OK button.

 

Suppose the field contains 1.234.

 

If you type in the field "2.468", and then hit RETURN, I would expect the RETURN key would first enter the new value into the field and THEN register the event.

 

But no.  What comes out is OK = TRUE and mG = 1.234 (the old value).

 

It is not registering the new value at all. 

 

Am I missing something? 

 

 

 

DialogBug.PNG

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 1 of 9
(3,853 Views)

It seems to work as you expected in LV2009.

 

What if you have a separate Stop button in its own event case?  I realize this may not meet the needs of your program, but it could be useful in tracking what is happening.  Do you get the desired number one iteration later, as though the numeric control was read before the event case was entered?

 

Lynn 

0 Kudos
Message 2 of 9
(3,839 Views)

Well, the behavior is that if I click anywhere outside the field (even in empty space on the panel), the field gets updated correctly, even if it hit RETURN.

 

Suppose the field is sitting at 1. 

 

If I type 2-RETURN,  then it does the wrong sequence: it triggers the event, reads the field (with the old value of 1) and THEN updates the field.

 

If I bring up the dialog again, it shows the 2 left over from last time. If I type 3-RETURN, it reports out a 2, but leaves the field 3 for next time.

 

I can make a workaround, but I was wondering if this was explained by something other than an LV bug. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 9
(3,829 Views)

Ah, ...

 

I see that also.  I was using a knob and changing it with the mouse so the numerical entry ended on mouse up.

 

So the issue is that Return is doing two different things to two different controls.  First it is terminating entry into the numeric control. Second it is toggling the boolean.  I suspect that it cannot do both with a single press of the key.  I am not sure where such a thing would be documented.

 

Lynn 

0 Kudos
Message 4 of 9
(3,822 Views)

Well, to me it's clear that ending editing (and thus entering the new value into the field) is the FIRST thing that should happen when the control loses focus, and THEN the OK button should be triggered.

But that's not what's happening. 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 9
(3,809 Views)

Right.  I had the order wrong.

 

Lynn 

0 Kudos
Message 6 of 9
(3,806 Views)
Solution
Accepted by topic author CoastalMaineBird
I got kind of confused reading these posts.  Do you have 'Set to Focus on Toggle' checked in the key navigation window for the OK button?  This sounds like a problem I've run into a few times.
--
Tim Elsey
Certified LabVIEW Architect
Message 7 of 9
(3,801 Views)

BINGO!

I've never noticed that option!

 

For the last few years, my projects have had NO key assignments (per users' requests), so I haven't used them.

I don't know when this was introduced, nor why you would want it OFF, but when I turn it ON, things work as I expect.

 

Thanks! 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 8 of 9
(3,793 Views)
Glad I could help.
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 9 of 9
(3,775 Views)