Admin Production ni-theme
Current Publication

DistributeCtrlsInList

LabWindows/CVI

DistributeCtrlsInList

int DistributeCtrlsInList (int panel, ListType listOfControls, int direction, int spacing, int *position, int gapOrAreaSize);

Purpose

This function evenly distributes a list of controls either horizontally or vertically.

Parameters

Input
Name Type Description
panel int The specifier for a particular panel that is currently in memory.

This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
listOfControls ListType This parameter should be a list of control IDs (see the Lists... class of functions).
direction int Specify VAL_TB_VERTICAL_DISTRIBUTION or select Vertically in the function panel to distribute the controls vertically.

Specify VAL_TB_HORIZONTAL_DISTRIBUTION or select Horizontally in the function panel to distribute the controls horizontally.
spacing int Specify VAL_TB_FIXED_GAP_SPACING or select Fixed Gap Between Controls in the function panel to place a gap the size of the value passed to gapOrAreaSize between each control.

Specify VAL_TB_AREA_SPACING or select Distribute Over Area in the function panel to have your first control start at the value passed to position and have the last control end on the value passed to position plus the value passed to gapOrAreaSize. This has the effect of evenly distributing the controls in the area from position to position+gapOrAreaSize.
gapOrAreaSize int If the Spacing parameter is set to "Fixed Gap Between Controls" then this parameter specifies the number of pixels of gap to place between each control.

If spacing parameter is set to "Distribute Over Area" then this parameter specifies the size of the area to distribute over.
Output
Name Type Description
position int This parameter specifies where to start distributing controls.

The position specifies the topmost position or the leftmost position of the distributed controls, depending on the value passed the direction parameter.

The coordinate of the bottom edge or right edge of the last control is returned in this parameter.

Return Value

Name Type Description
status int Returns 0 if the function succeeded or a negative error code if the function failed.

The possible negative error codes are:

–1 to –999 A User Interface Library error code. (constants are available in userint.h)

A description of any of these error codes can be obtained using the GetGeneralErrorString function in the toolbox.fp instrument driver.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later