Functions
ListColumns

Functions

StatusInt mdlListModel_setRowDestroyFunction (ListModel *pModel, ListRowDestroyFuncP destroyFunc, MdlDescP ownerMD)
 Sets the function to call for each ListRow during an mdlListModel_destroy or mdlListRow_destroy call. More...
 
int mdlListColumn_getId (ListColumnCP pColumn)
 Returns the Id of a specified ListColumn. More...
 
StatusInt mdlListColumn_setId (ListColumnP pColumn, int id)
 Sets the Id of a specified ListColumn. More...
 
WCharCP mdlListColumn_getName (ListColumnCP pColumn)
 Get the name of the specified ListColumn. More...
 
StatusInt mdlListColumn_setName (ListColumnP pColumn, WCharCP pwName)
 Set the name string on the specified ListColumn. More...
 
int mdlListColumn_getInfoFieldCount (ListColumnCP pColumn)
 Returns the number of info fields for a specified ListColumn. More...
 
StatusInt mdlListColumn_setInfoFieldCount (ListColumnP pColumn, int count)
 Sets the number of info fields in a specified ListColumn. More...
 
StatusInt mdlListColumn_setSortFunction (ListColumnP pColumn, ListColumnSortFuncP sortFunc, MdlDescP ownerMD, int secondaryColumn)
 Sets the function to call during a ListModel sort when sorting on the column index associated with this ListColumn. More...
 
bool mdlListColumn_hasSortFunction (ListColumnCP pColumn)
 Determines if a column already has a sort function. More...
 
int mdlListColumn_getSecondarySortColumn (ListColumnCP pColumn)
 Gets the index of the secondary sort column from the specified column. More...
 
bool mdlListColumn_isSortIgnoreCase (ListColumnCP pColumn)
 Determines whether the specified column has its Ignore Case attribute for sorts set. More...
 
int mdlListColumn_setSortIgnoreCase (ListColumnP pColumn, bool bIgnoreCase)
 Sets the Ignore Case attribute for the specified column for sorts. More...
 
bool mdlListColumn_isSecondarySortAlwaysDirectional (ListColumnCP pColumn, bool *pAscending)
 Determines whether the specified column has its Always Directional attribute for secondary column sorts is on, and the sort direction is the same as specified. More...
 
int mdlListColumn_setSecondarySortAlwaysDirectional (ListColumnP pColumn, bool bAlwaysDirectional, bool bAscending)
 Sets the Always Directional attribute for secondary column sorts. More...
 
int mdlListColumn_lexicographicSortFunc (ListModelP pListModel, ListRowP pRow1, ListRowP pRow2, bool ascending, int columnIndex)
 A utility sorting function for lexicographic sorts. More...
 
StatusInt mdlListColumn_setSearchFunction (ListColumnP pColumn, ListColumnSearchFuncP searchFunc, MdlDescP ownerMD)
 Sets the function to call during a ListModel search when searching on the column index associated with this ListColumn. More...
 
int mdlListColumn_getSecondarySearchColumn (ListColumnCP pColumn)
 Gets the secondary search column to search if an mdlListModel_search call finds no match. More...
 
int mdlListColumn_setSecondarySearchColumn (ListColumnP pColumn, int iSecondaryColumn)
 Sets the secondary search column to search if an mdlListModel_search call finds no match. More...
 
bool mdlListColumn_isSearchIgnoreCase (ListColumnCP pColumn)
 Determines whether the specified column has its Ignore Case attribute for searches. More...
 
StatusInt mdlListColumn_setSearchIgnoreCase (ListColumnP pColumn, bool bIgnoreCase)
 Sets the Ignore Case attribute for the specified column for searches. More...
 
bool mdlListColumn_hasSearchFunction (ListColumnCP pColumn)
 Determines if a column already has a search function. More...
 
StatusInt mdlListColumn_setFilterFunction (ListColumnP pColumn, ListColumnFilterFuncP filterFunc, MdlDescP ownerMD)
 Sets the function to call during a ListModel filter on the column index associated with this ListColumn. More...
 
StatusInt mdlListColumn_setCellDestroyFunction (ListColumnP pColumn, ListCellDestroyFuncP destroyFunc, MdlDescP ownerMD)
 Sets the function to call for each ListCell during an mdlListModel_destroy or mdlListRow_destroy call. More...
 
StatusInt mdlTreeModel_setNodeDestroyFunction (GuiTreeModelP pModel, TreeNodeDestroyFuncP destroyFunc, MdlDesc *ownerMD)
 Sets the function to call for each GuiTreeNode during an mdlTreeModel_destroy or mdlTreeNode_destroy call. More...
 
StatusInt mdlTreeColumn_setCellDestroyFunction (GuiTreeColumn *pColumn, TreeCellDestroyFuncP destroyFunc, MdlDesc *ownerMD)
 Sets the function to call for each GuiTreeCell during an mdlTreeModel_destroy or mdlTreeNode_destroy call. More...
 

Detailed Description

Function Documentation

int mdlListColumn_getId ( ListColumnCP  pColumn)

Returns the Id of a specified ListColumn.

Parameters
[in]pColumnpoints to the ListColumn.
Returns
The Id of a specified ListColumn, or ERROR if pColumn is invalid
See also
mdlListColumn_setId, mdlListModel_getColumnAtIndex
int mdlListColumn_getInfoFieldCount ( ListColumnCP  pColumn)

Returns the number of info fields for a specified ListColumn.

Parameters
[in]pColumnpoints to the ListColumn
Returns
The number of info fields for the specified ListColumn, or ERROR if pColumn is invalid.
See also
mdlListColumn_setInfoFieldCount, mdlListModel_getColumnAtIndex
WCharCP mdlListColumn_getName ( ListColumnCP  pColumn)

Get the name of the specified ListColumn.

Parameters
[in]pColumnis a pointer to the ListColumn from which the name is returned.
Returns
A pointer to the name string of the ListColumn.
See also
mdlListColumn_setName
int mdlListColumn_getSecondarySearchColumn ( ListColumnCP  pColumn)

Gets the secondary search column to search if an mdlListModel_search call finds no match.

Parameters
[in]pColumnpoints to the ListColumn
Returns
The index of the secondary search column, or ERROR if pColumn is invalid
See also
mdlListModel_search mdlListColumn_setSecondarySearchColumn
int mdlListColumn_getSecondarySortColumn ( ListColumnCP  pColumn)

Gets the index of the secondary sort column from the specified column.

The secondary sort column is used in the case that values are equal when sorting on the specified function.

Parameters
[in]pColumnspecified the column to get the secondary column index from.
Returns
An integer value indicating the index of the secondary sort column.
See also
mdlListColumn_setSearchFunction
bool mdlListColumn_hasSearchFunction ( ListColumnCP  pColumn)

Determines if a column already has a search function.

Parameters
[in]pColumnspecified the column to check for a search function.
Returns
A bool value indicating whether a column has a search function, true if it does, false otherwise.
See also
mdlListColumn_setSearchFunction
bool mdlListColumn_hasSortFunction ( ListColumnCP  pColumn)

Determines if a column already has a sort function.

Parameters
[in]pColumnspecified the column to check for a sort function.
Returns
A bool value indicating whether a column has a sort function, true if it does, false otherwise.
See also
mdlListColumn_setSortFunction
bool mdlListColumn_isSearchIgnoreCase ( ListColumnCP  pColumn)

Determines whether the specified column has its Ignore Case attribute for searches.

Parameters
[in]pColumnpoints to the ListColumn to process
Returns
true if the Ignore Case attribute for the column has been set, otherwise false.
See also
mdlListColumn_setSearchIgnoreCase
bool mdlListColumn_isSecondarySortAlwaysDirectional ( ListColumnCP  pColumn,
bool *  pAscending 
)

Determines whether the specified column has its Always Directional attribute for secondary column sorts is on, and the sort direction is the same as specified.

Parameters
[in]pColumnpoints to the ListColumn to process
[out]pAscendingthe sort direction
Returns
true if the Always Directional attribute for secondary column sorts is on, otherwise false.
See also
mdlListColumn_setSecondarySortAlwaysDirectional
bool mdlListColumn_isSortIgnoreCase ( ListColumnCP  pColumn)

Determines whether the specified column has its Ignore Case attribute for sorts set.

Parameters
[in]pColumnpoints to the ListColumn to process
Returns
true if the Ignore Case attribute for the column has been set, otherwise false.
See also
mdlListColumn_setSortIgnoreCase
int mdlListColumn_lexicographicSortFunc ( ListModelP  pListModel,
ListRowP  pRow1,
ListRowP  pRow2,
bool  ascending,
int  columnIndex 
)

A utility sorting function for lexicographic sorts.

Sorting is based on the display text of the column cells such that "level 9" is less than "level 11". Suitable for use with mdlListColumn_setSortFunction.

Parameters
[in]pListModelthe ListModel
[in]pRow1first row to consider
[in]pRow2second row to consider
[in]ascendingorder
[in]columnIndexcolumn to sort by
Returns
status
See also
mdlListColumn_setSortFunction
Remarks
This function is capable of sorting both multibyte and unicode display text.
StatusInt mdlListColumn_setCellDestroyFunction ( ListColumnP  pColumn,
ListCellDestroyFuncP  destroyFunc,
MdlDescP  ownerMD 
)

Sets the function to call for each ListCell during an mdlListModel_destroy or mdlListRow_destroy call.

This simply gives the called function a chance to destroy any user data attached to the cell.

Parameters
[in]pColumnpoints to the ListColumn
[in]destroyFuncA function pointer of the function to call for each ListCell during an mdlListModel_destroy or mdlListRow_destroy call
[in]ownerMDMdlDesc pointer of the MDL application that owns the destroy function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlListModel_destroy mdlListRow_destroy
StatusInt mdlListColumn_setFilterFunction ( ListColumnP  pColumn,
ListColumnFilterFuncP  filterFunc,
MdlDescP  ownerMD 
)

Sets the function to call during a ListModel filter on the column index associated with this ListColumn.

Parameters
[in]pColumnpoints to the ListColumn
[in]filterFuncA function pointer of the function to call when filtering on the column index of this ListColumn
[in]ownerMDMdlDesc pointer of the MDL application that owns the filter function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListModel_filter mdlListModel_getColumnAtIndex
StatusInt mdlListColumn_setId ( ListColumnP  pColumn,
int  id 
)

Sets the Id of a specified ListColumn.

Parameters
[in]pColumnpoints to the ListColumn
[in]idNew Id of ListColumn
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListColumn_getId, mdlListModel_getColumnAtIndex
StatusInt mdlListColumn_setInfoFieldCount ( ListColumnP  pColumn,
int  count 
)

Sets the number of info fields in a specified ListColumn.

Parameters
[in]pColumnpoints to the ListColumn
[in]countNew number of info fields in a ListColumn
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListColumn_getInfoFieldCount, mdlListModel_getColumnAtIndex
StatusInt mdlListColumn_setName ( ListColumnP  pColumn,
WCharCP  pwName 
)

Set the name string on the specified ListColumn.

Parameters
[in]pColumnpoints to the ListColumn to set the name on.
[in]pwNamespecifies the name to give the ListColumn.
Returns
SUCCESS if the operation is completed successfully.
See also
mdlListColumn_getName
StatusInt mdlListColumn_setSearchFunction ( ListColumnP  pColumn,
ListColumnSearchFuncP  searchFunc,
MdlDescP  ownerMD 
)

Sets the function to call during a ListModel search when searching on the column index associated with this ListColumn.

Parameters
[in]pColumnpoints to the ListColumn
[in]searchFuncA function pointer of the function to call when searching on the column index of this ListColumn
[in]ownerMDMdlDesc pointer of the MDL application that owns the search function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListModel_search mdlListModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
The application search function called during a ListModel search should have the following signature:
bool application_listModelSearchFunc
(
ListModelP pModel, // => The ListModel to process
MSValueDescr pValueDescr, // => Value of data to search for
// (if string, use value.charPFormat)
InfoField *pInfoFields, // => InfoFields to search for
ListRowP pRow, // => ListRow in question
int columnIndex // => columnIndex passed from
// mdlListModel_search
);
@code
Example: The following is an example of an application search function:
{
bool status=false;
MSValueDescr valueDescr;
ListCellP pCell;
pCell = mdlListRow_getCellAtIndex (pRow, columnIndex);
mdlListCell_getValue (pCell, valueDescr);
if (NULL != pCell)
{
if (pValueDescr->GetFormatType() == valueDescr.GetFormatType())
{
if ((pValueDescr->GetFormatType() == FMT_WCHAR &&
0 == wcscmp (pValueDescr->GetWCharCP(), valueDescr.GetWCharCP() ||
(pValueDescr->formatType == FMT_LONG &&
pValueDescr->value.sLongFormat == valueDescr.value.sLongFormat) ||
.
.
.
{
status = true;
}
}
else
{
// formatTypes not the same; if input STRING check against displayText
WCharCP pDisplay;
mdlListCell_getDisplayText (pCell, &pDisplay);
if (pValueDescr->GetFormatType() == FMT_WCHAR &&
NULL != pDisplay &&
0 == wcscmp (pValueDescr->GetWCharCP(), pDisplay))
{
status=true;
}
}
}
return status;
}
StatusInt mdlListColumn_setSearchIgnoreCase ( ListColumnP  pColumn,
bool  bIgnoreCase 
)

Sets the Ignore Case attribute for the specified column for searches.

Parameters
[in]pColumnpoints to the ListColumn to process
[in]bIgnoreCasetrue to ignore case, false to force case matching.
Returns
SUCCESS if the attribute is set successfully.
See also
mdlListColumn_isSearchIgnoreCase
int mdlListColumn_setSecondarySearchColumn ( ListColumnP  pColumn,
int  iSecondaryColumn 
)

Sets the secondary search column to search if an mdlListModel_search call finds no match.

Parameters
[in]pColumnpoints to the ListColumn
[in]iSecondaryColumnIndex of the secondary search column
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListModel_search mdlListColumn_getSecondarySearchColumn
int mdlListColumn_setSecondarySortAlwaysDirectional ( ListColumnP  pColumn,
bool  bAlwaysDirectional,
bool  bAscending 
)

Sets the Always Directional attribute for secondary column sorts.

Parameters
[in]pColumnpoints to the ListColumn to process
[in]bAlwaysDirectionaltrue secondary column sorts will always be in direction of bAscending, false secondary column sorts will be in the same direction as the primary column sort.
[in]bAscendingtrue for Ascending, or false for Descending.
Returns
SUCCESS if the attribute is set successfully.
See also
mdlListColumn_isSecondarySortAlwaysDirectional
StatusInt mdlListColumn_setSortFunction ( ListColumnP  pColumn,
ListColumnSortFuncP  sortFunc,
MdlDescP  ownerMD,
int  secondaryColumn 
)

Sets the function to call during a ListModel sort when sorting on the column index associated with this ListColumn.

Parameters
[in]pColumnpoints to the ListColumn.
[in]sortFuncA function pointer of the function to call when sorting on the column index of this ListColumn.
[in]ownerMDMdlDesc pointer of the MDL application that owns the sort function.
[in]secondaryColumnColumn index of the column to sort on if values are the same.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlListModel_sort mdlListModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
The application sort function called during a ListModel sort should have the following signature:
int application_listModelSortFunc
(
ListModel *pModel, // => The ListModel to process
ListRow *pRow1, // => ListRow to compare against pRow2
ListRow *pRow2, // => ListRow to compare against pRow1
bool ascending, // => ascending flag passed from mdlListModel_sort
int columnIndex // => columnIndex passed from mdlListModel_sort
);
The following is an example of an application sort function:
{
int status=0;
ListCellP pCell1, pCell2;
MSValueDescr value1, value2;
pCell1 = mdlListRow_getCellAtIndex ((ascending ? pRow1 : pRow2), columnIndex);
pCell2 = mdlListRow_getCellAtIndex ((ascending ? pRow2 : pRow1), columnIndex);
mdlListCell_getValue (pCell1, value1);
mdlListCell_getValue (pCell2, value2);
if (value1.GetFormatType() == value2.GetFormatType())
{
switch (value1.formatType)
{
case FMT_STRING:
{
status = wcscmp (value1.GetWCharCP(), value2.GetWCharCP());
break;
}
case FMT_LONG:
{
if (value1.GetLong() == value2.GetLong())
status = 0;
else if (value1.GetLong() < value2.GetLong())
status = -1;
else
status = 1;
break;
}
.
.
.
default:
{
WCharCP pDisplay1, pDisplay2;
mdlListCell_getDisplayText (pCell1, &pDisplay1);
mdlListCell_getDisplayText (pCell2, &pDisplay2);
if (NULL == pDisplay1 && NULL == pDisplay2)
status = 0;
else if (NULL == pDisplay1)
return 1;
else if (NULL == pDisplay2)
return -1;
else
status = wcscmp (pDisplay1, pDisplay2);
}
}
// If rows are equal, sort on the secondary column, if set
if (status == 0)
{
ListColumnP pColumn;
pColumn = mdlListModel_getColumnAtIndex (pModel, columnIndex);
if (NULL != pColumn)
{
int secondaryColumn;
secondaryColumn = mdlListColumn_getSecondarySortColumn (pColumn);
if (secondaryColumn != columnIndex)
{
// Call sort func recursively with secondary sort column
status = application_listModelSortFunc (pModel,
pRow1, pRow2, ascending, secondaryColumn);
}
}
}
}
return (status);
}
int mdlListColumn_setSortIgnoreCase ( ListColumnP  pColumn,
bool  bIgnoreCase 
)

Sets the Ignore Case attribute for the specified column for sorts.

Parameters
[in]pColumnpoints to the ListColumn to process
[in]bIgnoreCasetrue to ignore case, false to force case matching.
Returns
SUCCESS if the attribute is set successfully.
See also
mdlListColumn_isSortIgnoreCase
StatusInt mdlListModel_setRowDestroyFunction ( ListModel *  pModel,
ListRowDestroyFuncP  destroyFunc,
MdlDescP  ownerMD 
)

Sets the function to call for each ListRow during an mdlListModel_destroy or mdlListRow_destroy call.

This simply gives the called function a chance to destroy any user data attached to the row.

Parameters
[in]pModelpoints to the ListModel
[in]destroyFuncA function pointer of the function to call for each ListRow during an mdlListModel_destroy or mdlListRow_destroy call
[in]ownerMDMdlDesc pointer of the MDL application that owns the destroy function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlListModel_destroy mdlListRow_destroy
StatusInt mdlTreeColumn_setCellDestroyFunction ( GuiTreeColumn *  pColumn,
TreeCellDestroyFuncP  destroyFunc,
MdlDesc ownerMD 
)

Sets the function to call for each GuiTreeCell during an mdlTreeModel_destroy or mdlTreeNode_destroy call.

This simply gives the called function a chance to destroy any user data attached to the cell.

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]destroyFuncA function pointer of the function to call for each GuiTreeCell during an mdlTreeModel_destroy or mdlTreeNode_destroy call
[in]ownerMDMdlDescr pointer of the MDL application that owns the destroy function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlTreeModel_destroy mdlTreeNode_destroy
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeModel_setNodeDestroyFunction ( GuiTreeModelP  pModel,
TreeNodeDestroyFuncP  destroyFunc,
MdlDesc ownerMD 
)

Sets the function to call for each GuiTreeNode during an mdlTreeModel_destroy or mdlTreeNode_destroy call.

This simply gives the called function a chance to destroy any user data attached to the node.

Parameters
[in]pModelpoints to the GuiTreeModel
[in]destroyFuncA function pointer of the function to call for each GuiTreeNode during an mdlTreeModel_destroy or mdlTreeNode_destroy call
[in]ownerMDMdlDescr pointer of the MDL application that owns the destroy function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pModel is invalid
See also
mdlTreeModel_destroy mdlTreeNode_destroy
Remarks
Required Library: mdlbltin.lib

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