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 #22615 is a reply to message #22611] Sat, 01 August 2009 10:43 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
HI,

Quote:

is already some other method to do it


I had the same problem some time ago and did something this:

template < class T >
class EnhancedEditField : public T
{
	public:
		typedef T BaseClass;
		EnhancedEditField() {};
		virtual ~EnhancedEditField() {};


		Callback whenFocusLost;
		
		virtual void LostFocus()
		{
			T::LostFocus();
			whenFocusLost();
		}
};

typedef EnhancedEditField<EditString> EnhancedEditString;
typedef EnhancedEditField<EditInt> EnhancedEditInt;
typedef EnhancedEditField<EditDouble> EnhancedEditDouble;



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

Since nobody asked for this feature before maybe our way of doing things is a little clumsy ? ? ?


 
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: Sat May 11 18:59:27 CEST 2024

Total time taken to generate the page: 0.02516 seconds