patufet_99 Posted June 21, 2016 Report Share Posted June 21, 2016 In an application I would like to use filter events to fill-up a table. The idea is to be able to decide what happens depending on the pressed keys, arrows, escape, etc. Additionally the input value should be checked so that depending on the row the input values are in the expected range or correspond to the expected type. This is the reason to use the filter event so that unwanted keys or characters can be discarded will doing the input. The problem that I have is that when the Enter, or Return key is pressed to accept a value, the value has not been changed yet (because it is a filter event I guess). The behaviour can be tested on the attached snippet. Is there a way to know the input value of the cell on the event? I'm using LabVIEW 2014 SP1 3f 32 bit on Win10 Quote Link to comment
ensegre Posted June 21, 2016 Report Share Posted June 21, 2016 (edited) The trick is to get the Edit Position first, set Key Focus to false, get the (now updated) value and process it, set Key Focus to true again and then restore the previous Edit Position. For an application of mine I had to process arrows with and without modifiers, tabs and whatnot, sometimes jumping columns besides correcting the entered values, and allow only the input of [0-9] in some cells and text in others - you can go quite far in tweaking the standard table navigation behaviour if you invest time in implementing all cases. Edited June 21, 2016 by ensegre 1 Quote Link to comment
patufet_99 Posted June 21, 2016 Author Report Share Posted June 21, 2016 I didn't have thought about that! Thanks Quote Link to comment
patufet_99 Posted June 22, 2016 Author Report Share Posted June 22, 2016 I thing that I have struggled with is that the Editpos of the cell is incremented after that the Event has been filtered, so that the KeyFocus should be done on the same cell and not increment it. Otherwise it will be incremented twice. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.