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.
- 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.
- ImageGadget(): returns the ImageID of the currently displayed image.
- ListIconGadget(): returns the first selected item index, -1 if none is selected.
- ListViewGadget(): returns the currently selected item index, -1 if none is selected.
- 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.
- 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()
<- GetGadgetItemText() - Gadget Index - GetGadgetText() ->