LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keyfocus to output field(s)

Hi, while strugling to get Labview to start with focus on an input field in Labview I also noticed that it completely ignores focus on output fields.  Furthermore, reading on the subject I see a general attitude by people here that 'of course' you should only set (key)focus on input fields (???).

 

The current vi I'm using is a classic Labview vi without event handling, except those made by comparing previous and current value.

 

With quite some (I would say: largely unnecassary) effort I manage to start with focus on a certain input field.

 

I have a big nice "Calculate" button, which gets trapped and executed by pressing ENTER (using classic Labview "Key Navigation").  I want to progress the focus to an output field with its contents selected so users can immediately copy-and-paste the result.

 

After that I want to progress to the next output field when the user presses TAB, with more in- and output fields coming, also reachable through TAB.

 

Is this at all possible in Labview?  Am I forced to convert the vi into an Event driven version?

 

 

0 Kudos
Message 1 of 16
(3,206 Views)

Hi Ettepet,

 

event will surely help you to react on kay press events!

 

See attachment for some ideas...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(3,201 Views)

Hi Ettepet,

 

event will surely help you to react on kay press events!

 


Thanks, I already figured it would help.  Is it possible to overcome the "focus to input fields"-only obstacle, as your example does not do anything to countermand that.

0 Kudos
Message 3 of 16
(3,197 Views)

Hi Ettepet,

 

not that I can think of.

Focus is given to input fields only AFAIK.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 16
(3,187 Views)

not that I can think of.

Focus is given to input fields only AFAIK.



This is really weird as you can do it by clicking on the field in execution mode.  "Power to the user!" I would say... (and yes, us software engineers are also to be considered users - special users)

 

0 Kudos
Message 5 of 16
(3,183 Views)

Hi Ettepet,

 

you can simulate selection in a text field as I tried to show in the attach VI above by changing colors of the text...

 

Why do you need to simulate focus when you can copy the text to the clipboard automatically as shown in the VI?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 16
(3,181 Views)

you can simulate selection in a text field as I tried to show in the attach VI above by changing colors of the text...

 

Why do you need to simulate focus when you can copy the text to the clipboard automatically as shown in the VI?


I want a proper user interface, working as the user expects it.  It is NOT normal to have focus on input fields only, as I've seen it working properly in many programming environments in the past.

0 Kudos
Message 7 of 16
(3,174 Views)

Hi Ettepet,

 

two more things:

- I never have seen a UI with an indicator with key focus.

- you can get your key focus behaviour by using a control instead of your indicator and settings it's value with a local variable or property node... I'm sure other programs fake that too...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 16
(3,167 Views)

two more things:

- I never have seen a UI with an indicator with key focus.

- you can get your key focus behaviour by using a control instead of your indicator and settings it's value with a local variable or property node... I'm sure other programs fake that too...


You can stress the "indicator"-ness however you want but it still makes no sense.  95% of code probably won't have need for it, but not even allowing software engineers to "choose" to use it is plain ugly.  It makes for an unnecessarily rigid interface, where in many / most other programming environments the environment itself allows it if so desired.

 

The trick to make it a Disabled (but not Greyed-out) control doesn not work, meaning I can only make it an Enabled Control.  I envision trying to explain to users and the test-department and colleagues that they can edit the output field "because my programming environment doesn't allow me otherwise...".

 

0 Kudos
Message 9 of 16
(3,154 Views)

Hi Ettepet,

 

you can set a KeyFilter-event on those controls to disable editing...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 16
(3,150 Views)