Page 1 of 1

ExplorerTreeGadget with keyboard

Posted: Thu Aug 22, 2019 11:57 am
by dige
If you are using the ExplorerListGadget() and have selected an entry with SetGadgetItemState(#Gadget, n, #PB_Explorer_Selected),
then ist important to set also the focus on this element, otherwise the navigation with the keyboard won't work.

Code: Select all

Procedure ExplorerListGadget_SelectItem(GadgetID, n)
  SendMessage_(GadgetID(GadgetID), #LVM_ENSUREVISIBLE, n, #False )
  
  sItem.LV_ITEM
  sItem\Mask      = #LVIF_STATE
  sItem\State     = #LVIS_SELECTED | #LVIS_FOCUSED
  sItem\stateMask = #LVIS_SELECTED | #LVIS_FOCUSED
  SendMessage_(GadgetID(GadgetID), #LVM_SETITEMSTATE, n , sItem)
EndProcedure