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 » U++ Widgets - General questions or Mixed problems » Edit controls are focused even not being the first
Edit controls are focused even not being the first [message #54361] Fri, 03 July 2020 16:50 Go to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
I have realised that in a window, if you have for example some Switch and a EditInt, the EditInt is focused just after opening the window, even if it is not the first/topmost Ctrl.
Is it possible to force focusing other Ctrl?


Best regards
Iñaki
Re: Edit controls are focused even not being the first [message #54368 is a reply to message #54361] Tue, 07 July 2020 10:24 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Any idea to avoid an Edit to be forcedly the focused Ctrl when opening a window?

Best regards
Iñaki
Re: Edit controls are focused even not being the first [message #54369 is a reply to message #54361] Tue, 07 July 2020 11:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Use ActiveFocus.

The reason why Switch does not get selected is that it has NoInitFocus flag active...

Mirek
Re: Edit controls are focused even not being the first [message #54380 is a reply to message #54369] Wed, 08 July 2020 18:12 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Excellent!

InitFocus(true) does the trick.

PD: ActiveFocus() does not exist.


Best regards
Iñaki
Re: Edit controls are focused even not being the first [message #54384 is a reply to message #54380] Thu, 09 July 2020 06:41 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 08 July 2020 18:12
Excellent!

InitFocus(true) does the trick.

PD: ActiveFocus() does not exist.


TopWindow::ActiveFocus(Ctrl&)
Previous Topic: Clipboard Append() function for images is missing in VirtualGui/TURTLE /LinuxFrameBuffer?
Next Topic: OpenGL bad context in key function
Goto Forum:
  


Current Time: Thu Apr 18 17:11:49 CEST 2024

Total time taken to generate the page: 0.01540 seconds