Active Gadget

Just starting out? Need help? Post your questions and find answers here.
User avatar
charvista
Addict
Addict
Posts: 949
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Active Gadget

Post by charvista »

Hello!
Normally, in every application, we see the current active gadget (stringGadget with active caret, or buttonGadget surrounded by a dotted frame for example) but in my software made with PureBasic it is not always visible, I mean, that stringGadgets are always visible, but the buttons do *not* receive the dotted frame, when I press the TAB key to jump between the gadgets. What is preventing this, or what may prevent this happening? Sorry that I cannot include an example here as the package has become too large.
Any idea ?
- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Active Gadget

Post by srod »

Been discussed lots of times! :)

Freak has stated that this should be addressed in PB 4.5. http://www.purebasic.fr/english/viewtop ... logMessage

In the meantime, if you search on #WM_UPDATEUISTATE you might find some remedies.
I may look like a mule, but I'm not a complete ass.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4953
Joined: Sun Apr 12, 2009 6:27 am

Re: Active Gadget

Post by RASHAD »

@charvista
In the meantime have a look at
http://www.purebasic.fr/english/viewto ... 2&t=40676
Egypt my love
User avatar
charvista
Addict
Addict
Posts: 949
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Re: Active Gadget

Post by charvista »

Erm... to me it's my first discussion about this subject :D

As this is not urgent at this time, I will wait for the version 4.5. Glad to know that my programs are okay.
Thank you very much srod & Rashad.
- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: Active Gadget

Post by ABBKlaus »

as it was urgent in my case :twisted: here´s my workaround :

Windows only, PB4.31+

Code: Select all

#UIS_SET        = 1
#UIS_CLEAR      = 2
#UIS_INITIALIZE = 3
#UISF_HIDEFOCUS = 1
#UISF_HIDEACCEL = 2
#UISF_ACTIVE    = 4

Procedure SetUIState(hwnd.i,LoWord.w,HiWord.w)
  SendMessage_(hwnd,#WM_UPDATEUISTATE,(LoWord & $FFFF) | (HiWord<<16),0)
EndProcedure

If OpenWindow(0, 0, 0, 222, 200, "ButtonGadgets",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
  ButtonGadget(0, 10, 10, 200, 20, "Button 1")
  ButtonGadget(1, 10, 40, 200, 20, "Button 2")
  
  SetUIState(WindowID(0),#UIS_CLEAR,#UISF_HIDEFOCUS|#UISF_HIDEACCEL)
  
  SetActiveGadget(0)
  Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
User avatar
charvista
Addict
Addict
Posts: 949
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Re: Active Gadget

Post by charvista »

Many thanks ABBKlaus for your temporary solution.
Hope however that PB 4.50 will come soon :D
- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
Post Reply