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 » Lost focus in edit fields
Re: Lost focus in edit fields [message #22620 is a reply to message #22615] Sat, 01 August 2009 11:41 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
Didier wrote on Sat, 01 August 2009 10:43

It adds a callback to the type <T> and does what you want while avoiding modifying upp src.


I don't really mind modyfing upp src Smile, esspecially when it is just two lines (one in *.cpp and one in *.h):
EditField.cpp :

void EditField::LostFocus()
{
	if(autoformat && IsEditable() && !IsNull(text)) {
		Value v = convert->Scan(text);
		if(!v.IsError()) {
			const Convert * cv = inactive_convert ? inactive_convert : convert;
			WString s = cv->Format(v);
			if(s != text) text = s;
		}
	}
	if(!keep_selection) {
		anchor = -1;
		cursor = sc = 0;
		WhenLostFocus();//<--here
	}
	Refresh();
	SyncEdge();
}

[Updated on: Sat, 01 August 2009 11:42]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to add a currency symbol to an EditDoubleSpin?
Next Topic: What do you think about this approach to making CodeEditor more user extendable?
Goto Forum:
  


Current Time: Fri Jul 18 06:39:58 CEST 2025

Total time taken to generate the page: 0.04009 seconds