Skip to main content

ControlInfo

ControlInfo [/W=winName ] controlName

The ControlInfo operation returns information about the state or status of the named control in a graph or panel window or subwindow.

Flags

/G [ = doGlobal]If doGlobal is non-zero or absent, the position returned via V_top and V_left is in global screen coordinates rather relative to the window containing the control.
/W = winNameLooks for the control in the named graph or panel window or subwindow. If /W is omitted, ControlInfo looks in the top graph or panel window or subwindow.
When identifying a subwindow with winName, see Subwindow Syntax for details on forming the window hierarchy.

Parameters

controlName is the name of a control in the window specified by /W or in the top graph or panel window. controlName may also be the keyword kwBackgroundColor to set V_Red, V_Green, V_Blue and V_Alpha, the keyword kwControlBar or kwControlBarBottom to set V_Height, the keyword kwControlBarLeft or kwControlBarRight to set V_Width, or the keyword kwSelectedControl to set S_Value and V_flag.

Details

Information for all controls is returned via the following string and numeric variables. Coordinates are returned in control panel units.

S_recreationCommands to recreate the named control.
S_titleTitle of the named control.
V_disableControl's disable state:
0:Normal (enabled, visible).
1:Hidden.
2:Disabled, visible.
V_Height, V_Width, V_top, V_left, V_right, V_pos, V_align
Dimensions and position of the named control in control panel units.
V_right, V_pos, and V_align were added in Igor Pro 8.00 and depend on whether the align keyword was applied to the control (e.g., Button <name> align=1).
V_align is 1 if the the align keyword was applied to the control or to 0 otherwise.
V_pos is the horizontal coordinate used to position the control. It represents the position of the left end of the control if the align keyword was omitted or of the right end if the align keyword was applied.
V_left and V_right are the the horizontal coordinates of the left and right ends of the control regardless of whether the align keyword was applied or not.

The kind of control is returned in V_flag as a positive or negative integer. A negative value indicates the control is incomplete or otherwise not active. If V_flag is zero, then the named control does not exist. Information returned for specific control types is as follows:

V_flag1
V_ValueTick count of last mouse up.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag6 or -6
V_ValueCurrent point number.
S_ValueKeyword-packed information string.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag2
V_Value0 if it is deselected or 1 if it is selected.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag12
V_ValueTick count of last mouse up.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag9
S_ValueTitle text.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag11
V_ValueCurrently selected row (valid for mode 1 or 2 or modes 5 and 6 when no selWave is used). If no list row is selected, then it is set to -1.
V_selColCurrently selected column (valid for modes 5 and 6 when no selWave is used).
V_horizScrollNumber of pixels the list has been scrolled horizontally to the right.
V_vertScrollNumber of pixels the list has been scrolled vertically downwards.
V_rowHeightThe height of a row in pixels.
V_startRowThe current top visible row.
S_columnWidths
A comma-separated list of column widths in pixels.
S_DataFolderFull path to listWave (if any).
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_ValueName of listWave (if any).
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag3 or -3
V_Red, V_Green, V_Blue, V_Alpha
For color array pop-up menus, these are the encoded color values.
V_ValueCurrent item number (counting from one).
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_ValueText of the current item. If PopupMenu is a color array then it contains color values encoded as RGBA Values.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag5 or -5
V_ValueValue of the variable. If the SetVariable is used with a string variable, then it is the interpretation of the string as a number, which will be NaN if conversion fails.
S_DataFolderFull path to the variable.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_ValueName of the variable or, if the value was set using _STR: syntax, the string value itself.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag7
V_ValueNumeric value of the variable.
S_DataFolderFull path to the variable.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_ValueName of the variable.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag8
V_ValueNumber of the current tab.
S_UserDataPrimary (unnamed) user data text. For any named user data, you must use the GetUserData function.
S_ValueTab text.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left,
V_right, V_pos, V_align
See descriptions above.
V_flag10
S_DataFolderFull path if text is from a string variable.
S_ValueName if text is from a string variable.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left
See descriptions above.
V_right, V_pos, V_align
See TitleBox Positioning under Operations[TitleBox] for details.
V_flag4 or -4
V_ValueDisplayed value.
S_ValueText of expression that ValDisplay evaluates.
S_recreation, V_disable, V_Height, V_Width, V_top, V_left
V_right, V_pos, V_align
See descriptions above.
  • kwBackgroundColor
V_Red, V_Green, V_Blue, V_Alpha
If controlName is kwBackgroundColor then it is the color of the control panel background. This color is usually the default user interface background color, as set by the Appearance tab of the Display Properties, until changed by ModifyPanel cbRGB.
  • kwControlBar or kwControlBarTop
V_HeightThe height in pixels of the top control bar area in a graph as set by ControlBar.
  • kwControlBarBottom
V_HeightThe height in pixels of the bottom control bar area in a graph as set by ControlBar/B.
  • kwControlBarLeft
V_WidthThe width in pixels of the left control bar area in a graph as set by ControlBar/L.
  • kwControlBarRight
V_WidthThe width in pixels of the right control bar area in a graph as set by ControlBar/R.
  • kwSelectedControl
V_flagSet to 1 if a control is selected or 0 if not.
SetVariable and ListBox controls can be selected, most other controls cannot.
S_ValueName of selected control (if any) or "".

The following applies only to the keyword-packed information string stored in S_value for a chart recorder. S_value will consist of a sequence of sections with the form: "keyword:value;" You can pick a value out of a keyword-packed string using the NumberByKey and StringByKey functions. Here are the keywords for S_value for a chart recorder:

KeywordTypeMeaning
FNAMEstringName of the FIFO chart is monitoring.
LHSAMPnumberLeft hand sample number.
NCHANSnumberNumber of channels displayed in chart recorder.
PPSTRIPnumberThe chart recorder's points per strip value.
RHSAMPnumberRight hand sample number (same as V_value).

In addition, ControlInfo writes fields to S_value for each channel in the chart recorder. The keyword for the field is a combination of a name and a number that identify the field and the channel to which it refers. For example, if channel 4 is named "Pressure" then the following would appear in the S_value string: "CHNAME4:Pressure". In the following table, the channel's number is represented by #:

KeywordTypeMeaning
CHCTAB#numberChannel's color table value as set by Chart ctab keyword.
CHGAIN#numberChannel's gain value as set by Chart gain keyword.
CHNAME#stringName of channel defined by FIFO.
CHOFFSET#numberChannel's offset value as set by Chart offset keyword.

Examples

ControlInfo myChart; Print S_Value

Results in the following being printed to the history area:

FNAME:myFIFO;NCHANS:1;PPSTRIP:1100;RHSAMP:271;LHSAMP:-126229;

See Also

Controls and Control Panels for details about control panels and controls.

Control Panel Units for a discussion of the units used for controls.

The ControlInfo operation for information about the control.

The GetUserData function for retrieving named user data.