when running the code below, clicking at the HyperLinkGadget with the mouse works as expected, but that gadget doesn't get the keyboard focus – when pressing [Tab], it is skipped (tested with PB 6.11 LTS (x64) on Windows 11).
How must the code be changed, so that the HyperLinkGadget can receive the keyboard focus?
Code: Select all
; Windows only
EnableExplicit
Macro SetUIState (_hwnd_)
SendMessage_(_hwnd_, #WM_UPDATEUISTATE, $30002, 0)
EndMacro
#winMain = 0
Enumeration
#gadCheck
#gadLink
#gadButton
EndEnumeration
Define.i event
If OpenWindow(#winMain, 400, 100, 200, 150, "Demo") = 0
MessageRequester("Fatal error", "Can't open main window.")
End
EndIf
CheckBoxGadget(#gadCheck, 20, 10, 80, 30, "CheckBox")
HyperLinkGadget(#gadLink, 20, 50, 80, 30, "Hyperlink", RGB(0,0,255), #PB_HyperLink_Underline)
ButtonGadget(#gadButton , 20, 90, 80, 30, "Button")
SetActiveGadget(#gadCheck)
SetUIState(WindowID(#winMain)) ; initially show focus rectangle
Repeat
event = WaitWindowEvent()
Select event
Case #PB_Event_Gadget
Select EventGadget()
Case #gadCheck
Debug "CheckBox"
Case #gadLink
Debug "Hyperlink"
Case #gadButton
Debug "Button"
EndSelect
EndSelect
Until event = #PB_Event_CloseWindow


