GetGadgetState()

Syntax

Result = GetGadgetState(#Gadget)
Description
Returns the current state of the gadget.

Parameters

#Gadget The gadget to use.

Return value

Returns the state of the gadget. See below for its meaning depending on the gadget type.

Remarks

This is a universal function which works for almost all gadgets:

- ButtonImageGadget(): returns 1 if a #PB_Button_Toggle button is toggled, else 0.
- ButtonGadget(): returns 1 if a #PB_Button_Toggle button is toggled, else 0.
- CalendarGadget(): returns the currently selected date.
- CheckBoxGadget(): Returns one of the following values:
  #PB_CheckBox_Checked  : The check mark is set.
  #PB_CheckBox_Unchecked: The check mark is not set.
  #PB_CheckBox_Inbetween: The "in between" state is set. (Only for #PB_CheckBox_ThreeState checkboxes)
- ComboBoxGadget(): returns the currently selected item index, -1 if none is selected.
- DateGadget(): returns the currently selected date/time. IF #PB_Date_CheckBox was used, and the checkbox is unchecked, 0 is returned.
- ExplorerListGadget(): returns the index of the first selected item in the Gadget, -1 if none is selected.
- ExplorerTreeGadget(): returns the type of the currently selected item (#PB_Explorer_File or #PB_Explorer_Directory).
- ImageGadget(): returns the ImageID of the currently displayed image.
- IPAddressGadget(): returns the current IP address.
- ListIconGadget(): returns the first selected item index, -1 if none is selected.
- ListViewGadget(): returns the currently selected item index, -1 if none is selected.
- MDIGadget(): returns the currently focused child window, -1 if none has the focus.
- OptionGadget(): returns 1 if activated, 0 otherwise.
- PanelGadget(): returns the current panel index, -1 if no panel.
- ProgressBarGadget(): returns the current value of the ProgressBar.
- ScrollBarGadget(): returns the current slider position.
- ShortcutGadget(): returns the currently selected keyboard shortcut.
- SpinGadget(): returns the current value of the SpinGadget.
- SplitterGadget(): returns the current splitter position, in pixels.
- TrackBarGadget(): returns the current position of the TrackBar (value inside the minimum - maximum range).
- TreeGadget(): returns the currently selected item index, -1 if none is selected.

See Also

SetGadgetState(), GetGadgetItemState(), SetGadgetItemState()

Supported OS

All

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