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 #52741 is a reply to message #52739] |
Sat, 16 November 2019 09:46 |
Oblivion
Messages: 1094 Registered: August 2007
|
Senior Contributor |
|
|
Hello Frank,
Quote:
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.
They aren't win32 specific. Platform-specific stuff have a notice stating that on their api docs. They work on Linux and MacOS too.
Quote:
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()
Well, I personally don't see any problem, but Mirek (the main developer of U++) should answer this question anyway, as he knows the rationale behind this decision.
Quote:
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
Not necessarily. Any Ctrl-derived widget can be used in the layout editor. But only the most used components have a complete representation. Ony if you need full visual representation you'll need to write a usc (layout entry) file. For example, you can add a rudimentary visual representation of your widget. But by default it will just show a blank rectangle area with a tag (name of the class) attached on it. You can use it to set its layout on window. This is a two steps process:
1 Declare your derived class in header file, just above the layouts file.
2 Add it to your layout using the layout editor.
I've attached an example U++ code to the message.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sat, 16 November 2019 09:48] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Thu May 23 11:07:34 CEST 2024
Total time taken to generate the page: 0.02405 seconds
|