3D PLM Enterprise Architecture |
User Interface - Dialogs |
CATDlgMultiListSelect one or several compound items in a list |
Quick Reference |
CATDialog | +---CATDlgControl | +---CATDlgMultiList
The multiple list allows the end user to select one or several compound items among a discrete list of predefined compound items. The values are generally character strings. Scrollbars are added if the list is longer or wider than the list display area. The selected value(s) is (are) highlighted. The end user cannot enter values and can only select among those proposed. |
Use multiple list whenever you propose to the end user to select compound items from a predefined list.
Name | Description |
---|---|
default | A single compound item can be selected. |
CATDlgLstMultisel | Several compound items can be selected using the Shift and Ctrl keys. |
[Top]
[Top]
The multiple list is dedicated to selection.
[Top]
These following kinds of multiple list can be constructed.
default |
_pMultiList = new CATDlgMultiList (iParent, iName); |
Multiselection |
_pMMultiList = new CATDlgMultiList (iParent, iName, CATDlgListMultisel); |
[Top]
You can do the following to manage the lines displayed in a multiple list:
int NumberOfLines; NumberOfLines = _pMultiList->GetLineCount(); |
int NumberOfColumns; NumberOfColumns = _pMultiList->GetColumnCount (); |
int iNumberOfColumns = 5; CATUnicodeString _iColumnTitles[5]; ColumnTitles[0] = ... ... _pMultiList->SetColumnTitles(iNumberOfColumns,_iColumnTitles); |
get the contents of a cell |
CATUnicodeString oCellContents; int iRowNumber = 3; int iColumnNumber = 2; _pMultiList->GetColumnItem(iColumnNumber, oCellContents, iRowNumber); ... |
and modify it with another contents |
CATUnicodeString iCellContents; iCellContents = ... int RowIndex; // index of the updated row RowIndex = _pMultiList->SetColumnItem(iColumnNumber, iCellContents, iRowNumber, CATDlgDataModify); |
Two modes are available: CATDlgDataAdd to add a row and set the contents of its iColumnNumberth cell, which is the default, and CATDlgDataModify to modify the iColumnNumberth cell contents in the iRowNumberth existing row. If iRowNumber is omitted or set to -1, the row is appended to the list. The returned value is the number of the added or modified row. You can also set or modify a group of contiguous cells in the same column:
modify 5 cells in column 2 starting from row 3 |
CATUnicodeString _iCellContents[5] _iCellContents[0] = ... ... int iSize = 5 int iRowNumber =2; int iRowNumber = 3; int FirstRowIndex; FirstRowIndex = _pMultiList->SetColumnItems(iColumnNumber, _iCellContents, iSize, iRowNumber, CATDlgDataModify); |
The value returned is the index of the first row modified or added. If iRowNumber is omitted or set to -1, the rows are appended to the list.
int _iNewNumberArray [5] = { 5, 4, 3, 2, 1 }; int iArraySize = 5; int iFirstColumn = 1; _pMultiList->ReorderColumns(_iNewNumberArray, iArraySize, iFirstColumn); |
This example inverts the five first columns.
delete row 5 |
int iRowNumber = 5; _pMultiList->ClearLine(iRowNumber); |
delete rows 1,3,6 |
int iRowNum[3] = { 1,3,6 }; int iRowNumSize=3; _pMultiList->ClearLine(iRowNum, iRowNumSize); |
delete all rows |
_pMultiList->ClearLine(); |
[Top]
You can manage the line display with the following methods:
set number of visible char |
int NumberOfVisibleChar = 20; _pMultiList->SetVisibleTextWidth(NumberOfVisibleChar); |
get number of visible char |
... NumberOfVisibleChar = _pMultiList->GetVisibleTextWidth(); |
The value returned by the method GetVisibleTextWidth makes sense only if it has been set by the method SetVisibleTextWidth. The method SetVisibleTextWidth is taken into account only if the method SetVisibleColumnCount is not used.
get visible column width |
int ColumnTextWidth; ColumnTextWidth = _pMultiList->GetColumnTextWidth(); ... |
set visible column width |
ColumnTextWidth = 10; _pMultiList->GetColumnTextWidth(ColumnTextWidth) |
get the number of visible rows |
int NumberOfVisibleRows; NumberOfVisibleRows = _pMultiList->GetVisibleLineCount(); ... |
set the number of visible rows |
NumberOfVisibleRows = 10; _pMultiList->SetVisibleLineCount(NumberOfVisibleRows); |
get 1st line position |
int NumberOfVisibleColumns; NumberOfVisibleColumns = _pMultiList->GetVisibleColumnCount(); |
set number of visible columns |
... NumberOfVisibleColumns = 5; _pMultiList->SetVisibleColumnCount(NumberOfVisibleColumns); |
get 1st visible row position |
int FirstRow; FirstRow = _pMultiList->GetFirstLine(); |
set 1st visible row position |
... FirstRow = 3; _pMultiList->SetFirstLine(FirstRow); |
set column 2 visible |
int iColumnNumber = 2; _pyMultiList->SetColumnVisibility(iColumnNumber, CATDlgShow); |
query column 3 visibility |
... iColumnNumber = 3; if (_pyMultiList->GetColumnVisibility(iColumnNumber) == CATDlgHidden) ... |
_pyMultiList->Synchronize(_iMultiListToSynchronize); |
[Top]
To help manage the selection in the list displayed, you can use the following methods:
int NumberOfRowsSelected; NumberOfRowsSelected= _pMultiList->GetSelectCount(); |
get selected rows as a table of int |
int _oSelectedRows[10]; int oArraySize; int NumberOfSelectedRows; NumberOfSelectedRows = _pMultiList->GetSelect( _oSelectedRows, oArraySize); |
or as a table of CATUnicodeString |
... CATUnicodeString _oSelectedRows[10]; NumberOfSelectedRows = _pMultiList->GetSelect(_oSelectedRows, oArraySize); |
Pay attention to properly allocate and deallocate the tables.
set selected rows as a table of int |
int _iSelectedRows[10]; int iArraySize = 10; int iNotify = 1; int NumberOfSelectedRows; NumberOfSelectedRows = _pMultiList->SetSelect( _iSelectedRows, iArraySize, iNotify); ... |
or as a table of CATUnicodeString |
CATUnicodeString * iContentsOfSelectedLines[10]; iContentsOfSelectedLines[0] = ... int iColumnNumber; NumberOfSelectedRows = _pMultiList->SetSelect(iColumnNumber, iContentsOfSelectedLines, iArraySize, iNotify); |
The lines with the line numbers contained in iNumberOfSe-lectedLines or
with the contents contained in Set the parameter iNotify
to a
non null value if you want the corresponding notification to be sent.
Otherwise set to 0, no notification is sent.
_pMultiList->ClearSelect(); |
query whether a row is selected given its number |
CATBool RowIsSelected; int RowNumber = 5; RowIsSelected= _pMultiList->IsSelect(RowNumber ); ... |
or its contents |
CATUnicodeString RowContents; RowContents = ...; int ColumnNumber; RowIsSelected = _pMultiList->IsSelect(ColumnNumber, RowContents); |
A CATBool is a short.
set column 2 sensitive |
int ColumnNumber = 2; _pMultiList->SetColumnSensitivity(ColumnNumber, CATDlgEnable); ... |
query column 3 sensitivity |
ColumnNumber = 3; if (_pMultiList->IsSetColumnSensitivity(ColumnNumber) == CATDlgDisable) ... |
int RowNumber; RowNumber= _pMultiList->GetContextualLine(); |
[Top]
Set a callback on a multiple list to be informed whenever the end user selects a line as follows:
AddAnalyseNotificationCB(
_pMultiList, // multiple list
_pMultiList->
|
[Top]
The multiple list title should be set by the resource file using a key built with the identifier you declare as the second parameter of the multiple list constructor. This title is never displayed. If you want to comment the choices available from the multiple list in your dialog, use a label. In addition, each column in a multiple list can have a title. Refer to Managing the Line Content.
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.