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

Home » U++ Library support » LineEdit, EditFields, DocEdit » How to capture Key Press events?
Re: How to capture Key Press events? [message #38121 is a reply to message #38119] Sun, 02 December 2012 07:38 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

lectus wrote on Sun, 02 December 2012 02:03

How to do something when the user types on a EditString?

There is WhenAction callback just for this Wink
struct App : TopWindow {
	typedef App CLASSNAME;
	EditString s;
	Label l;
	App(){
		Add(s.HSizePosZ(5,5).TopPosZ(5,25));
		Add(l.HSizePosZ(5,5).TopPosZ(35,25));
		s.WhenAction << THISBACK(DoSomething);
	}
	void DoSomething(){
		l.SetLabel("Length: "+IntStr(AsString(~s).GetCharCount()));
	}
};


Best regards,
Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: need some expert advice to extend the LineEdit
Next Topic: BUG: LineEdit "Drag And Drop" violates read-only state
Goto Forum:
  


Current Time: Sun Apr 26 03:13:14 GMT+2 2026

Total time taken to generate the page: 0.01222 seconds