|
|
Home » U++ Library support » LineEdit, EditFields, DocEdit » [FEATURE] WhenLostFocus in EditField
[FEATURE] WhenLostFocus in EditField [message #30877] |
Thu, 27 January 2011 14:16 |
|
koldo
Messages: 3356 Registered: August 2008
|
Senior Veteran |
|
|
Hello all
When filling fields, I would like to check if the value is valid not when keying letters but just when losing the focus.
To avoid subclassing to use virtual LostFocus(), would it be possible to have a WhenLostFocus in EditField?. Or, is there any other way to validate the value of a field?
Best regards
Iñaki
|
|
|
|
|
|
|
|
|
Re: [FEATURE] WhenLostFocus in EditField [message #31141 is a reply to message #31140] |
Wed, 09 February 2011 14:07 |
|
koldo wrote on Wed, 09 February 2011 12:44 | Yes, although it is a pity to use a new class and losing .usc representation for layout file (or having to create a new that is really a copy of EditString, EditInt, and so on...)
|
Usc supports templates, so you don't have to lose anything Example can be found in CtrlLib.usc, look for WithDropChoice.
Anyway, I agree that it is unnecessary in this case and that it is much more elegant to use WhenEnter and ChildLostFocus (which is great idea which never occured to me before Mirek mentioned it ).
Honza
|
|
|
|
Re: [FEATURE] WhenLostFocus in EditField [message #31250 is a reply to message #31143] |
Wed, 16 February 2011 18:15 |
|
koldo
Messages: 3356 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
I am using ChildLostFocus() but it is called twice per click. Here I enclose you the functions called:
1st
LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
Image Ctrl::DoMouse(int e, Point p, int zd)
...
void EditField::LeftDown(Point p, dword flags)
bool Ctrl::SetFocus()
bool Ctrl::SetFocus0(bool activate)
void Ctrl::DoKillFocus(Ptr<Ctrl> pfocusCtrl, Ptr<Ctrl> nfocusCtrl)
2nd
LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
void Ctrl::KillFocusWnd()
void Ctrl::DoKillFocus(Ptr<Ctrl> pfocusCtrl, Ptr<Ctrl> nfocusCtrl)
Do you know what I am doing wrong?
Best regards
Iñaki
|
|
|
|
Goto Forum:
Current Time: Thu Apr 18 13:16:11 CEST 2024
Total time taken to generate the page: 0.01543 seconds
|
|
|