1XmMultiList(3x) XmMultiList(3x)
2
3
4
6 XmMultiList — The Multi-column List widget
7
9 #include <Xm/MultiList.h>
10
12 This widget contains a multi-column list with headers along the top and
13 a search area along the bottom. The list has scrollbars along the right
14 and bottom edges that allow vertical and horizontal scrolling both by
15 column and by pixel. The portion of the list data that is currently
16 visible can be altered by scrollbar actions, widget resource setting
17 and the redisplay of the list data after a string search has been suc‐
18 cessful. The sorting of elements within a particular column is also
19 supported. To sort the list by the elements in a given column, select
20 the column's title.
21
22 To search for a particular string in the list, type the string value to
23 be searched for in the list's associated text field and then press the
24 "Find" pushbutton. The search for the string begins in the currently
25 selected row, after the location of the previously searched for string,
26 or at the first column and first row if there is no column selected.
27 If the string is not found in that row, then the search continues
28 through all rows after and then before, the currently selected row. If
29 the string is found, the display of the list is adjusted to make the
30 string visible. If the string was not found, or if the string is visi‐
31 ble, the application will issue a warning beep.
32
33 Pointer button one allows the user to select a row or a column for
34 sorting. The callbacks on the doubleClickCallback list are called when
35 the user double clicks pointer button one. If the list data can contain
36 a row pixmap to display at the extreme left of the row.
37
38 Classes
39 MultiList inherits behavior, resources, and traits from Core, Compos‐
40 ite, Constraint, and XmManager.
41
42 The class pointer is xmMultiListWidgetClass.
43
44 The class name is XmMultiList.
45
46 New Resources
47 The following table defines a set of widget resources used by the pro‐
48 grammer to specify data. The programmer can also set the resource val‐
49 ues for the inherited classes to set attributes for this widget. To
50 reference a resource by name or by class in a .Xdefaults file, remove
51 the XmN or XmC prefix and use the remaining letters. To specify one of
52 the defined values for a resource in a .Xdefaults file, remove the Xm
53 prefix and use the remaining letters (in either lowercase or uppercase,
54 but include any underscores between words). The codes in the access
55 column indicate if the given resource can be set at creation time (C),
56 set by using XtSetValues (S), retrieved by using XtGetValues (G), or is
57 not applicable (N/A).
58
59 ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
60 │ │ XmMultiLi│st Resource Set │ │ │
61 │Name │ Class │ Type │ Default │ Access │
62 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
63 │XmNcolumnTitles │ XmCColumnTitles │ XmString * │ NULL │ CSG │
64 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
65 │XmNdoubleClickCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
66 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
67 │XmNentryData │ XmCEntryData │ XtPointer │ NULL │ CSG │
68 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
69 │XmNfindLabel │ XmCFindLabel │ XmString │ Find │ CSG │
70 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
71 │XmNfirstColumn │ XmCFirstLocation │ short │ 0 │ CSG │
72 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
73 │XmNfirstColumnPixmaps │ XmCFirstColumnPixmaps │ Boolean │ False │ CSG │
74 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
75 │XmNfirstRow │ XmCFirstLocation │ short │ 0 │ CSG │
76 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
77 │XmNfontList │ XmCFontList │ XmFontList │ dynamic │ CSG │
78 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
79 │XmNheight │ XmCHeight │ Dimension │ 300 │ CSG │
80 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
81 │XmNnumColumns │ XmCNumColumns │ short │ 0 │ CSG │
82 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
83 │XmNnumRows │ XmCNumRows │ short │ 0 │ CSG │
84 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
85 │XmNselectedColumn │ XmCSelectedColumn │ short │ 0 │ CSG │
86 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
87 │XmNselectionPolicy │ XmCSelectionPolicy │ unsigned char │ XmEXTENDED_SELECT │ CSG │
88 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
89 │XmNshowFind │ XmCShowFind │ Boolean │ True │ CSG │
90 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
91 │XmNsingleSelectionCallback │ XmCCallback │ XtCallbackList │ NULL │ CSG │
92 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
93 │XmNsortFunctions │ XmCFunction │ XmMultiListSortFunction ** │ NULL │ CSG │
94 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
95 │XmNtitle │ XmCTitle │ XmString │ NULL │ CSG │
96 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
97 │XmNwidth │ XmCWidth │ Dimension │ 300 │ CSG │
98 ├───────────────────────────┼───────────────────────┼────────────────────────────┼───────────────────┼────────┤
99 └───────────────────────────┴───────────────────────┴────────────────────────────┴───────────────────┴────────┘
100 XmNcolumnTitles
101 This is an array of length numColumns of strings displayed at
102 the top of each column. The data is allocated and maintained
103 by the client.
104
105 XmNdoubleClickCallback
106 All routines in this list will be called whenever the user
107 double clicks on a row in the list.
108
109 XmNentryData
110 This resource is the data associated with each row in the
111 list. The data is an array of XmMultiListRowInfo structures
112 of length numRows allocated by the client. The data is allo‐
113 cated and maintained by the client. The XmMultiListRowInfo
114 structure is defined below.
115
116 XmNfindLabel
117 The label to be shown on the find button.
118
119 XmNfirstColumn
120 This resource allows the client to adjust the current view of
121 the list data to have a new top left column location. When
122 setting this resource, firstRow should also be updated.
123
124 XmNfirstColumnPixmaps
125 This resource specifies that the pixmap stored in the row
126 info structure should be used instead of XmMultiListRowInfo
127 values[0]. If pixmaps are present, the rows may be dragged by
128 pressing on the pixmap with pointer button three. If this
129 resource is True, then values[0] is never referenced. If
130 False, then the XmMultiListRowInfo data pixmap is never ref‐
131 erenced.
132
133 XmNfirstRow
134 This resource allows the client to adjust the current view of
135 the list data to have a new top left row location. When set‐
136 ting this resource, firstColumn should also be updated.
137
138 XmNfontList
139 This is an OSF/Motif style font list. The first font in this
140 list will be used to display all text in the MultiList wid‐
141 get. The MultiList widget currently supports only one font.
142
143 XmNheight This is the overall height value assigned to the MultiList
144 widget. Modifying this resource will affect scrollbar size
145 and location.
146
147 XmNnumColumns
148
149 XmNnumRows
150 These resources specify the number of columns and rows the
151 widget expects to display. These resources are used as the
152 maximum indices for many of the other resources in this wid‐
153 get. Care should be taken when modifying these resources to
154 ensure that the other values have also been modified.
155
156 XmNselectedColumn
157 This is the index of the currently selected column. This also
158 the column by which the list is being sorted.
159
160 XmNselectionPolicy
161 Defines the interpretation of the select action. This
162 resource can have the values XmSINGLE_SELECT or XmEX‐
163 TENDED_SELECT. Other values result in undefined behavior.
164
165 XmNshowFind
166 This boolean manages and unmanages the find button
167
168 XmNsingleSelectionCallback
169 All routines in this list will be called whenever the user
170 clicks on a line in the list. A pointer to the XmMulti‐
171 ListRowInfo structure corresponding to the line selected is
172 passed as call_data. If in extended select mode the value of
173 call_data is undefined.
174
175 XmNsortFunctions
176 This is an array of functions, one for each column, called to
177 determine the ordering of the rows in the column, similar to
178 qsort.
179
180 XmNtitle This is the title that is displayed at the top of the Multi‐
181 List widget. If this value is NULL, the title area will not
182 be shown.
183
184 XmNwidth This is the overall width value assigned to the MultiList
185 widget. Modifying this resource will affect scrollbar size
186 and location.
187
188 Specifying Children Resources
189 The MultiList widget is composed of many simple widgets. In order to
190 achieve full functionality of the Toolkit, it is sometimes desirable to
191 set attribute values directly on those widgets. The widget ids of the
192 sub-widgets can be obtained by using the XtNameToWidget() function pro‐
193 vided by the Xt Intrinsics.
194
195 XmMultiList <named by application>
196
197 XmLabel title
198
199 XmScrollbar vertBar
200
201 XmScrollBar horizBar
202
203 XmFrame frame
204
205 XmPushButton find
206
207 XmText findText
208
209
210 Using the Resource Database
211 The MultiList widget is actually a collection of pieces. It provides
212 the geometry layout for the collection as well as tying together the
213 pieces to form a consistent package. Many of the resources that are
214 documented as being part of the MultiList widget are really part of the
215 internal list sub-component. The MultiList widget will pass these val‐
216 ues through to the proper child when they are set at time of creation
217 or with XtSetValues or XtGetValues. However, when setting a resource
218 via the resource database you must use either the name of the child or
219 the general specification (*) rather than the specific one (.).
220
221 The XmMultiListRowInfo Structure
222 The XmMultiListRowInfo structure is used to contain the entryData asso‐
223 ciated with each Row in the List.
224
225 typedef struct {
226
227 String * values; /* The array of column strings */
228 Pixmap pixmap; /* mini-icon pixmaps. */
229 Boolean selected; /* row selected. */
230
231 /*
232 * Provided for the convenience of the application programmer
233 */
234
235 short * sort_id;
236 XtPointer data;
237
238 /*
239 * Private to the MultiList widget (do not modify these)
240 */
241
242 short pix_width; /* of the pixmap. */
243 short pix_height; /* of the pixmap. */
244 short pix_depth; /* of the pixmap. */
245
246 Boolean old_sel_state;
247
248 } XmMultiListRowInfo;
249
250 values This is an array of strings of length num‐
251 Columns which represents the strings displayed in each column of this
252 row. The data is allocated and maintained by the client. If firstColum‐
253 nPixmaps is True, then value[0] is never referenced.
254 pixmap This is the pixmap displayed to the left of
255 this row. If firstColumnPixmaps is True then this value is never refer‐
256 enced and mayn remain unset. If no pixmap is desired for this row, even
257 though firstColumnPixmaps is True, set the value of pixmap to None.
258 Color pixmaps may be used. sort_id This is provided
259 for the convenience of the client and is expected to be used as a sort
260 index for this row. One value should be specified for each column of
261 the row. See "sortFunctions" below for details.
262 data This is provided for the convenience of the
263 client and may be used for any purpose. It is intended to be used as an
264 identifier for the object pointed to by this row
265
266 selected This value is True if this row is selected;
267 may be set by the application.
268
269 Neither sort_id nor data are used by the MultiList widget; they exist
270 solely for the convenience of the programmer.
271
272 ┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
273 │ │ XmManager │Resource Set │ │ │
274 │Name │ Class │ Type │ Default │ Access │
275 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
276 │XmNbottomShadowColor │ XmCBottomShadowColor │ Pixel │ dynamic │ CSG │
277 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
278 │XmNbottomShadowPixmap │ XmCBottomShadowPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
279 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
280 │XmNforeground │ XmCForeground │ Pixel │ dynamic │ CSG │
281 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
282 │XmNhelpCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
283 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
284 │XmNhighlightColor │ XmCHighlightColor │ Pixel │ dynamic │ CSG │
285 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
286 │XmNhighlightPixmap │ XmCHighlightPixmap │ Pixmap │ dynamic │ CSG │
287 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
288 │XmNinitialFocus │ XmCInitialFocus │ Widget │ dynamic │ CSG │
289 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
290 │XmNlayoutDirection │ XmCLayoutDirection │ XmDirection │ dynamic │ CG │
291 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
292 │XmNnavigationType │ XmCNavigationType │ XmNavigationType │ XmTAB_GROUP │ CSG │
293 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
294 │XmNpopupHandlerCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
295 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
296 │XmNshadowThickness │ XmCShadowThickness │ Dimension │ dynamic │ CSG │
297 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
298 │XmNstringDirection │ XmCStringDirection │ XmStringDirection │ dynamic │ CG │
299 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
300 │XmNtopShadowColor │ XmCTopShadowColor │ Pixel │ dynamic │ CSG │
301 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
302 │XmNtopShadowPixmap │ XmCTopShadowPixmap │ Pixmap │ dynamic │ CSG │
303 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
304 │XmNtraversalOn │ XmCTraversalOn │ Boolean │ True │ CSG │
305 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
306 │XmNunitType │ XmCUnitType │ unsigned char │ dynamic │ CSG │
307 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
308 │XmNuserData │ XmCUserData │ XtPointer │ NULL │ CSG │
309 ├────────────────────────┼───────────────────────┼───────────────────┼──────────────────────┼────────┤
310 └────────────────────────┴───────────────────────┴───────────────────┴──────────────────────┴────────┘
311 ┌───────────────────────────────────────────────────────────────────────┐
312 │ │ Composite Reso│urce Set │ │ │
313 │Name │ Class │ Type │ Default │ Access │
314 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
315 │XmNchildren │ XmCReadOnly │ WidgetList │ NULL │ G │
316 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
317 │XmNinsertPosition │ XmCInsertPosition │ XtOrderProc │ NULL │ CSG │
318 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
319 │XmNnumChildren │ XmCReadOnly │ Cardinal │ 0 │ G │
320 ├──────────────────┼───────────────────┼─────────────┼─────────┼────────┤
321 └──────────────────┴───────────────────┴─────────────┴─────────┴────────┘
322 ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
323 │ │ Core Resource Se│t │ │ │
324 │Name │ Class │ Type │ Default │ Access │
325 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
326 │XmNaccelerators │ XmCAccelerators │ XtAccelerators │ dynamic │ N/A │
327 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
328 │XmNancestorSensitive │ XmCSensitive │ Boolean │ dynamic │ G │
329 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
330 │XmNbackground │ XmCBackground │ Pixel │ dynamic │ CSG │
331 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
332 │XmNbackgroundPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
333 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
334 │XmNborderColor │ XmCBorderColor │ Pixel │ XtDefaultForeground │ CSG │
335 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
336 │XmNborderPixmap │ XmCPixmap │ Pixmap │ XmUNSPECIFIED_PIXMAP │ CSG │
337 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
338 │XmNborderWidth │ XmCBorderWidth │ Dimension │ 0 │ CSG │
339 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
340 │XmNcolormap │ XmCColormap │ Colormap │ dynamic │ CG │
341 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
342 │XmNdepth │ XmCDepth │ int │ dynamic │ CG │
343 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
344 │XmNdestroyCallback │ XmCCallback │ XtCallbackList │ NULL │ C │
345 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
346 │XmNheight │ XmCHeight │ Dimension │ dynamic │ CSG │
347 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
348 │XmNinitialResourcesPersistent │ XmCInitialResourcesPersistent │ Boolean │ True │ C │
349 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
350 │XmNmappedWhenManaged │ XmCMappedWhenManaged │ Boolean │ True │ CSG │
351 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
352 │XmNscreen │ XmCScreen │ Screen * │ dynamic │ CG │
353 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
354 │XmNsensitive │ XmCSensitive │ Boolean │ True │ CSG │
355 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
356 │XmNtranslations │ XmCTranslations │ XtTranslations │ dynamic │ CSG │
357 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
358 │XmNwidth │ XmCWidth │ Dimension │ dynamic │ CSG │
359 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
360 │XmNx │ XmCPosition │ Position │ 0 │ CSG │
361 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
362 │XmNy │ XmCPosition │ Position │ 0 │ CSG │
363 ├──────────────────────────────┼───────────────────────────────┼────────────────┼──────────────────────┼────────┤
364 └──────────────────────────────┴───────────────────────────────┴────────────────┴──────────────────────┴────────┘
365 Translations
366 The following are the default translation bindings used by the icon
367 button:
368
369 ~Ctrl ~Shift <Btn1Down>: ButtonDown()
370 Ctrl ~Shift <Btn1Down>: ButtonDown(Toggle)
371 ~Ctrl Shift <Btn1Down>: ButtonDown(Extend)
372 Button1 <Motion>: Motion()
373 <Btn1Up>: ButtonUpOrLeave()
374
375 The following actions are supported by the MultiList:
376
377 ButtonDown(type)
378 Processes a button press action that may begin with
379 either a select or a double click. The type argument
380 can be either Toggle or Extend. These values determine
381 which mode of an extended select will be initiated on
382 this button event. Consult the OSF/Motif Style Guide
383 for details.
384
385 Motion() Processes motion events to allow the selection region
386 to be modified when in extended selection mode. It is
387 assumed that this action is called between a Button‐
388 Down() and ButtonUpOrLeave() action.
389
390 ButtonUpOrLeave()
391 Cleans up after ButtonDown() and Motion().
392
394 All procedures on the MultiList's singleSelectionCallback and dou‐
395 bleClickCallback lists will have a pointer to a XmMultiListRowInfo
396 structure passed to them in the call_data field. This structure is
397 defined above.
398
399 Note: if a single SelectionCallback is registered on an MultiList in
400 extended_select_mode, the value of call_data is undefined.
401
402 void (callback)(Widget w, XtPointer client_data, XtPointer
403 call_data)
404
405 w the MultiList widget
406
407 client_data
408 the client data specified by the application
409
410 call_data a pointer to an XmMultiListRowInfo structure corrsponding the
411 the row selected
412
414 typedef int (XmMultiListSortFunction) (short column, XmMultiRowInfo *
415 row1, XmMultiRowInfo * row2);
416
417 column the column currently being sorted
418
419 row1, row2
420 the two rows being compared. The return value must be an
421 integer less than, equal to, or greater than 0, depending on
422 whether the first argument is less than, equal to, or greater
423 than the second.
424
426 Composite(3), Constraint(3), Core(3), XmCreateMultiList(3), XmMan‐
427 ager(3), XmMultiListDeselectAllItems(3), XmMultiListDeselectItem(3),
428 XmMultiListDeselectItems(3), XmMultiListDeselectRow(3), XmMultiListGet‐
429 SelectedRowArray(3), XmMultiListGetSelectedRows(3), XmMultiList‐
430 MakeRowVisible(3), XmMultiListSelectAllItems(3), XmMultiListSelec‐
431 tItems(3), XmMultiListSelectRow(3), and XmMultiListToggleRow(3).
432
433
435 Copyright (c) 1992 by Integrated Computer Solutions, Inc.
436
437
438
439 XmMultiList(3x)