XmMultiList(3) | Library Functions Manual | XmMultiList(3) |
XmMultiList — The Multi-column List widget
#include <Xm/MultiList.h>
This widget contains a multi-column list with headers along the top and a search area along the bottom. The list has scrollbars along the right and bottom edges that allow vertical and horizontal scrolling both by column and by pixel. The portion of the list data that is currently visible can be altered by scrollbar actions, widget resource setting and the redisplay of the list data after a string search has been successful. The sorting of elements within a particular column is also supported. To sort the list by the elements in a given column, select the column's title.
To search for a particular string in the list, type the string value to be searched for in the list's associated text field and then press the "Find" pushbutton. The search for the string begins in the currently selected row, after the location of the previously searched for string, or at the first column and first row if there is no column selected. If the string is not found in that row, then the search continues through all rows after and then before, the currently selected row. If the string is found, the display of the list is adjusted to make the string visible. If the string was not found, or if the string is visible, the application will issue a warning beep.
Pointer button one allows the user to select a row or a column for sorting. The callbacks on the doubleClickCallback list are called when the user double clicks pointer button one. If the list data can contain a row pixmap to display at the extreme left of the row.
MultiList inherits behavior, resources, and traits from Core, Composite, Constraint, and XmManager.
The class pointer is xmMultiListWidgetClass.
The class name is XmMultiList.
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).
XmMultiList Resource Set | ||||
Name | Class | Type | Default | Access |
XmNcolumnTitles | XmCColumnTitles | XmString * | NULL | CSG |
XmNdoubleClickCallback | XmCCallback | XtCallbackList | NULL | C |
XmNentryData | XmCEntryData | XtPointer | NULL | CSG |
XmNfindLabel | XmCFindLabel | XmString | Find | CSG |
XmNfirstColumn | XmCFirstLocation | short | 0 | CSG |
XmNfirstColumnPixmaps | XmCFirstColumnPixmaps | Boolean | False | CSG |
XmNfirstRow | XmCFirstLocation | short | 0 | CSG |
XmNfontList | XmCFontList | XmFontList | dynamic | CSG |
XmNheight | XmCHeight | Dimension | 300 | CSG |
XmNnumColumns | XmCNumColumns | short | 0 | CSG |
XmNnumRows | XmCNumRows | short | 0 | CSG |
XmNselectedColumn | XmCSelectedColumn | short | 0 | CSG |
XmNselectionPolicy | XmCSelectionPolicy | unsigned char | XmEXTENDED_SELECT | CSG |
XmNshowFind | XmCShowFind | Boolean | True | CSG |
XmNsingleSelectionCallback | XmCCallback | XtCallbackList | NULL | CSG |
XmNsortFunctions | XmCFunction | XmMultiListSortFunction ** | NULL | CSG |
XmNtitle | XmCTitle | XmString | NULL | CSG |
XmNwidth | XmCWidth | Dimension | 300 | CSG |
The MultiList widget is composed of many simple widgets. In order to achieve full functionality of the Toolkit, it is sometimes desirable to set attribute values directly on those widgets. The widget ids of the sub-widgets can be obtained by using the XtNameToWidget() function provided by the Xt Intrinsics.
XmMultiList <named by application>
XmLabel title
XmScrollbar vertBar
XmScrollBar horizBar
XmFrame frame
XmPushButton find
XmText findText
The MultiList widget is actually a collection of pieces. It provides the geometry layout for the collection as well as tying together the pieces to form a consistent package. Many of the resources that are documented as being part of the MultiList widget are really part of the internal list sub-component. The MultiList widget will pass these values through to the proper child when they are set at time of creation or with XtSetValues or XtGetValues. However, when setting a resource via the resource database you must use either the name of the child or the general specification (*) rather than the specific one (.).
The XmMultiListRowInfo structure is used to contain the entryData associated with each Row in the List.
typedef struct { String * values; /* The array of column strings */ Pixmap pixmap; /* mini-icon pixmaps. */ Boolean selected; /* row selected. */ /* * Provided for the convenience of the application programmer */ short * sort_id; XtPointer data; /* * Private to the MultiList widget (do not modify these) */ short pix_width; /* of the pixmap. */ short pix_height; /* of the pixmap. */ short pix_depth; /* of the pixmap. */ Boolean old_sel_state; } XmMultiListRowInfo;
values This is an array of strings of length numColumns which represents the strings displayed in each column of this row. The data is allocated and maintained by the client. If firstColumnPixmaps is True, then value[0] is never referenced. pixmap This is the pixmap displayed to the left of this row. If firstColumnPixmaps is True then this value is never referenced and mayn remain unset. If no pixmap is desired for this row, even though firstColumnPixmaps is True, set the value of pixmap to None. Color pixmaps may be used. sort_id This is provided for the convenience of the client and is expected to be used as a sort index for this row. One value should be specified for each column of the row. See "sortFunctions" below for details. data This is provided for the convenience of the client and may be used for any purpose. It is intended to be used as an identifier for the object pointed to by this row
selected This value is True if this row is selected; may be set by the application.
Neither sort_id nor data are used by the MultiList widget; they exist solely for the convenience of the programmer.
XmManager Resource Set | ||||
Name | Class | Type | Default | Access |
XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNforeground | XmCForeground | Pixel | dynamic | CSG |
XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
XmNinitialFocus | XmCInitialFocus | Widget | dynamic | CSG |
XmNlayoutDirection | XmCLayoutDirection | XmDirection | dynamic | CG |
XmNnavigationType | XmCNavigationType | XmNavigationType | XmTAB_GROUP | CSG |
XmNpopupHandlerCallback | XmCCallback | XtCallbackList | NULL | C |
XmNshadowThickness | XmCShadowThickness | Dimension | dynamic | CSG |
XmNstringDirection | XmCStringDirection | XmStringDirection | dynamic | CG |
XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
XmNtraversalOn | XmCTraversalOn | Boolean | True | CSG |
XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
XmNuserData | XmCUserData | XtPointer | NULL | CSG |
Composite Resource Set | ||||
Name | Class | Type | Default | Access |
XmNchildren | XmCReadOnly | WidgetList | NULL | G |
XmNinsertPosition | XmCInsertPosition | XtOrderProc | NULL | CSG |
XmNnumChildren | XmCReadOnly | Cardinal | 0 | G |
Core Resource Set | ||||
Name | Class | Type | Default | Access |
XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | N/A |
XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G |
XmNbackground | XmCBackground | Pixel | dynamic | CSG |
XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG |
XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG |
XmNcolormap | XmCColormap | Colormap | dynamic | CG |
XmNdepth | XmCDepth | int | dynamic | CG |
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C |
XmNheight | XmCHeight | Dimension | dynamic | CSG |
XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C |
XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG |
XmNscreen | XmCScreen | Screen * | dynamic | CG |
XmNsensitive | XmCSensitive | Boolean | True | CSG |
XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG |
XmNwidth | XmCWidth | Dimension | dynamic | CSG |
XmNx | XmCPosition | Position | 0 | CSG |
XmNy | XmCPosition | Position | 0 | CSG |
The following are the default translation bindings used by the icon button:
~Ctrl ~Shift <Btn1Down>: | ButtonDown() |
Ctrl ~Shift <Btn1Down>: | ButtonDown(Toggle) |
~Ctrl Shift <Btn1Down>: | ButtonDown(Extend) |
Button1 <Motion>: | Motion() |
<Btn1Up>: | ButtonUpOrLeave() |
The following actions are supported by the MultiList:
All procedures on the MultiList's singleSelectionCallback and doubleClickCallback lists will have a pointer to a XmMultiListRowInfo structure passed to them in the call_data field. This structure is defined above.
Note: if a single SelectionCallback is registered on an MultiList in extended_select_mode, the value of call_data is undefined.
typedef int (XmMultiListSortFunction) (short column, XmMultiRowInfo * row1, XmMultiRowInfo * row2);
Composite(3), Constraint(3), Core(3), XmCreateMultiList(3), XmManager(3), XmMultiListDeselectAllItems(3), XmMultiListDeselectItem(3), XmMultiListDeselectItems(3), XmMultiListDeselectRow(3), XmMultiListGetSelectedRowArray(3), XmMultiListGetSelectedRows(3), XmMultiListMakeRowVisible(3), XmMultiListSelectAllItems(3), XmMultiListSelectItems(3), XmMultiListSelectRow(3), and XmMultiListToggleRow(3).
Copyright (c) 1992 by Integrated Computer Solutions, Inc.