Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Filtering CR from an EditString
Filtering CR from an EditString [message #45120] Mon, 07 September 2015 00:08 Go to previous message
Giorgio is currently offline  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
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: LocalProcess2 doesnt show child app window (it is running)
Next Topic: From std::string to String
Goto Forum:
  


Current Time: Fri Mar 29 14:47:19 CET 2024

Total time taken to generate the page: 0.01469 seconds