GetGadgetItemState()

Syntax

Result = GetGadgetItemState(#Gadget, Item)
Description
Returns the item state of the specified #Gadget. This is a universal function that works for almost all gadgets which handle several items:
- CalendarGadget(): returns #PB_Calendar_Bold when the specified date is displayed bold, #PB_Calendar_Normal otherwise. 'Item' must be a PureBasic date value.
- ExplorerListGadget(): returns a combination of the following values
  #PB_Explorer_File      : The item is a file.
  #PB_Explorer_Directory : The item is a Directory (or drive).
  #PB_Explorer_Selected  : The item is currently selected.
- ListViewGadget(): returns 1 if the item is selected, 0 otherwise.
- ListIconGadget(): returns a combination of the following values:
  #PB_ListIcon_Selected: The item is selected.
  #PB_ListIcon_Checked : The item has its checkbox checked (#PB_ListIcon_CheckBoxes flag).
- TreeGadget(): returns a combination of the following values:
  #PB_Tree_Selected  : The item is selected, 0 otherwise.
  #PB_Tree_Expanded  : The item is expanded (a tree branch opened).
  #PB_Tree_Collapsed : The item is collapsed (the tree branch closed).
  #PB_Tree_Checked   : The Checkbox of the item is checked, 0 otherwise. (#PB_Tree_CheckBoxes flag)
Check for these states like this:
  If Result & #PB_Tree_Checked
    ; Item is checked
  EndIf

Supported OS

All

<- GetGadgetItemData() - Gadget Index - GetGadgetItemText() ->