Home » Community » Newbie corner » Filtering CR from an EditString
Filtering CR from an EditString [message #45120] |
Mon, 07 September 2015 00:08 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Hi there,
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
|
|
|
Re: Filtering CR from an EditString [message #45126 is a reply to message #45120] |
Tue, 08 September 2015 11:29 |
|
deep
Messages: 263 Registered: July 2011 Location: Bangalore
|
Experienced Member |
|
|
Hi Giorgio,
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.
Warm Regards
Deepak
[Updated on: Tue, 08 September 2015 11:29] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 08:41:07 CEST 2024
Total time taken to generate the page: 0.02455 seconds
|