Home » Community » Newbie corner » [solved] Widget events - any other than WhenAction ? (Trying to find equivalents of OnEnter, OnExit - in an Edit widget)
Re: Widget events - any other than WhenAction ? [message #52739 is a reply to message #52738] |
Sat, 16 November 2019 08:27 |
xrysf03
Messages: 43 Registered: November 2018 Location: CZ
|
Member |
|
|
@Oblivion okay, thanks for your patient explanation. I've learned a new trick
At face value, I can see that there are no ready "When callbacks" for a widget getting or losing focus.
Taking one step back, and using the excellent "API search" function, I have noticed the following methods, defined in Ctrl.cpp:
void Ctrl::GotFocus() {}
void Ctrl::LostFocus() {}
They're actually documented here. Means to me that this is not... say... a Win32-specific feature, or a Borland VCL feature, but actually there is rudimentary systemic support for this in the U++ GUI layer.
And obviously I'm wondering... to get the desired "callback on an Edit losing focus", I'd need to inherit from say EditDouble and overload its LostFocus() - but next, I'd have to embed that in a layout, so first I'd need to create a visual component, along the lines of MyEditDouble.
I haven't advanced that far yet, maybe I should, but at the same time I'm wondering... how much trouble would it be, instead, to create systemwide WhenGotFocus/WhenLostFocus actions by adding some stuff to Ctrl::GotFocus()/LostFocus() This is not necessarily a feature request, let me say that I'm just wondering aloud at this stage... Or, would it be against some "design virtues" of U++ to add those? Would it break existing code? Make existing code run slower?
|
|
|
Goto Forum:
Current Time: Wed Jun 05 07:16:36 CEST 2024
Total time taken to generate the page: 0.02432 seconds
|