ExplorerTreeGadget with keyboard

Share your advanced PureBasic knowledge/code with the community.
dige
Addict
Addict
Posts: 1253
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

ExplorerTreeGadget with keyboard

Post 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

"Daddy, I'll run faster, then it is not so far..."