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 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: 1789
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: Mon Apr 29 02:51:45 CEST 2024

Total time taken to generate the page: 0.02706 seconds