Functions
ListBox Item

Functions

ErrorCode mdlDialog_listBoxSetStrListP (RawItemHdr *listBoxP, StringListP strListP, int nColumns)
 Sets the StringList that the List Box item will use. More...
 
ErrorCode mdlDialog_listBoxSetListModelP (RawItemHdr *listBoxP, ListModel *pListModel, int unused)
 Sets the ListModel pointer in the ListBox. More...
 
ErrorCode mdlDialog_listBoxSetListModelPEx (RawItemHdr *listBoxP, ListModel *pListModel, int unused, bool redraw)
 An extension of mdlDialog_listBoxSetListModelP that allows control over the redrawing of the ListBox after setting the ListModel pointer. More...
 
ErrorCode mdlDialog_listBoxNRowsChangedRedraw (RawItemHdr *listBoxP, bool redraw)
 Similar to mdlDialog_listBoxNRowsChanged but also gives the option of redrawing or not. More...
 
ErrorCode mdlDialog_listBoxNRowsChanged (RawItemHdr *listBoxP)
 Informs the List Box item specified by listBoxP that the number of rows in its StringList or ListModel has changed. More...
 
StringListP mdlDialog_listBoxGetStrListP (RawItemHdr *listBoxP)
 Retrieves a pointer to the StringList that the List Box item specified by listBoxP is manipulating. More...
 
ListModel * mdlDialog_listBoxGetListModelP (RawItemHdr *listBoxP)
 Retrieves a pointer to the ListModel. More...
 
ErrorCode mdlDialog_listBoxGetDisplayRange (int *topRowIndexP, int *bottomRowIndexP, int *leftColIndexP, int *rightColIndexP, RawItemHdr *listBoxP)
 Gets the range of the cells that are displayed in the List Box specified by listBoxP. More...
 
ErrorCode mdlDialog_listBoxSetTopRow (RawItemHdr *listBoxP, int topRowIndex)
 Sets the first displayed row of a List Box to be topRowIndex. More...
 
ErrorCode mdlDialog_listBoxSetTopRowRedraw (RawItemHdr *listBoxP, int topRowIndex, bool redraw)
 Sets which row number of a List Box is displayed as the first row. More...
 
ErrorCode mdlDialog_listBoxDrawContents (RawItemHdr *listBoxP, int relRowIndex, int relColIndex)
 Draws the contents of the List Box item specified by listBoxP. More...
 
ErrorCode mdlDialog_listBoxSelectCells (RawItemHdr *listBoxP, int minRowIndex, int maxRowIndex, int minColIndex, int maxColIndex, bool selectOn, bool redraw)
 Selects a range of cells in the List Box specified by listBoxP. More...
 
ErrorCode mdlDialog_listBoxEnableCells (RawItemHdr *listBoxP, int minRowIndex, int maxRowIndex, int minColIndex, int maxColIndex, bool enable, bool redraw)
 Enables or disables a range of cells in the List Box specified by listBoxP. More...
 
ErrorCode mdlDialog_listBoxGetSelectRange (int *minRowIndexP, int *maxRowIndexP, int *minColIndexP, int *maxColIndexP, RawItemHdr *listBoxP)
 Gets the range of the cells that are currently selected in the List Box specified by listBoxP. More...
 
ErrorCode mdlDialog_listBoxGetNextSelection (bool *foundP, int *rowIndexP, int *colIndexP, RawItemHdr *listBoxP)
 Searches for the next selected cell of the List Box specified by listBoxP. More...
 
StatusInt mdlDialog_listBoxFindCell (int *iRowP, int *iColP, RawItemHdr *listBoxP, Point2d *ptP)
 Returns the row and column in the List Box at the current mouse position, ptP. More...
 
bool mdlDialog_listBoxIsCellSelected (RawItemHdr *listBoxP, int rowIndex, int colIndex)
 Determines if a cell in the List Box specified by listBoxP is selected. More...
 
bool mdlDialog_listBoxIsCellEnabled (RawItemHdr *listBoxP, int rowIndex, int colIndex)
 Determines if a cell in the List Box specified by listBoxP is enabled. More...
 
ErrorCode mdlDialog_listBoxLastCellClicked (int *rowIndexP, int *colIndexP, RawItemHdr *listBoxP)
 Determines the cell in the List Box specified by listBoxP in which the data button was last clicked. More...
 
StatusInt mdlDialog_listBoxGetInfo (UInt32 *attributesP, UInt32 *nRowsP, UInt32 *sizeNumColumnP, RawItemHdr *listBoxP)
 Gets several parameters associated with List Boxes. More...
 
StatusInt mdlDialog_listBoxSetInfo (UInt32 *attributesP, UInt32 *nRowsP, UInt32 *sizeNumColumnP, bool redraw, RawItemHdr *listBoxP)
 Sets several parameters associated with List Boxes. More...
 
StatusInt mdlDialog_listBoxGetInfoEx (UInt32 *attributesP, UInt32 *nRowsP, UInt32 *sizeNumColumnP, UInt32 *attributesExP, UInt32 *statusFlagsP, RawItemHdr *listBoxP)
 Gets several parameters associated with List Boxes. More...
 
StatusInt mdlDialog_listBoxSetInfoEx (UInt32 *attributesP, UInt32 *nRowsP, UInt32 *sizeNumColumnP, UInt32 *attributesExP, bool redraw, RawItemHdr *listBoxP)
 Sets several parameters associated with List Boxes. More...
 
int mdlDialog_listBoxGetNColumns (RawItemHdr *listBoxP)
 Retrieves the number of columns present in a List Box. More...
 
StatusInt mdlDialog_listBoxGetColInfo (int *widthP, int *maxSizeP, UInt32 *attributesP, WChar *headingP, RawItemHdr *listBoxP, int columnIndex)
 Gets several parameters associated with individual columns in List Boxes. More...
 
StatusInt mdlDialog_listBoxSetColInfo (int *widthP, int *maxSizeP, UInt32 *attributesP, WCharCP headingP, RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Sets several parameters associated with individual columns in List Boxes. More...
 
StatusInt mdlDialog_listBoxInsertColumn (int *widthP, int *maxSizeP, UInt32 *attributesP, WCharCP headingP, RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Inserts a new column into an existing List Box. More...
 
StatusInt mdlDialog_listBoxSetColumnHeading (WCharCP headingP, RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Updates a column's heading to a Unicode string. More...
 
StatusInt mdlDialog_listBoxGetColInfoEx (int *widthP, int *maxSizeP, UInt32 *attributesP, WChar *headingP, int *originXP, short *sortStatusP, int *sortSecondaryColP, RawItemHdr *listBoxP, int columnIndex)
 Similar to the mdlDialog_listBoxGetColInfo but with added arguments. More...
 
StatusInt mdlDialog_listBoxSetColInfoEx (int *widthP, int *maxSizeP, UInt32 *attributesP, WCharCP headingP, short *sortStatusP, ListColumnSortFuncP sortFunc, MdlDesc *sortOwnerMD, int *sortSecondaryColP, RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Similar to the mdlDialog_listBoxSetColInfo but with added arguments. More...
 
int mdlDialog_listBoxGetSortColumn (RawItemHdr *listBoxP)
 Gets the index of the current sorted column. More...
 
StatusInt mdlDialog_listBoxSetSortColumn (short *sortStatusP, ListColumnSortFuncP sortFunc, MdlDesc *sortOwnerMD, int *sortSecondaryColP, RawItemHdr *listBoxP, int columnIndex, bool sort, bool redraw)
 Sets the current sorted column and allows the setting of sort information on the column. More...
 
StatusInt mdlDialog_listBoxInsertColumnEx (int *widthP, int *maxSizeP, UInt32 *attributesP, WCharCP headingP, short *sortStatusP, ListColumnSortFuncP sortFunc, MdlDesc *sortOwnerMD, int *sortSecondaryColP, RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Similar to the mdlDialog_listBoxInsertColumn but with added arguments. More...
 
StatusInt mdlDialog_listBoxDeleteColumn (RawItemHdr *listBoxP, int columnIndex, bool redraw)
 Deletes one column from a List Box. More...
 
StatusInt mdlDialog_listBoxDeleteAll (RawItemHdr *listBoxP)
 Deletes all columns from a List Box. More...
 
StatusInt mdlDialog_listBoxGetSelections (int *nSelectionsP, SPoint2d **selectionsPP, RawItemHdr *listBoxP)
 Returns a pointer to an array indicating which cells of the given ListBox are currently selected. More...
 
StatusInt mdlDialog_listBoxSetSelections (RawItemHdr *listBoxP, int nSelections, SPoint2d *selectionsP, bool deselectAllFirst, bool redraw)
 Sets which cells in a List Box are selected given a pointer to an array of cell coordinates. More...
 
StatusInt mdlDialog_listBoxGetSelectionsX (int *nSelectionsP, Point2d **selectionsPP, RawItemHdr *listBoxP)
 Returns a pointer to an array indicating which cells of the given ListBox are currently selected. More...
 
StatusInt mdlDialog_listBoxSetSelectionsX (RawItemHdr *listBoxP, int nSelections, Point2d *selectionsP, bool deselectAllFirst, bool redraw)
 Sets which cells in a List Box are selected given a pointer to an array of cell coordinates. More...
 
StatusInt mdlDialog_listBoxGetLocationCursor (int *locationRowP, int *locationColP, RawItemHdr *listBoxP)
 Returns the location of the selection cursor within a ListBox. More...
 
StatusInt mdlDialog_listBoxSetLocationCursor (RawItemHdr *listBoxP, int locationRow, int locationCol)
 Sets the location of the selection cursor within a ListBox. More...
 
StatusInt mdlDialog_listBoxGetHeights (int *rowHeightP, int *headingHeightP, int *labelHeightP, RawItemHdr *listBoxP)
 Retrieves several heights from a ListBox, including the row height, heading height and label height. More...
 
ErrorCode mdlDialog_listBoxSetFilter (RawItemHdr *listBoxP, bool bFilter, WChar *pwFilterTableName, UInt32 filterId, bool redraw)
 Changes the status of the filter for the specified List Box, and optionally redraws the List Box. More...
 
ErrorCode mdlDialog_listBoxSetHighlightColumn (RawItemHdr *listBoxP, int columnIndex)
 Sets the highlight column in the specified List Box. More...
 
ErrorCode mdlDialog_listBoxGetEditCell (int *rowIndexP, int *colIndexP, RawItemHdr *listBoxP)
 Gets the row and column of the cell being edited in the ListBox item. More...
 
ErrorCode mdlDialog_listBoxEditCell (RawItemHdr *listBoxP, int rowIndex, int colIndex)
 Starts a cell editing session on the specified row and column in the ListBox item. More...
 
ErrorCode mdlDialog_listBoxGetFullWidth (int *iFullWidthP, bool bSetColumnWidths, RawItemHdr *listBoxP)
 Gets the width of a ListBox with all columns expanded based on the widest column values. More...
 
ErrorCode mdlDialog_listBoxMakeRowVisible (RawItemHdr *listBoxP, int rowIndex)
 Makes a row visible by scrolling it into view. More...
 
StatusInt mdlDialog_listBoxColumnSetIcon (RawItemHdr *listBoxP, int columnIndex, UInt32 *iconAlignmentP, RscId *iconIdP, RscType *iconTypeP, MdlDesc **iconOwnerMDP, BSIColorDescr **iconFgColorPP, BSIColorDescr **iconBgColorPP)
 Sets the icon information for a ListBox column heading. More...
 
int mdlDialog_listBoxGetColDisplayIndex (RawItemHdr *listBoxP, int columnIndex)
 Retrieves a column's display index. More...
 
int mdlDialog_listBoxSetColDisplayIndex (RawItemHdr *listBoxP, int columnIndex, int displayIndex)
 Sets a column's display index. More...
 
StatusInt mdlDialog_listBoxSetKeySearchColumn (RawItemHdr *listBoxP, int columnIndex)
 Sets the key search column for a ListBox. More...
 
int mdlDialog_listBoxGetDisplayColumnIndex (RawItemHdr *listBoxP, int columnIndex)
 Gets the display column index associated with an application's column index. More...
 
StatusInt mdlDialog_listBoxSetDefaultSortColumn (RawItemHdr *listBoxP, int columnIndex, short sortStatus)
 Sets the default sort column for a ListBox. More...
 
StatusInt mdlDialog_listBoxSetSortBeginRow (RawItemHdr *listBoxP, int sortBeginRow)
 Sets the row from which to start user sorting. More...
 
StatusInt mdlDialog_treeColumnSetIcon (RawItemHdr *pTree, int columnIndex, UInt32 *iconAlignmentP, RscId *iconIdP, RscType *iconTypeP, MdlDesc **iconOwnerMDP, BSIColorDescr **iconFgColorPP, BSIColorDescr **iconBgColorPP)
 Sets the icon information for a Tree column heading. More...
 

Detailed Description

Function Documentation

StatusInt mdlDialog_listBoxColumnSetIcon ( RawItemHdr listBoxP,
int  columnIndex,
UInt32 iconAlignmentP,
RscId iconIdP,
RscType iconTypeP,
MdlDesc **  iconOwnerMDP,
BSIColorDescr **  iconFgColorPP,
BSIColorDescr **  iconBgColorPP 
)

Sets the icon information for a ListBox column heading.

Parameters
[in]listBoxPis the ListBox item to process.
[in]columnIndexindex of col to set info on
[in]iconAlignmentPpoints to an unsigned long representing the alignment to be used for the icon, set NULL if not setting
[in]iconIdPpoints to a long representing the id of the icon to be used, set NULL if not setting
[in]iconTypePpoints to an unsigned long representing the type of icon to be used, set NULL if not setting
[in]iconOwnerMDPpoints to the MDL Descriptor of the icon to be used, set NULL if not setting
[in]iconFgColorPPthe color descriptor for the foreground color, set NULL if not setting
[in]iconBgColorPPthe color descriptor for the background color, set NULL if not setting
Returns
SUCCESS, or non-zero value if an error occurs.
StatusInt mdlDialog_listBoxDeleteAll ( RawItemHdr listBoxP)

Deletes all columns from a List Box.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxDeleteColumn
StatusInt mdlDialog_listBoxDeleteColumn ( RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Deletes one column from a List Box.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box from which to delete a column.
[in]columnIndexindicates which column to delete.
[in]redrawindicates whether the ListBox should be redrawn after the column is deleted.
Returns
SUCCESS or non-zero value if there is an error.
See also
usmsthmdlDialog_listBoxDeleteAllC
ErrorCode mdlDialog_listBoxDrawContents ( RawItemHdr listBoxP,
int  relRowIndex,
int  relColIndex 
)

Draws the contents of the List Box item specified by listBoxP.

Parameters
[in]listBoxPListBox to draw
[in]relRowIndexspecifies the relative row index (0 based) of the row to draw. Relative row 0 indicates that whatever is contained in the first row should be drawn, not that the first row of the List Box's StringList should be drawn. If relRowIndex is -1, all the displayed rows in the List Box will be redrawn.
[in]relColIndexspecifies the relative column index (0 based) of the column to draw. Relative column 0 indicates that the first column in the List Box should be drawn. If relColIndex is -1, all the displayed columns in the List Box will be redrawn.
Remarks
The entire List Box contents is redrawn if -1 is specified for both relRowIndex and relColIndex.
Suppose for example, that the fifth member of a List Box's StringList is changed by a call to mdlStringList_setMember. The entire List Box could be redrawn by calling mdlDialog_itemDraw, but that will cause more drawing than is necessary. Instead, mdlDialog_listBoxGetDisplayRange should be called to determine what part of the StringList is currently being displayed. Only if the fifth member is in the display range should mdlDialog_listBoxDrawContents be called, with relRowIndex set to 4 (the fifth StringList member) - topRowIndex (the first displayed StringList row).
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxGetDisplayRange
ErrorCode mdlDialog_listBoxEditCell ( RawItemHdr listBoxP,
int  rowIndex,
int  colIndex 
)

Starts a cell editing session on the specified row and column in the ListBox item.

Parameters
[in]listBoxPis the ListBox item to start the edit session for.
[in]rowIndexis the 0-based index of the row to edit.
[in]colIndexis the 0-based index of the column to edit.
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxGetEditCell
ErrorCode mdlDialog_listBoxEnableCells ( RawItemHdr listBoxP,
int  minRowIndex,
int  maxRowIndex,
int  minColIndex,
int  maxColIndex,
bool  enable,
bool  redraw 
)

Enables or disables a range of cells in the List Box specified by listBoxP.

The enable parameter should be set to true to enable the range of cells, or false to disable the cells. An enabled cell is selectable; a disabled cell is dim and unselectable.

Remarks
The minRowIndex, maxRowIndex, minColIndex, and maxColIndex parameters together specify the range of cells to affect. Row and column indexes start with 0.
Parameters
[in]listBoxPListBox to enable
[in]minRowIndexmin row of area to enable
[in]maxRowIndexmax row of area to enable
[in]minColIndexmin col of area to enable
[in]maxColIndexmax col of area to enable
[in]enablefalse=cells disabled (dim, unselectable)
[in]redrawtrue specifies that the affected cells should be redrawn if they are currently visible inside of the List Box.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxSelectCells
StatusInt mdlDialog_listBoxFindCell ( int *  iRowP,
int *  iColP,
RawItemHdr listBoxP,
Point2d *  ptP 
)

Returns the row and column in the List Box at the current mouse position, ptP.

Parameters
[out]iRowPThe row in the List Box found at the cursor position. Can be NULL
[out]iColPThe column in the List Box found at the cursor position. Can be NULL
[in]listBoxPListBox to search for cell
[in]ptPthe cursor location
Returns
SUCCESS if a row and colunm were located at the cursor position, or true otherwise.
See also
mdlDialog_listBoxGetNextSelection
int mdlDialog_listBoxGetColDisplayIndex ( RawItemHdr listBoxP,
int  columnIndex 
)

Retrieves a column's display index.

When using the LISTATTRX_REORDERCOLUMNS resource attribute, columns may be reordered by the user, resulting in a display index that may be different from the data index.

Parameters
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to get info on
Returns
The display index for a column, or ERROR if the listBoxP is invalid.
See also
mdlDialog_listBoxGetColInfo
StatusInt mdlDialog_listBoxGetColInfo ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WChar *  headingP,
RawItemHdr listBoxP,
int  columnIndex 
)

Gets several parameters associated with individual columns in List Boxes.

The first four variables passed to each function are pointers to variables representing four parameters of the specified List Box column. If any of the four pointers passed is NULL, that parameter is not retrieved.

Parameters
[out]widthPpoints to an integer representing the width of the column in dialog coordinates.
[out]maxSizePpoints to an integer representing the maximum allowable length of a List Box entry in the specified column.
[out]attributesPpoints to an integer that contains the column's attributes. The bits that can be set include ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT constants defined in dlogbox.r.h.
[out]headingPpoints to a character buffer that contains the column's title.
[in]listBoxPpoints to the RawItemHdr of the List Box containing the column in question.
[in]columnIndexis the index of the column in question.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxSetInfo mdlDialog_listBoxGetInfo mdlDialog_listBoxSetColInfo
StatusInt mdlDialog_listBoxGetColInfoEx ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WChar *  headingP,
int *  originXP,
short *  sortStatusP,
int *  sortSecondaryColP,
RawItemHdr listBoxP,
int  columnIndex 
)

Similar to the mdlDialog_listBoxGetColInfo but with added arguments.

Parameters
[out]widthPset NULL if don't want width (in dcoords)
[out]maxSizePset NULL if don't want max sz.
[out]attributesPset NULL if don't want attr
[out]headingPset NULL if don't want heading
[out]originXPpoints to an integer representing the X origin of the column in pixels
[out]sortStatusPpoints to a short representing the current sort status of the column. Possible values are NOSORT, 0, SORTED_ASCENDING or SORTED_DESCENDING.
[in]sortSecondaryColPpoints to an integer representing the secondary column to sort on for this column.
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to get info on
Returns
SUCCESS, or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxGetColInfo
int mdlDialog_listBoxGetDisplayColumnIndex ( RawItemHdr listBoxP,
int  columnIndex 
)

Gets the display column index associated with an application's column index.

Parameters
[in]listBoxPthe ListBox item to process.
[in]columnIndexindex of the column to get the display index for.
Returns
Display index associated with an application's column index, or ERROR if listBoxP or columnIndex is invalid or if the application's column index is not displayed.
ErrorCode mdlDialog_listBoxGetDisplayRange ( int *  topRowIndexP,
int *  bottomRowIndexP,
int *  leftColIndexP,
int *  rightColIndexP,
RawItemHdr listBoxP 
)

Gets the range of the cells that are displayed in the List Box specified by listBoxP.

The function is used to determine what part of the List Box's StringList is currently being displayed. The first and last displayed rows in the List Box are copied to the locations specified by topRowIndexP and bottomRowIndexP. The first and last displayed columns in the List Box are copied to the locations specified by leftColIndexP and rightColIndexP. topRowIndexP, bottomRowIndexP, leftColIndexP or rightColIndexP can be NULL, indicating that the caller doesn't need the value.

Parameters
[out]topRowIndexProw # of 1st row displayed (0 based)
[out]bottomRowIndexProw # of last row displayed (0 based)
[out]leftColIndexPcol # of leftmost col displayed (0 based)
[out]rightColIndexPcol # of rightmost col displayed (0 based)
[in]listBoxPListBox to get display range of
Remarks
For example, suppose that a List Box is configured to display five rows at a time with one column, and that its StringList contains twenty members. If the first row of the List Box is displaying the sixth member of the StringList (whose row index is five), the integers pointed at by topRowIndexP, bottomRowIndexP, leftColIndexP and rightColIndexP will be set to 5, 9, 0 and 0 respectively.
Row and column indexes start with 0.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxSetTopRow
ErrorCode mdlDialog_listBoxGetEditCell ( int *  rowIndexP,
int *  colIndexP,
RawItemHdr listBoxP 
)

Gets the row and column of the cell being edited in the ListBox item.

Parameters
[out]rowIndexPreceives the 0-based index of the row being edited.
[out]colIndexPreceives the 0-based index of the column being edited.
[in]listBoxPis the ListBox item containing the cell being edited.
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxEditCell
ErrorCode mdlDialog_listBoxGetFullWidth ( int *  iFullWidthP,
bool  bSetColumnWidths,
RawItemHdr listBoxP 
)

Gets the width of a ListBox with all columns expanded based on the widest column values.

Parameters
[out]iFullWidthPpoints to an integer that receives the ListBox's full width.
[in]bSetColumnWidthstrue indicates to set the widths of the columns based on the widest column values.
[in]listBoxPpoints to the RawItemHdr of the ListBox in question.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxGetColInfo mdlDialog_listBoxSetColInfo
StatusInt mdlDialog_listBoxGetHeights ( int *  rowHeightP,
int *  headingHeightP,
int *  labelHeightP,
RawItemHdr listBoxP 
)

Retrieves several heights from a ListBox, including the row height, heading height and label height.

Parameters
[in]listBoxPpoints to the RawItemHdr for the ListBox item
[out]rowHeightPpoints to an integer representing the height of a row
[out]headingHeightPpoints to an integer representing the height of the heading
[out]labelHeightPpoints to an integer representing the height of the label, if above the ListBox
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxGetInfo
StatusInt mdlDialog_listBoxGetInfo ( UInt32 attributesP,
UInt32 nRowsP,
UInt32 sizeNumColumnP,
RawItemHdr listBoxP 
)

Gets several parameters associated with List Boxes.

The first three variables passed to each function are pointers to variables representing three parameters of the specified List Box. If any of the three pointers passed is NULL, that parameter is not retrieved.

Parameters
[out]attributesPpoints to an integer that contains the List Box's attributes. The bits that can be set include LISTATTR_LABELONSIDE, LISTATTR_RANGESELECTION, and so on. The constants are defined in dlogbox.r.h.
[out]nRowsPpoints to an integer representing the number of rows the List Box can display at once.
[out]sizeNumColumnPpoints to the integer allowing the List Box handler to automatically number the rows. The maximum number of digits necessary to number the rows is specified. For example, if a list can have up to 99 rows, 2 should be specified. If the integer pointed to by sizeNumColumnP is 0, the rows are not numbered.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxGetColInfo mdlDialog_listBoxSetColInfo
StatusInt mdlDialog_listBoxGetInfoEx ( UInt32 attributesP,
UInt32 nRowsP,
UInt32 sizeNumColumnP,
UInt32 attributesExP,
UInt32 statusFlagsP,
RawItemHdr listBoxP 
)

Gets several parameters associated with List Boxes.

If any of the five pointers passed is NULL, that parameter is not retrieved.

Parameters
[out]attributesPpoints to a value that contains the List Box's attributes. The bits that can be set include LISTATTR_LABEL_ON_SIDE, LISTATTR_RANGE_SELECTION, and so on. The constants are defined in dlogbox.r.h.
[out]nRowsPpoints to an value representing the number of rows the List Box can display at once.
[out]sizeNumColumnPpoints to the value allowing the List Box handler to automatically number the rows. The maximum number of digits necessary to number the rows is specified. For example, if a list can have up to 99 rows, 2 should be specified. If the value pointed to by sizeNumColumnP is 0, the rows are not numbered.
[out]attributesExPpoints to a value representing the extended attributes of the List Box.
[out]statusFlagsPpoints to a value representing the status flags (DISTATUS_...) of the List Box.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
ListModel* mdlDialog_listBoxGetListModelP ( RawItemHdr listBoxP)

Retrieves a pointer to the ListModel.

Parameters
[in]listBoxPpoints to the RawItemHdr for the ListBox item
Returns
A pointer to the ListModel
See also
mdlDialog_listBoxSetListModelP
StatusInt mdlDialog_listBoxGetLocationCursor ( int *  locationRowP,
int *  locationColP,
RawItemHdr listBoxP 
)

Returns the location of the selection cursor within a ListBox.

Parameters
[out]locationRowPpoints to an integer to receive the selection cursor's row number.
[out]locationColPpoints to an integer to receive the selection cursor's column number.
[in]listBoxPpoint to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxSetLocationCursor
int mdlDialog_listBoxGetNColumns ( RawItemHdr listBoxP)

Retrieves the number of columns present in a List Box.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box to check.
Returns
The number of columns in the List Box, or -1 on error.
ErrorCode mdlDialog_listBoxGetNextSelection ( bool *  foundP,
int *  rowIndexP,
int *  colIndexP,
RawItemHdr listBoxP 
)

Searches for the next selected cell of the List Box specified by listBoxP.

Parameters
[out]foundPThe boolean variable pointed at by foundP is set to true if a selected cell was found.
[in,out]rowIndexPon input these two args specify cell to start
[in,out]colIndexPsearch AFTER; output next selected cell; ptrs to -1, -1 mean search from beginning
[in]listBoxPListBox to get next selection of
Remarks
On input rowIndexP and colIndexP specify the cell to start the search after. Pointing at -1 with both of these parameters indicates that the search should start from the beginning of the list.
If a selected cell is found, its row index and column index are copied to the locations specified by rowIndexP and colIndexP.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxGetSelectRange
StatusInt mdlDialog_listBoxGetSelections ( int *  nSelectionsP,
SPoint2d **  selectionsPP,
RawItemHdr listBoxP 
)

Returns a pointer to an array indicating which cells of the given ListBox are currently selected.

The array is a series of contiguous SPoint2d structures, each of which has two short integer fields called x and y. There is no need for the calling function to deallocate the array.

Parameters
[out]nSelectionsPpoints to an integer to receive the number of currently selected cells, which is also the size of the array.
[out]selectionsPPis a pointer to the pointer variable that is to receive the location of the array. After this function is called, *selectionsPP points to the beginning of the array.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxSetSelections
StatusInt mdlDialog_listBoxGetSelectionsX ( int *  nSelectionsP,
Point2d **  selectionsPP,
RawItemHdr listBoxP 
)

Returns a pointer to an array indicating which cells of the given ListBox are currently selected.

The array is a series of Point2d structures. There is no need for the calling function to deallocate the array.

Parameters
[out]nSelectionsPpoints to an integer to receive the number of currently selected cells, which is also the size of the array.
[out]selectionsPPis a pointer to the pointer variable that is to receive the location of the array. After this function is called, *selectionsPP points to the beginning of the array.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
ErrorCode mdlDialog_listBoxGetSelectRange ( int *  minRowIndexP,
int *  maxRowIndexP,
int *  minColIndexP,
int *  maxColIndexP,
RawItemHdr listBoxP 
)

Gets the range of the cells that are currently selected in the List Box specified by listBoxP.

The first and last selected rows in the List Box are copied to the locations specified by the minRowIndexP and maxRowIndexP parameters. The first and last selected columns in the List Box are copied to the locations specified by the minColIndexP and maxColIndexP parameters. Any of the parameters minRowIndexP, maxRowIndexP, minColIndexP or maxColIndexP can be NULL, which indicates that the caller doesn't need the value. Row and column indexes start with 0.

Parameters
[out]minRowIndexPmin row of selection
[out]maxRowIndexPmax row of selection
[out]minColIndexPmin column of selection
[out]maxColIndexPmax column of selection
[in]listBoxPListBox to get selection of
Remarks
If the List Box is set up to allow disjoint selections, not all of the cells in the returned range will necessarily be selected. This function only returns the bounds of the selected cells. Use mdlDialog_listBoxIsCellSelected to determine if a cell in the range is actually selected when disjoint selections are allowed.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxGetNextSelection mdlDialog_listBoxIsCellSelected
int mdlDialog_listBoxGetSortColumn ( RawItemHdr listBoxP)

Gets the index of the current sorted column.

Parameters
[in]listBoxPlistBox to get info on
Returns
Index of the current sort column, or ERROR if the listBoxP is invalid or no column is sorted.
See also
mdlDialog_listBoxSetSortColumn
StringListP mdlDialog_listBoxGetStrListP ( RawItemHdr listBoxP)

Retrieves a pointer to the StringList that the List Box item specified by listBoxP is manipulating.

Parameters
[in]listBoxPListBox to get strListP of
Remarks
To take full advantage of the List Box manager features, the StringList associated with a List Box should have at least one information field. The List Box manager uses the first information field (index 0) to store information regarding the state of that string.
The following example code fragment shows the part of a List Box item hook function that calls mdlDialog_listBoxSetStrListP, and also has an example of mdlDialog_listBoxGetStrListP:
static void listBoxHook
(
);
{
dimP->msgUnderstood = true;
switch (dimP->messageType)
{
{
StringListP strListP;
strListP = mdlStringList_create(20, 1);
Set up the members of the StringList here
...
mdlDialog_listBoxSetStrListP(dimP->dialogItemP->rawItemP, strListP, 1);
break;
}
{
StringListP strListP;
strListP = mdlDialog_listBoxGetStrListP(dimP->dialogItemP->rawItemP);
free up any other memory allocated for the item
...
break;
}
...
default:
{
dimP->msgUnderstood=false;
break;
}
}
}
Returns
A pointer to the List Box's StringList, or NULL if an error occurred.
See also
mdlDialog_listBoxSetStrListP
StatusInt mdlDialog_listBoxInsertColumn ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WCharCP  headingP,
RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Inserts a new column into an existing List Box.

Parameters
[in]widthPpoints to an integer representing the width of the column in dialog coordinates. NULL means 8*XC.
[in]maxSizePpoints to an integer representing the maximum allowable size of a List Box entry in the specified column. The maximum size is set to 10 if maxSizeP is NULL.
[in]attributesPpoints to an integer that contains the column's attributes. The bits that can be set include ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT constants defined in dlogbox.r.h. NULL means 0.
[in]headingPpoints to a character buffer that contains the column's title. The new column will have no heading if headingP is NULL.
[in]listBoxPpoints to the RawItemHdr of the List Box containing the column in question.
[in]columnIndexis the index of the column before which to insert. A value of -1 means make the new column the right most.
[in]redrawis a boolean flag indicating whether mdlDialog_listBoxInsertColumn should cause the List Box to be redrawn after the column information is modified.
Returns
SUCCESS on success or non-zero value if there is an error.
StatusInt mdlDialog_listBoxInsertColumnEx ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WCharCP  headingP,
short *  sortStatusP,
ListColumnSortFuncP  sortFunc,
MdlDesc sortOwnerMD,
int *  sortSecondaryColP,
RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Similar to the mdlDialog_listBoxInsertColumn but with added arguments.

Parameters
[in]widthPset NULL if not setting width (in dcoords)
[in]maxSizePset NULL if not setting max sz
[in]attributesPset NULL if not setting attr
[in]headingPset NULL if not setting headng
[in]sortStatusPpoints to a short representing the current sort status of the column. Possible values are NOSORT, 0, SORTED_ASCENDG or SORTED_DESCENDG.
[in]sortFuncpoints to a sort function for column sorting.
[in]sortOwnerMDpoints to an MdlDescr pointer representing the Owner of the sortFunc
[in]sortSecondaryColPpoints to an integer representing the secondary column to sort on for this column.
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to get info on
[in]redrawredraw listBox?
Returns
SUCCESS, or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxInsertColumn
bool mdlDialog_listBoxIsCellEnabled ( RawItemHdr listBoxP,
int  rowIndex,
int  colIndex 
)

Determines if a cell in the List Box specified by listBoxP is enabled.

An enabled cell is selectable; a disabled cell is dim and unselectable.

Parameters
[in]listBoxPListBox to test
[in]rowIndexrow index of cell to test
[in]colIndexcolumn index of cell to test
Remarks
The rowIndex and colIndex parameters indicate which cell to test. Row and column indexes start with 0.
Returns
true if the cell is enabled.
See also
mdlDialog_listBoxLastCellClicked mdlDialog_listBoxIsCellSelected
bool mdlDialog_listBoxIsCellSelected ( RawItemHdr listBoxP,
int  rowIndex,
int  colIndex 
)

Determines if a cell in the List Box specified by listBoxP is selected.

A selected cell is a cell that is displayed with a black background color instead of the normal light gray.

Parameters
[in]listBoxPListBox to set
[in]rowIndexrow index of cell to test
[in]colIndexcolumn index of cell to test
Remarks
The rowIndex and colIndex parameters indicate which cell to test. Row and column indexes start with 0.
Returns
true if the cell is selected.
See also
mdlDialog_listBoxLastCellClicked mdlDialog_listBoxIsCellEnabled
ErrorCode mdlDialog_listBoxLastCellClicked ( int *  rowIndexP,
int *  colIndexP,
RawItemHdr listBoxP 
)

Determines the cell in the List Box specified by listBoxP in which the data button was last clicked.

The row index and column index of this cell are copied to the locations specified by rowIndexP and colIndexP. Either rowIndexP or colIndexP can be NULL, which indicates that the caller doesn't need the value. Row and column indexes start with 0.

Parameters
[out]rowIndexProw index of last cell clicked
[out]colIndexPcolumn index of last cell clicked
[in]listBoxPListBox to get last click cell of
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxIsCellSelected mdlDialog_listBoxIsCellEnabled
ErrorCode mdlDialog_listBoxMakeRowVisible ( RawItemHdr listBoxP,
int  rowIndex 
)

Makes a row visible by scrolling it into view.

Parameters
[in]listBoxPis the ListBox item to process.
[in]rowIndexis the 0-based index of the row to make visible.
Returns
SUCCESS, or non-zero value if an error occurs.
ErrorCode mdlDialog_listBoxNRowsChanged ( RawItemHdr listBoxP)

Informs the List Box item specified by listBoxP that the number of rows in its StringList or ListModel has changed.

An MDL application should call this function whenever the number of rows or members in the List Box's StringList or ListModel changes. mdlDialog_listBoxNRowsChanged corrects the size of the List Box's Scroll Bar.

Parameters
[in]listBoxPListBox to notify of number change
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlStringList_insertMember mdlStringList_deleteMember
ErrorCode mdlDialog_listBoxNRowsChangedRedraw ( RawItemHdr listBoxP,
bool  redraw 
)

Similar to mdlDialog_listBoxNRowsChanged but also gives the option of redrawing or not.

Parameters
[in]listBoxPpoints to the RawItemHdr for the ListBox item
[in]redrawIf true the ListBox will redraw after internal calculations have been made; if false it will not redraw.
Returns
SUCCESS, or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxNRowsChanged
ErrorCode mdlDialog_listBoxSelectCells ( RawItemHdr listBoxP,
int  minRowIndex,
int  maxRowIndex,
int  minColIndex,
int  maxColIndex,
bool  selectOn,
bool  redraw 
)

Selects a range of cells in the List Box specified by listBoxP.

The selectOn parameter should be set to true to select the range of cells, or false to deselect the cells. Selected cells are displayed with a black background color.

Remarks
The minRowIndex, maxRowIndex, minColIndex, and maxColIndex parameters together specify the range of cells to affect. Row and column indexes start with 0.
Parameters
[in]listBoxPListBox to select
[in]minRowIndexmin row of area to select
[in]maxRowIndexmax row of area to select
[in]minColIndexmin column of area to select
[in]maxColIndexmax column of area to select
[in]selectOnfalse means selection is turned off
[in]redrawThe redraw parameter, when true, specifies that the affected cells should be redrawn if they are currently visible inside of the List Box.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxEnableCells
int mdlDialog_listBoxSetColDisplayIndex ( RawItemHdr listBoxP,
int  columnIndex,
int  displayIndex 
)

Sets a column's display index.

When using the LISTATTRX_REORDERCOLUMNS resource attribute, columns may be reordered by the user, resulting in a display index that may be different from the data index.

Parameters
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to get info on
[in]displayIndexThe display index for a column
Returns
ERROR if the listBoxP is invalid.
See also
mdlDialog_listBoxSetColInfo
StatusInt mdlDialog_listBoxSetColInfo ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WCharCP  headingP,
RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Sets several parameters associated with individual columns in List Boxes.

The first four variables passed to each function are pointers to variables representing four parameters of the specified List Box column. If any of the four pointers passed is NULL, that parameter is not set.

Parameters
[in]widthPpoints to an integer representing the width of the column in dialog coordinates.
[in]maxSizePpoints to an integer representing the maximum allowable length of a List Box entry in the specified column.
[in]attributesPpoints to an integer that contains the column's attributes. The bits that can be set include ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT constants defined in dlogbox.r.h.
[in]headingPpoints to a character buffer that contains the column's title.
[in]listBoxPpoints to the RawItemHdr of the List Box containing the column in question.
[in]columnIndexis the index of the column in question.
[in]redrawis a boolean flag indicating whether mdlDialog_listBoxSetColInfo should cause the List Box to be redrawn after the column information is modified.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxSetInfo mdlDialog_listBoxGetInfo mdlDialog_listBoxGetColInfo
StatusInt mdlDialog_listBoxSetColInfoEx ( int *  widthP,
int *  maxSizeP,
UInt32 attributesP,
WCharCP  headingP,
short *  sortStatusP,
ListColumnSortFuncP  sortFunc,
MdlDesc sortOwnerMD,
int *  sortSecondaryColP,
RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Similar to the mdlDialog_listBoxSetColInfo but with added arguments.

Parameters
[in]widthPset NULL if not setting width (in dcoords)
[in]maxSizePset NULL if not setting max sz
[in]attributesPset NULL if not setting attr
[in]headingPset NULL if not setting headng
[in]sortStatusPpoints to a short representing the current sort status of the column. Possible values are NOSORT, 0, SORTED_ASCENDG or SORTED_DESCENDG.
[in]sortFuncpoints to a sort function for column sorting. When using a ListModel, the signature of the sort function should conform to ListColumnSortFuncP in dlogitem.h. Also see mdlListColumn_setSortFunction. When using a StringList, see Bentley::mdlStringList_sort for callback formatting.
[in]sortOwnerMDpoints to an MdlDescr pointer representing the Owner of the sortFunc
[in]sortSecondaryColPpoints to an integer representing the secondary column to sort on for this column.
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to get info on
[in]redrawredraw listBox?
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxGetColInfo mdlListColumn_setSortFunction
StatusInt mdlDialog_listBoxSetColumnHeading ( WCharCP  headingP,
RawItemHdr listBoxP,
int  columnIndex,
bool  redraw 
)

Updates a column's heading to a Unicode string.

Parameters
[in]headingPpoints to a Unicode character buffer that contains the column's title.
[in]listBoxPpoints to the RawItemHdr of the List Box containing the column in question.
[in]columnIndexis the index of the column to update.
[in]redrawis a boolean flag indicating whether the List Box to be redrawn after the column information is modified.
Returns
SUCCESS on success or non-zero value if there is an error.
StatusInt mdlDialog_listBoxSetDefaultSortColumn ( RawItemHdr listBoxP,
int  columnIndex,
short  sortStatus 
)

Sets the default sort column for a ListBox.

This setting applies to a sortable ListBox before the user has clicked any column heading to sort.

Parameters
[in]listBoxPthe ListBox item to process.
[in]columnIndexindex of the default sort column.
[in]sortStatusthe initial status of the sort - SORTED_ASCENDG or SORTED_DESCENDG
Returns
SUCCESS, or non-zero value if an error occurs.
ErrorCode mdlDialog_listBoxSetFilter ( RawItemHdr listBoxP,
bool  bFilter,
WChar *  pwFilterTableName,
UInt32  filterId,
bool  redraw 
)

Changes the status of the filter for the specified List Box, and optionally redraws the List Box.

Parameters
[in]listBoxPspecifies the List Box in which the filter status is being changed.
[in]bFilterspecifies whether the filter row is being enabled or disabled. Set true to enable the filter row.
[in]pwFilterTableNameis the name space for the filter.
[in]filterIdis the id of the filter.
[in]redrawindicates whether the List Box should be redrawn after the status change. Set true to redraw the List Box.
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
ErrorCode mdlDialog_listBoxSetHighlightColumn ( RawItemHdr listBoxP,
int  columnIndex 
)

Sets the highlight column in the specified List Box.

Parameters
[in]listBoxPis the List Box in which the highlight column is being set.
[in]columnIndexis the index of the column to highlight. Set this to -1 to highlight all columns.
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
StatusInt mdlDialog_listBoxSetInfo ( UInt32 attributesP,
UInt32 nRowsP,
UInt32 sizeNumColumnP,
bool  redraw,
RawItemHdr listBoxP 
)

Sets several parameters associated with List Boxes.

The first three variables passed to each function are pointers to variables representing three parameters of the specified List Box. If any of the three pointers passed is NULL, that parameter is not set.

Parameters
[in]attributesPpoints to an integer that contains the List Box's attributes. The bits that can be set include LISTATTR_LABEL_ON_SIDE, LISTATTR_RANGE_SELECTION, and so on. The constants are defined in dlogbox.r.h.
[in]nRowsPpoints to an integer representing the number of rows the List Box can display at once.
[in]sizeNumColumnPpoints to the integer allowing the List Box handler to automatically number the rows. The maximum number of digits necessary to number the rows is specified. For example, if a list can have up to 99 rows, 2 should be specified. If the integer pointed to by sizeNumColumnP is 0, the rows are not numbered.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
[in]redrawis a boolean flag indicating whether mdlDialog_listBoxSetInfo should cause the List Box to be redrawn after the List Box information is modified.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxGetColInfo mdlDialog_listBoxSetColInfo mdlDialog_listBoxGetInfo
StatusInt mdlDialog_listBoxSetInfoEx ( UInt32 attributesP,
UInt32 nRowsP,
UInt32 sizeNumColumnP,
UInt32 attributesExP,
bool  redraw,
RawItemHdr listBoxP 
)

Sets several parameters associated with List Boxes.

If any of the four pointers passed is NULL, that parameter is not set.

Parameters
[in]attributesPpoints to a value that contains the List Box's attributes. The bits that can be set include LISTATTR_LABEL_ON_SIDE, LISTATTR_RANGE_SELECTION, and so on. The constants are defined in dlogbox.r.h.
[in]nRowsPpoints to an value representing the number of rows the List Box can display at once.
[in]sizeNumColumnPpoints to the value allowing the List Box handler to automatically number the rows. The maximum number of digits necessary to number the rows is specified. For example, if a list can have up to 99 rows, 2 should be specified. If the value pointed to by sizeNumColumnP is 0, the rows are not numbered.
[in]attributesExPpoints to a value representing the extended attributes of the List Box.
[in]redrawindicates whether the List Box should be redrawn after updating with the new values.
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
Returns
SUCCESS on success or non-zero value if there is an error.
StatusInt mdlDialog_listBoxSetKeySearchColumn ( RawItemHdr listBoxP,
int  columnIndex 
)

Sets the key search column for a ListBox.

The key search column is used to allow quick navigation of the list box contents via keystrokes.

Parameters
[in]listBoxPthe ListBox item to process.
[in]columnIndexindex to set as the key search column.
Returns
SUCCESS, or non-zero value if an error occurs.
Remarks
The key search column is ignored if the list box has independent columns.
Key searching only works if the values of the list cells are format types FMT_STRING or FMT_WCHAR.
ErrorCode mdlDialog_listBoxSetListModelP ( RawItemHdr listBoxP,
ListModel *  pListModel,
int  unused 
)

Sets the ListModel pointer in the ListBox.

ListModels and StringLists are mutually exclusive.

Parameters
[in]listBoxPpoints to the RawItemHdr for the ListBox item
[in]pListModelpoints to the ListModel to be used as the data source for the ListBox
[in]unusedThis parameter is not used. Set to 0.
Returns
SUCCESS, or non-zero value if either listBoxP or pListModel is invalid.
See also
mdlDialog_listBoxGetListModelP mdlDialog_listBoxSetListModelPEx
ErrorCode mdlDialog_listBoxSetListModelPEx ( RawItemHdr listBoxP,
ListModel *  pListModel,
int  unused,
bool  redraw 
)

An extension of mdlDialog_listBoxSetListModelP that allows control over the redrawing of the ListBox after setting the ListModel pointer.

Parameters
[in]listBoxPpoints to the RawItemHdr for the ListBox item
[in]pListModelpoints to the ListModel to be used as the data source for the ListBox
[in]unusedThis parameter is not used. Set to 0.
[in]redrawindicates whether to redraw the ListBox after setting the ListModel pointer
Returns
SUCCESS, or non-zero value if either listBoxP or pListModel is invalid.
See also
mdlDialog_listBoxGetListModelP mdlDialog_listBoxSetListModelPEx
StatusInt mdlDialog_listBoxSetLocationCursor ( RawItemHdr listBoxP,
int  locationRow,
int  locationCol 
)

Sets the location of the selection cursor within a ListBox.

Parameters
[in]listBoxPpoint to the RawItemHdr of the List Box in question.
[in]locationRowis an integer indicating the selection cursor's row number.
[in]locationColis an integer indicating the selection cursor's column number.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxGetLocationCursor
StatusInt mdlDialog_listBoxSetSelections ( RawItemHdr listBoxP,
int  nSelections,
SPoint2d *  selectionsP,
bool  deselectAllFirst,
bool  redraw 
)

Sets which cells in a List Box are selected given a pointer to an array of cell coordinates.

The array is a series of contiguous SPoint2d structures, each of which has two short integer fields called x and y. nSelections is an integer indicating the number of cells to select, which is also the size of the array.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
[in]nSelectionsindicates the number of selections in the array.
[in]selectionsPpoints to the array of cell coordinates to select.
[in]deselectAllFirstindicates whether all current selections should be dropped before the specified selections are made.
[in]redrawindicates whether mdlDialog_listBoxSetSelections should cause the List Box to be redrawn after the selections are made.
Returns
SUCCESS on success or non-zero value if there is an error.
See also
mdlDialog_listBoxGetSelections
StatusInt mdlDialog_listBoxSetSelectionsX ( RawItemHdr listBoxP,
int  nSelections,
Point2d *  selectionsP,
bool  deselectAllFirst,
bool  redraw 
)

Sets which cells in a List Box are selected given a pointer to an array of cell coordinates.

The array is a series of contiguous Point2d structures. nSelections is an integer indicating the number of cells to select, which is also the size of the array.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
[in]nSelectionsindicates the number of selections in the array.
[in]selectionsPpoints to the array of cell coordinates to select.
[in]deselectAllFirstindicates whether all current selections should be dropped before the specified selections are made.
[in]redrawindicates whether mdlDialog_listBoxSetSelections should cause the List Box to be redrawn after the selections are made.
Returns
SUCCESS on success or non-zero value if there is an error.
StatusInt mdlDialog_listBoxSetSortBeginRow ( RawItemHdr listBoxP,
int  sortBeginRow 
)

Sets the row from which to start user sorting.

Parameters
[in]listBoxPthe ListBox item to process.
[in]sortBeginRowindex of the row from which to start user sorting.
Returns
SUCCESS, or non-zero value if an error occurs.
StatusInt mdlDialog_listBoxSetSortColumn ( short *  sortStatusP,
ListColumnSortFuncP  sortFunc,
MdlDesc sortOwnerMD,
int *  sortSecondaryColP,
RawItemHdr listBoxP,
int  columnIndex,
bool  sort,
bool  redraw 
)

Sets the current sorted column and allows the setting of sort information on the column.

Parameters
[in]sortStatusPpoints to a short representing the current sort status of the column. Possible values are NOSORT, 0, SORTED_ASCENDG or SORTED_DESCENDG.
[in]sortFuncpoints to a sort function for column sorting.
[in]sortOwnerMDpoints to an MdlDescr pointer representing the Owner of the sortFunc
[in]sortSecondaryColPpoints to an integer representing the secondary column to sort on for this column.
[in]listBoxPlistBox to get info on
[in]columnIndexindex of col to set info on
[in]sortsort?
[in]redrawredraw listBox?
Returns
SUCCESS on success or non-zero value if the listBoxP is invalid.
See also
mdlDialog_listBoxGetSortColumn
ErrorCode mdlDialog_listBoxSetStrListP ( RawItemHdr listBoxP,
StringListP  strListP,
int  nColumns 
)

Sets the StringList that the List Box item will use.

nColumns is the number of columns per row in the List Box. It should be set to the same number of columns that were specified in the List Box resource specification. A List Box item must have an item hook function attached to it and mdlDialog_listBoxSetStrListP must be called upon receipt of the DITEM_MESSAGE_CREATE message. Otherwise the List Box item won't know what to display as its contents.

Parameters
[in]listBoxPListBox to set strListP in
[in]strListPlist's StringList
[in]nColumnsnumber of columns in list
Remarks
To take full advantage of the List Box manager features, the StringList associated with a List Box should have at least one information field. The List Box manager uses the first information field (index 0) to store information regarding the state of that string.
The following example code fragment shows the part of a List Box item hook function that calls mdlDialog_listBoxSetStrListP, and also has an example of mdlDialog_listBoxGetStrListP:
static void listBoxHook
(
);
{
dimP->msgUnderstood = true;
switch (dimP->messageType)
{
{
StringListP strListP;
strListP=mdlStringList_create(20, 1);
Set up the members of the StringList here
...
mdlDialog_listBoxSetStrListP(dimP->dialogItemP->rawItemP,
strListP, 1);
break;
}
{
*strListP;
strListP=mdlDialog_listBoxGetStrListP(dimP->dialogItemP->rawItemP);
free up any other memory allocated for the item
...
break;
}
...
default:
{
dimP->msgUnderstood=false;
break;
}
}
}
Returns
SUCCESS, or non-zero value if the List Box's StringList was improperly set. This usually means that either listBoxP or strListP is invalid.
See also
mdlDialog_listBoxGetStrListP
ErrorCode mdlDialog_listBoxSetTopRow ( RawItemHdr listBoxP,
int  topRowIndex 
)

Sets the first displayed row of a List Box to be topRowIndex.

Parameters
[in]listBoxPListBox to set 1st disp. row
[in]topRowIndexnew first disp. row (0 based)
Remarks
For example, suppose that a List Box is configured to display five rows at a time with one column, and that its StringList contains twenty members. If the first row of the List Box is displaying the sixth member of the StringList (whose row index is five), the integers pointed at by topRowIndexP, bottomRowIndexP, leftColIndexP and rightColIndexP will be set to 5, 9, 0 and 0 respectively.
Row and column indexes start with 0.
Returns
SUCCESS, or non-zero value if an error occurred. This usually means that listBoxP is not a pointer to a List Box item.
See also
mdlDialog_listBoxGetDisplayRange
ErrorCode mdlDialog_listBoxSetTopRowRedraw ( RawItemHdr listBoxP,
int  topRowIndex,
bool  redraw 
)

Sets which row number of a List Box is displayed as the first row.

Optionally, it can also cause the List Box to be redrawn showing the new position.

Parameters
[in]listBoxPpoints to the RawItemHdr of the List Box in question.
[in]topRowIndexis the index of the row to be displayed as the new top row.
[in]redrawindicates whether the ListBox should be redrawn.
Returns
SUCCESS on success or non-zero value if there is an error.
StatusInt mdlDialog_treeColumnSetIcon ( RawItemHdr pTree,
int  columnIndex,
UInt32 iconAlignmentP,
RscId iconIdP,
RscType iconTypeP,
MdlDesc **  iconOwnerMDP,
BSIColorDescr **  iconFgColorPP,
BSIColorDescr **  iconBgColorPP 
)

Sets the icon information for a Tree column heading.

Parameters
[in]pTreeis the Tree item to process.
[in]columnIndexindex of col to set info on
[in]iconAlignmentPpoints to an unsigned long representing the alignment to be used for the icon, set NULL if not setting
[in]iconIdPpoints to a long representing the id of the icon to be used, set NULL if not setting
[in]iconTypePpoints to an unsigned long representing the type of icon to be used, set NULL if not setting
[in]iconOwnerMDPpoints to the MDL Descriptor of the icon to be used, set NULL if not setting
[in]iconFgColorPPthe color descriptor for the foreground color, set NULL if not setting
[in]iconBgColorPPthe color descriptor for the background color, set NULL if not setting
Returns
SUCCESS, or non-zero value if an error occurs.

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.