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 » U++ Library support » LineEdit, EditFields, DocEdit » How to trim leading and trailing spaces in EditString?
Re: How to trim leading and trailing spaces in EditString? [message #23797 is a reply to message #23765] Sun, 22 November 2009 23:28 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13526
Registered: November 2005
Ultimate Member
Zbych wrote on Fri, 20 November 2009 04:10

Hi,

What is the simplest way to add a trimming of spaces to EditString?
I tried to add a conversion. It works fine, but EditString stopped reacting to NotNull flag.

Here is the code of my converter:
struct TrimConvert : public Convert {
	virtual Value Scan(const Value& text) const {
		return TrimBoth(text.ToString());
    }
}; 


Question is what I am doing wrong?



It is because NotNull is method of StringConvert, so if you replace the Convert, it is your responsibility to test for Null.

Note that in such case, using EditString has little merit, you should rather use EditField directly as used Convert is the only difference between both....

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What is the best way to create a mask in a editfield.
Next Topic: Incorrect position of chars in DocEdit ctrl.
Goto Forum:
  


Current Time: Tue Jan 25 05:23:15 CET 2022

Total time taken to generate the page: 0.02504 seconds