U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
Filtering CR from an EditString
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45120&th=9398#msg_45120
I am having a problem filtering the user input in an EditString field.
The usage scenario of the application is the following:
-The user has a job order sheet with a bar code printed on it (the bar code contains a simple alphanumeric code in the form "1599991090");
-Using a bar code reader, the user enters the code in the EditString;
-When the code is entered, the application should elaborate the code (i.e. divide it in different "chunks": "1599991090" is divided in three different fields, "15999", "10" and "90") and save them in a db with the current time.
The problem is that the bar code reader puts two CR at the end of the string, so the result is:
-the code is entered;
-the focus goes to the next field (first CR);
-a button is pressed (second CR).
This is not the intended behaviour, so I would like to "intercept" the user input before the focus goes to the second field, remove the CR and elaborate the input. I think that the solution to my problem could be in this thread http://www.ultimatepp.org/forums/index.php?t=msg&th=587& amp;start=0& here, but I do not know how to tell upp that the character I want to filter is a CR. I have also problem to tell upp what should be the "active" button, I tried .SetFocus but it does not seem to work. I can not test the code right now, because I am on a friend's pc.
Thanks for any help,
Giorgio
]]>Giorgio2015-09-06T22:08:56-00:00Re: Filtering CR from an EditString
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45126&th=9398#msg_45126
I think changing setup of bar code scanner may be right solution.
Check setup. It will be possible to stop additional characters sent by scanner in scanner setup.
There is normally provision in scanner setup to add Prefix and Suffix chars.
Most likely double "CR" is added as suffix.
]]>deep2015-09-08T09:29:01-00:00Re: Filtering CR from an EditString
https://www.ultimatepp.org/forums/index.php?t=rview&goto=45128&th=9398#msg_45128
]]>Giorgio2015-09-09T09:35:18-00:00Re: Filtering CR from an EditString
https://www.ultimatepp.org/forums/index.php?t=rview&goto=49465&th=9398#msg_49465