FocusReceived doesn't fire on DesktopGroupBox?

I want to display certain informations when my DesktopGroupBoxes get the focus. But DesktopGroupBox.FocusReceived doesn’t fire?

(my workaround is to give the user a hint to click the groupbox (this event fires), but this feels a little clumsy)

Did it in the previous framework? A GroupBox isn’t a control that gets focus, it’s a decoration. Controls within the GroupBox can receive focus, but on macOS at least, I have never seen a whole GroupBox have focus.

In XOJO 2019 Release 3.2 there was no event “FocusReceived”. But I discovered “MouseEnter” and this will do the trick.

But the question remains: If the DesktopGroupBox can’t get focus, then why is an event “FocusReceived” implemented in the new framework?

Maybe some copy/paste forgotten garbage from another component used as template (bug). It seems to deserve a report https://issues.xojo.com

1 Like

GroupBox may be based on canvas, which does get focus. I agree with Rick. It looks like an oversight.

@Frank_Kersten You could use a canvas instead of a groupbox. Writing the title, the gray background and rectangle can be done in the Paint event. Then set receive focus to true in the Inspector, and you will be able to use the FocusReceived event.

2 Likes