1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395
|
.DT
.TH XxExt18LIst 3x ""
.SH NAME
XmExt18List \- The Internationalized Extended List widget
.SH SYNOPSIS
#include <Xm/Ext18List.h>
.SH DESCRIPTION
.PP
.TS
tab (%);
l l.
.TE
.PP
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.
.PP
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.
.PP
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.
.PP
.SH Normal Resources
.PP
.TS
tab (%);
l l l l.
Name%Class%Type%Default
columnTitles%ColumnTitles%String *%NULL
doubleClickCallback%Callback%Callback%NULL
entryData%EntryData%Xm18RowInfo*%NULL
findLabel%XmString%XmString%Find
firstColumn%FirstLocation%short%0
firstColumnPixmaps%FirstColumnPixmaps%Boolean%False
firstRow%FirstLocation%short%0
fontList%FontList%FontList%"fixed"
height%Dimension%VerticalDimension%300
numColumns%NumColumns%short%0
numRows%NumRows%short%0
selectedColumn%SelectedColumn%short%0
selectionPolicy%SelectionPolicy%SelectionPolicy%XmEXTENDED_
%%%SELECT
showFind%boolean%boolean%True
singleSelection%Callback%Callback%NULL
sortFunctions%Function%Function%NULL
title%Title%String%name of
%%%widget
width%Dimension%Horizontal%Dimension%300
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
.PP
.SH columnTitles
.PP
This is an array of length numColumns of strings displayed at the top of each
column. The data is allocated and maintained by the client.
.PP
.SH doubleClickCallback
.PP
All routines in this list will be called whenever the user double clicks on a row in
the list.
.PP
.SH entryData
.PP
This resource is the data associated with each row in the list. The data is an array of Xm18RowInfo structures of length numRows allocated by the client. The data is allocated and maintained by the client. The Xm18RowInfo structure is defined below.
.PP
.SH findLabel
.PP
The label to be shown on the find button.
.PP
.SH firstColumn
.PP
This resource allows the client to adjust the current view of the list data to have a
new top left column location. When setting this resource, firstRow should also be
updated.
.PP
.SH firstColumnPixmaps
.PP
This resource specifies that the pixmap stored in the row info structure should be
used instead of Xm18RowInfo values[0]. If pixmaps are present, the rows may be
dragged by pressing on the pixmap with pointer button three. If this resource is
True, then values[0] is never referenced. If False, then the Xm18RowInfo data
pixmap is never referenced.
.PP
.SH firstRow
.PP
This resource allows the client to adjust the current view of the list data to have a
new top left row location. When setting this resource, firstColumn should also
be updated.
.PP
.SH fontList
.PP
This is an OSF/Motif style font list. The first font in this list will be used to
display all text in the Extended List widget. The Extended List widget currently
supports only one font.
.PP
.SH height
.PP
This is the overall height value assigned to the Extended List widget. Modifying
this resource will affect scrollbar size and location.
.PP
.SH numColumns
.PP
.SH numRows
.PP
These resources specify the number of columns and rows the widget expects to
display. These resources are used as the maximum indices for many of the other
resources in this widget. Care should be taken when modifying these resources to
ensure that the other values have also been modified.
.PP
.SH selectedColumn
.PP
This is the index of the currently selected column. This also the column by which
the list is being sorted.
.PP
.SH selectionPolicy
.PP
Defines the interpretation of the select action. This resource can have the values
XmSINGLE_SELECT or XmEXTENDED_SELECT. Other values result in
undefined behavior.
.PP
.SH showFind
.PP
This boolean manages and unmanages the find button
.PP
.SH singleSelectionCallback
.PP
All routines in this list will be called whenever the user clicks on a line in the list.
A pointer to the Xm18RowInfo structure corresponding to the line selected is passed
as call_data. If in extended select mode the value of call_data is undefined.
.PP
.SH sortFunctions
.PP
This is an array of functions, one for each column, called to determine the
ordering of the rows in the column, similar to qsort.
.PP
.SH title
.PP
This is the title that is displayed at the top of the Extended List widget. If this value is NULL, the title area will not be shown.
.PP
.SH width
.PP
This is the overall width value assigned to the Extended List widget. Modifying
this resource will affect scrollbar size and location.
.PP
.SH Specifying Children Resources
.PP
The Extended List 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.
.PP
.ta 5,10,15,20,25,30,35
.df
XmExt18List <named by application>
XmLabel title
XmScrollbar vertBar
XmScrollBar horizBar
XmFrame frame
XmPushButton find
XmText findText
.PP
.SH Using the Resource Database
.PP
The Extended List 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 Extended List
widget are really part of the internal list sub-component. The Extended List 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 (.).
.PP
.SH The Xm18RowInfo Structure
.PP
The Xm18RowInfo structure is used to contain the entryData associated with each Row
in the Extended List.
.PP
.ta 5,10,15,25,30,35
.df
typedef struct _Xm18RowInfo{
/*
* Used by the IList widget
*/
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 Extended List 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;
} Xm18RowInfo;
.ta 15
.HP 15
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.
.HP 15
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.
.HP 15
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.
.HP 15
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
.HP 15
selected This value is True if this row is selected; may be set by the
application.
.PP
Neither sort_id nor data are used by the Extended List widget; they exist solely for
the convenience of the programmer.
.PP
.SH Translations and Actions
.PP
The following are the default translation bindings used by the icon button:
.PP
.TS
tab (%);
l l.
~Ctrl ~Shift <Btn1Down>:%ButtonDown()
Ctrl ~Shift <Btn1Down>:%ButtonDown(Toggle)
~Ctrl Shift <Btn1Down>:%ButtonDown(Extend)
Button1 <Motion>:%Motion()
<Btn1Up>:%ButtonUpOrLeave()
.TE
.PP
The following actions are supported by the icon button:
.PP
.SH ButtonDown(type)
.PP
Processes a button press action that may begin with
either a select or a double click. The type argument can
be either Toggle or Extend. These values determine
which mode of an extended select will be initiated on
this button event. Consult the OSF/Motif Style
Guide for details.
.PP
.SH Motion()
.PP
Processes motion events to allow the selection region to
be modified when in extended selection mode. It is
assumed that this action is called between a
ButtonDown() and ButtonUpOrLeave() action.
.PP
.SH ButtonUpOrLeave()
.PP
Cleans up after ButtonDown() and Motion().
.PP
.SH Callback Routines
.PP
All procedures on the Extended List's singleSelectionCallback and doubleClickCallback
lists will have a pointer to a Xm18RowInfo structure passed to them in the call_data
field. This structure is defined above.
.PP
Note: if a single SelectionCallback is registered on an extended list in extended_se-
lect_mode, the value of call_data is undefined.
.ta 15
.HP 20
void (callback)(Widget w, XtPointer client_data, XtPointer call_data)
.HP 15
w the Extended List widget
.HP 15
client_data the client data specified by the application
.HP 15
call_data a pointer to an Xm18RowInfo structure corrsponding the the row
selected
.PP
.SH Sort Function
.HP 20
typedef int (Xm18SortFunction) (short column, Xm18RowInfo * row1, Xm18RowInfo * row2);
.ta 15
.HP 15
column the column currently being sorted
.HP 15
row1, row2 the two rows being compared. The return value must be an
integer less than, equal to, or greater than 0, depending on
whether the first argument is less than, equal to, or greater than
the second.
.PP
.SH Convenience Routines
.PP
.SH
.HP 5
.SH XmExt18ListGetSelectedRows
Xm18RowInfo ** XmExt18ListGetSelectedRows (Widget w)
.PP
w extended list widget
.PP
Use the XmExt18ListGetSelectedRows function to find the rows that currently are selected in an extended list. The Xm18RowInfo ** returned by this function contains a NULL terminated array of Xm18RowInfo pointers. The calling routine is responsible for freeing the returned pointer
with XtFree(). The function will return NULL if no elements are selected.
.PP
.SH XmCreateExtended18List
.PP
Widget XmCreateExtended18List(Widget parent, String name,
ArgList args, Cardinal num_args)
.PP
parent parent of the extended list widget to be
created
.br
name name of the extended list widget to be
created
.br
args arguments to pass to XtCreateWidget for the
extended list
.br
num_args number of arguments passed
.PP
This convenience routine simply takes the passed parameters and calls XtCreateWidget, returning the widget created.
.PP
.SH XmExt18ListUnselectAllItems
void XmExt18ListUnselectAllItems( Widget w )
.PP
w the extended list widget to be modified
.PP
Unselects all rows of the passed extended list widget and returns nothing.
.PP
.SH XmExt18ListUnselectItem
void XmExt18ListUnselectItem(Widget w, Xm18RowInfo *row_info)
.PP
w extended list widget
.br
row_info pointer to the row which is to be
unselected.
.PP
Unselects the row designated by row_info of the passed extended
list widget w
.PP
.SH COPYRIGHT
.PP
Copyright (c) 1992 by Integrated Computer Solutions, Inc.
|