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 » EditInt and crash of the program
EditInt and crash of the program [message #8292] Wed, 28 February 2007 20:46 Go to next message
forlano is currently offline  forlano
Messages: 1127
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I noticed that when I try to enter a character via keybord in an EditInt/Spinedit ctrl the program crash. This is not normal. Maybe some filter has been corrupted.
The test case is attached. It consists in a ctrl added in the layout generate by the template.

Thanks,
Luigi
  • Attachment: editint.rar
    (Size: 0.78KB, Downloaded 372 times)
Re: EditInt and crash of the program [message #8295 is a reply to message #8292] Thu, 01 March 2007 05:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13442
Registered: November 2005
Ultimate Member
Sorry. Please try this fix:

CtrlLib/EditField.cpp 363


int EditField::Insert(int pos, const WString& itext)
{
	if(IsReadOnly()) return 0;
	WString ins;
	const wchar *s = itext;
	for(;;) {
		wchar chr = *s++;
		if(chr == '\t')
			ins.Cat(WString(' ', 4));
		else
		if(chr >= ' ') {
			chr = (*filter)(chr);
			if(chr) {
				chr = convert->Filter(chr);
				if(chr && (charset == CHARSET_UNICODE || FromUnicode(chr, charset, 0)))
					ins.Cat(chr);
			}
		}
		else
			break;
	}
	if(ins.GetCount() + text.GetCount() > maxlen) {
		BeepExclamation();
		return 0;
	}
	text.Insert(pos, ins);
	Update();
	return ins.GetLength();
}

Re: EditInt and crash of the program [message #8296 is a reply to message #8295] Thu, 01 March 2007 08:42 Go to previous message
forlano is currently offline  forlano
Messages: 1127
Registered: March 2006
Location: Italy
Senior Contributor
Thanks, it works,
Luigi
Previous Topic: Display problem with LineEdit after change font
Next Topic: EditInt and context menu
Goto Forum:
  


Current Time: Sat Oct 23 15:17:49 CEST 2021

Total time taken to generate the page: 0.00930 seconds