U++ framework
Do not panic. Ask here before giving up.

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: 332
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: Sun Apr 26 04:46:05 GMT+2 2026

Total time taken to generate the page: 0.00659 seconds