Functions
TreeColumns

Functions

int mdlTreeColumn_getId (GuiTreeColumnP pColumn)
 Returns the Id of a specified GuiTreeColumn. More...
 
StatusInt mdlTreeColumn_setId (GuiTreeColumnP pColumn, int id)
 Sets the Id of a specified GuiTreeColumn columns. More...
 
WCharCP mdlTreeColumn_getName (GuiTreeColumnP pColumn)
 Get the name of the specified GuiTreeColumn. More...
 
StatusInt mdlTreeColumn_setName (GuiTreeColumnP pColumn, WCharCP pwName)
 Set the name string on the specified GuiTreeColumn. More...
 
int mdlTreeColumn_getInfoFieldCount (GuiTreeColumnP pColumn)
 Returns the number of info fields for a specified GuiTreeColumn. More...
 
StatusInt mdlTreeColumn_setInfoFieldCount (GuiTreeColumnP pColumn, int count)
 Sets the number of info fields in a specified GuiTreeColumn. More...
 
StatusInt mdlTreeColumn_setSortFunction (GuiTreeColumnP pColumn, TreeColumnSortFuncP sortFunc, MdlDesc *ownerMD, int secondaryColumn)
 Sets the function to call during a parent GuiTreeNode sort when sorting on the column index of this GuiTreeColumn. More...
 
bool mdlTreeColumn_hasSortFunction (GuiTreeColumnP pColumn)
 Determines if a column already has a sort function. More...
 
int mdlTreeColumn_getSecondarySortColumn (GuiTreeColumnP pColumn)
 Returns the secondary sort column for a specified GuiTreeColumn. More...
 
bool mdlTreeColumn_isSortIgnoreCase (GuiTreeColumnP pColumn)
 Determines whether the specified column has its Ignore Case attribute for sorts set. More...
 
int mdlTreeColumn_setSortIgnoreCase (GuiTreeColumnP pColumn, bool bIgnoreCase)
 Sets the Ignore Case attribute for the specified column for sorts. More...
 
bool mdlTreeColumn_isSecondarySortAlwaysDirectional (GuiTreeColumnP 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 mdlTreeColumn_setSecondarySortAlwaysDirectional (GuiTreeColumnP pColumn, bool bAlwaysDirectional, bool bAscending)
 Sets the Always Directional attribute for secondary column sorts. More...
 
StatusInt mdlTreeColumn_setSearchFunction (GuiTreeColumnP pColumn, TreeColumnSearchFuncP searchFunc, MdlDesc *ownerMD)
 Sets the function to call during a GuiTreeModel search when searching on the column index associated with this GuiTreeColumn. More...
 
int mdlTreeColumn_getSecondarySearchColumn (GuiTreeColumnP pColumn)
 Gets the secondary search column to search if an mdlTreeModel_search call finds no match. More...
 
int mdlTreeColumn_setSecondarySearchColumn (GuiTreeColumnP pColumn, int iSecondaryColumn)
 Sets the secondary search column to search if an mdlTreeModel_search call finds no match. More...
 
int mdlTreeColumn_isSearchIgnoreCase (GuiTreeColumnP pColumn)
 Determines whether the specified column has its Ignore Case attribute for searches. More...
 
int mdlTreeColumn_setSearchIgnoreCase (GuiTreeColumnP pColumn, bool bIgnoreCase)
 Sets the Ignore Case attribute for the specified column for searches. More...
 
bool mdlTreeColumn_hasSearchFunction (GuiTreeColumnP pColumn)
 Determines if a column already has a search function. More...
 

Detailed Description

Function Documentation

int mdlTreeColumn_getId ( GuiTreeColumnP  pColumn)

Returns the Id of a specified GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn
Returns
The Id of a specified GuiTreeColumn, or ERROR if pColumn is invalid.
See also
mdlTreeColumn_setId mdlTreeModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_getInfoFieldCount ( GuiTreeColumnP  pColumn)

Returns the number of info fields for a specified GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn
Returns
The number of info fields for the specified GuiTreeColumn, or ERROR if pColumn is invalid.
See also
mdlTreeColumn_getId mdlTreeModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
WCharCP mdlTreeColumn_getName ( GuiTreeColumnP  pColumn)

Get the name of the specified GuiTreeColumn.

Parameters
[in]pColumnis a pointer to the GuiTreeColumn from which the name is returned.
Returns
A pointer to the name string of the GuiTreeColumn.
See also
mdlTreeColumn_setName
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_getSecondarySearchColumn ( GuiTreeColumnP  pColumn)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn
Returns
The index of the secondary search column, or ERROR if pColumn is invalid
See also
mdlTreeModel_search mdlTreeColumn_setSecondarySearchColumn
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_getSecondarySortColumn ( GuiTreeColumnP  pColumn)

Returns the secondary sort column for a specified GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn
Returns
The secondary sort column for the specified GuiTreeColumn, or ERROR if pColumn is invalid
See also
mdlTreeColumn_setSortFunction mdlTreeModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
bool mdlTreeColumn_hasSearchFunction ( GuiTreeColumnP  pColumn)

Determines if a column already has a search function.

Parameters
[in]pColumnspecifies 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
mdlTreeColumn_setSearchFunction
Remarks
Required Library: mdlbltin.lib
bool mdlTreeColumn_hasSortFunction ( GuiTreeColumnP  pColumn)

Determines if a column already has a sort function.

Parameters
[in]pColumnspecified the column to check for a sort function.
Returns
true is the column has a sort function, false otherwise.
See also
mdlTreeColumn_setSortFunction
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_isSearchIgnoreCase ( GuiTreeColumnP  pColumn)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn to process
Returns
true if the Ignore Case attribute for the column has been set, otherwise false.
See also
mdlTreeColumn_setSearchIgnoreCase
Remarks
Required Library: mdlbltin.lib
bool mdlTreeColumn_isSecondarySortAlwaysDirectional ( GuiTreeColumnP  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 GuiTreeColumn to process
[out]pAscendingthe sort direction
Returns
true if the Always Directional attribute for secondary column sorts is on, otherwise false.
See also
mdlTreeColumn_setSecondarySortAlwaysDirectional
Remarks
Required Library: mdlbltin.lib
bool mdlTreeColumn_isSortIgnoreCase ( GuiTreeColumnP  pColumn)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn to process
Returns
true if the Ignore Case attribute for the column has been set, otherwise false.
See also
mdlTreeColumn_setSortIgnoreCase
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeColumn_setId ( GuiTreeColumnP  pColumn,
int  id 
)

Sets the Id of a specified GuiTreeColumn columns.

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]idNew Id of GuiTreeColumn
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlTreeModel_destroy
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeColumn_setInfoFieldCount ( GuiTreeColumnP  pColumn,
int  count 
)

Sets the number of info fields in a specified GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]countNew number of info fields in a GuiTreeColumn.
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlTreeColumn_getInfoFieldCount mdlTreeModel_getColumnAtIndex
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeColumn_setName ( GuiTreeColumnP  pColumn,
WCharCP  pwName 
)

Set the name string on the specified GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn to set the name on.
[in]pwNamespecifies the name to give the GuiTreeColumn.
Returns
SUCCESS if the operation is completed successfully.
See also
mdlTreeColumn_getName
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeColumn_setSearchFunction ( GuiTreeColumnP  pColumn,
TreeColumnSearchFuncP  searchFunc,
MdlDesc ownerMD 
)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]searchFuncA function pointer of the function to call when searching on the column index of this GuiTreeColumn
[in]ownerMDMdlDescr pointer of the MDL application that owns the search function
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlTreeModel_search, mdlTreeModel_getColumnAtIndex
Remarks
The application search function called during a GuiTreeNode search should have the following format:
bool application_treeNodeSearchFunc
(
GuiTreeNodeP pParentNode, // The ParentNode whose children are being sorted
MSValueDescrCP pValueDescr, // Value of data to search for
InfoField *pInfoFields, // InfoFields to search for
GuiTreeNodeP pNode, // GuiTreeNode to test
int columnIndex // columnIndex passed from mdlTreeNode_search
);
Example: The following is an example of an application search function:
{
bool status=false;
MSValueDescr valueDescr;
GuiTreeCellP pCell;
pCell = mdlTreeNode_getCellAtIndex (pNode, columnIndex);
mdlTreeCell_getValue (pCell, valueDescr);
if (NULL != pCell)
{
if (pValueDescr->formatType == valueDescr.formatType)
{
if ((pValueDescr->formatType == FMT_STRING &&
0 == strcmp (pValueDescr->value.charPFormat, valueDescr.value.charPFormat)) ||
(pValueDescr->formatType == FMT_LONG &&
pValueDescr->value.sLongFormat == valueDescr.value.sLongFormat) ||
.
.
.
{
status = true;
}
}
// formatTypes not the same; if input STRING check against displayText
else
{
char *pDisplay;
mdlTreeCell_getDisplayText (pCell, &pDisplay);
if (pValueDescr->formatType == FMT_STRING &&
NULL != pDisplay &&
0 == strcmp (pValueDescr->value.charPFormat, pDisplay))
{
status=true;
}
}
return status;
}
Required Library: mdlbltin.lib
int mdlTreeColumn_setSearchIgnoreCase ( GuiTreeColumnP  pColumn,
bool  bIgnoreCase 
)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn to process
[in]bIgnoreCasetrue to ignore case, false to force case matching.
Returns
SUCCESS if the attribute is set successfully.
See also
mdlTreeColumn_isSearchIgnoreCase
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_setSecondarySearchColumn ( GuiTreeColumnP  pColumn,
int  iSecondaryColumn 
)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]iSecondaryColumnIndex of the secondary search column
Returns
SUCCESS, or MDLERR_ADDRNOTVALID if pColumn is invalid
See also
mdlTreeModel_search mdlTreeColumn_getSecondarySearchColumn
Remarks
Required Library: mdlbltin.lib
int mdlTreeColumn_setSecondarySortAlwaysDirectional ( GuiTreeColumnP  pColumn,
bool  bAlwaysDirectional,
bool  bAscending 
)

Sets the Always Directional attribute for secondary column sorts.

Parameters
[in]pColumnpoints to the GuiTreeColumn 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
mdlTreeColumn_isSecondarySortAlwaysDirectional
Remarks
Required Library: mdlbltin.lib
StatusInt mdlTreeColumn_setSortFunction ( GuiTreeColumnP  pColumn,
TreeColumnSortFuncP  sortFunc,
MdlDesc ownerMD,
int  secondaryColumn 
)

Sets the function to call during a parent GuiTreeNode sort when sorting on the column index of this GuiTreeColumn.

Parameters
[in]pColumnpoints to the GuiTreeColumn
[in]sortFuncA function pointer of the function to call when sorting on the column index of this GuiTreeColumn
[in]ownerMDMdlDescr 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
mdlTreeNode_sort mdlTreeModel_getColumnAtIndex
Remarks
The application sort function called during a GuiTreeNode sort should have the following format:
int application_treeNodeSortFunc
(
GuiTreeNode *pParentNode, // The ParentNode
GuiTreeNode *pNode1, // GuiTreeNode to compare with pNode2
GuiTreeNode *pNode2, // GuiTreeNode to compare with pNode1
bool ascending, // flag from mdlTreeNode_sort
int columnIndex // columnIndex from mdlTreeNode_sort
);
Example: The following is an example of an application sort function:
{
int status=0;
GuiTreeCellP pCell1, pCell2;
int formatType;
MSValueDescr value1, value2;
pCell1 = mdlTreeNode_getCellAtIndex ((ascending ? pNode1 : pNode2), columnIndex);
pCell2 = mdlTreeNode_getCellAtIndex ((ascending ? pNode2 : pNode1), columnIndex);
mdlTreeCell_getValue (pCell1, value1);
mdlTreeCell_getValue (pCell2, value2);
if (value1.formatType == value2.formatType)
{
switch (value1.formatType)
{
case FMT_STRING:
{
status = strcmp (value1.value.charPFormat,
value2.value.charPFormat);
break;
}
case FMT_LONG:
{
if (value1.value.sLongFormat == value2.value.sLongFormat)
status = 0;
else if (value1.value.sLongFormat <
value2.value.sLongFormat)
status = -1;
else
status = 1;
break;
}
.
.
.
default:
{
char *pDisplay1, *pDisplay2;
mdlTreeCell_getDisplayText (pCell1, &pDisplay1);
mdlTreeCell_getDisplayText (pCell2, &pDisplay2);
if (NULL == pDisplay1 && NULL == pDisplay2)
status = 0;
else if (NULL == pDisplay1)
return 1;
else if (NULL == pDisplay2)
return -1;
else
status = strcmp (pDisplay1, pDisplay2);
}
}
// If rows are equal, sort on the secondary column, if set
if (status == 0)
{
GuiTreeModelP pModel;
GuiTreeColumnP pColumn;
PModel = mdlTreeNode_getModel (pParentNode);
pColumn = mdlTreeModel_getColumnAtIndex (pModel, columnIndex);
if (NULL != pColumn)
{
int secondaryColumn;
secondaryColumn = mdlTreeColumn_getSecondarySortColumn (pColumn);
if (secondaryColumn != columnIndex)
{
// Call sort func recursively with secondary sort column
status = application_treeNodeSortFunc (pParentNode,
pNode1, pNode2, ascending, secondaryColumn);
}
}
}
}
return (status);
}
Required Library: mdlbltin.lib
int mdlTreeColumn_setSortIgnoreCase ( GuiTreeColumnP  pColumn,
bool  bIgnoreCase 
)

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

Parameters
[in]pColumnpoints to the GuiTreeColumn to process
[in]bIgnoreCasetrue to ignore case, false to force case matching.
Returns
SUCCESS if the attribute is set successfully.
See also
mdlTreeColumn_isSortIgnoreCase
Remarks
Required Library: mdlbltin.lib

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