Lines Matching defs:lw
172 ListWidget lw = (ListWidget) w;
174 values.foreground = lw->list.foreground;
175 values.font = lw->list.font->fid;
176 lw->list.normgc = XtGetGC(w, (unsigned) GCForeground | GCFont,
179 values.foreground = lw->core.background_pixel;
180 lw->list.revgc = XtGetGC(w, (unsigned) GCForeground | GCFont,
184 lw->list.foreground,
185 lw->core.background_pixel,
186 lw->core.depth);
189 lw->list.graygc = XtGetGC(w, (unsigned) GCFont | GCTile | GCFillStyle,
205 ListWidget lw = (ListWidget) w;
214 if (lw->list.list == NULL) {
215 lw->list.list = &(lw->core.name);
216 lw->list.nitems = 1;
219 if (lw->list.nitems == 0) /* Get number of items. */
220 for ( ; lw->list.list[lw->list.nitems] != NULL ; lw->list.nitems++);
222 if (lw->list.longest == 0) /* Get column width. */
223 for ( i = 0 ; i < lw->list.nitems; i++) {
224 len = XTextWidth(lw->list.font, lw->list.list[i],
225 strlen(lw->list.list[i]));
226 if (len > lw->list.longest)
227 lw->list.longest = len;
230 lw->list.col_width = lw->list.longest + lw->list.column_space;
304 ListWidget lw = (ListWidget) new;
313 lw->list.row_height = lw->list.font->max_bounds.ascent
314 + lw->list.font->max_bounds.descent
315 + lw->list.row_space;
319 lw->list.highlight = lw->list.is_highlighted = NO_HIGHLIGHT;
338 ListWidget lw = (ListWidget) w;
341 if (lw->list.vertical_cols) {
342 one = lw->list.nrows * ((xloc - (int) lw->list.internal_width)
343 / lw->list.col_width);
344 another = (yloc - (int) lw->list.internal_height)
345 / lw->list.row_height;
347 if (another >= lw->list.nrows) {
348 another = lw->list.nrows - 1;
353 one = (lw->list.ncols * ((yloc - (int) lw->list.internal_height)
354 / lw->list.row_height)) ;
356 another = (xloc - (int) lw->list.internal_width) / lw->list.col_width;
357 if (another >= lw->list.ncols) {
358 another = lw->list.ncols - 1;
367 if (*item >= lw->list.nitems) return(OUT_OF_RANGE);
406 ListWidget lw = (ListWidget) w;
412 if (lw->list.vertical_cols)
413 things = lw->list.nrows;
415 things = lw->list.ncols;
437 ListWidget lw = (ListWidget) w;
440 hl_x = x - lw->list.column_space/2;
441 width = XTextWidth(lw->list.font, lw->list.list[item],
442 strlen(lw->list.list[item])) + lw->list.column_space;
443 hl_y = y - lw->list.row_space/2;
444 height = lw->list.row_height + lw->list.row_space;
466 ListWidget lw = (ListWidget) w;
470 if (lw->list.vertical_cols) {
471 x = lw->list.col_width * (item / lw->list.nrows)
472 + lw->list.internal_width;
473 y = lw->list.row_height * (item % lw->list.nrows)
474 + lw->list.internal_height;
477 x = lw->list.col_width * (item % lw->list.ncols)
478 + lw->list.internal_width;
479 y = lw->list.row_height * (item / lw->list.ncols)
480 + lw->list.internal_height;
483 str_y = y + lw->list.font->max_bounds.ascent;
485 if (item == lw->list.is_highlighted) {
486 if (item == lw->list.highlight) {
487 gc = lw->list.revgc;
488 HighlightBackground(w, x, y, item, lw->list.normgc);
492 gc = lw->list.normgc;
494 gc = lw->list.graygc;
495 HighlightBackground(w, x, y, item, lw->list.revgc);
496 lw->list.is_highlighted = NO_HIGHLIGHT;
500 if (item == lw->list.highlight) {
501 gc = lw->list.revgc;
502 HighlightBackground(w, x, y, item, lw->list.normgc);
503 lw->list.is_highlighted = item;
507 gc = lw->list.normgc;
509 gc = lw->list.graygc;
513 str = lw->list.list[item]; /* draw it */
534 ListWidget lw = (ListWidget) w;
538 lr_item = lw->list.nrows * lw->list.ncols - 1;
544 for (item = ul_item; (item <= lr_item && item < lw->list.nitems) ; item++)
639 ListWidget lw = (ListWidget) w;
647 if (lw->list.force_cols) {
648 lw->list.ncols = lw->list.default_cols;
649 if (lw->list.ncols <= 0) lw->list.ncols = 1;
651 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
653 *width = lw->list.ncols * lw->list.col_width
654 + 2 * lw->list.internal_width;
658 *height = (lw->list.nrows * lw->list.row_height)
659 + 2 * lw->list.internal_height;
672 lw->list.ncols = lw->list.default_cols;
673 if (lw->list.ncols <= 0) lw->list.ncols = 1;
674 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
675 *width = lw->list.ncols * lw->list.col_width
676 + 2 * lw->list.internal_width;
677 *height = (lw->list.nrows * lw->list.row_height)
678 + 2 * lw->list.internal_height;
687 lw->list.ncols = ( (*width - 2 * lw->list.internal_width)
688 / lw->list.col_width);
689 if (lw->list.ncols <= 0) lw->list.ncols = 1;
690 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
692 *height = (lw->list.nrows * lw->list.row_height)
693 + 2 * lw->list.internal_height;
703 lw->list.nrows = (*height - 2 * lw->list.internal_height)
704 / lw->list.row_height;
705 if (lw->list.nrows <= 0) lw->list.nrows = 1;
706 lw->list.ncols = (( lw->list.nitems - 1 ) / lw->list.nrows) + 1;
707 *width = lw->list.ncols * lw->list.col_width
708 + 2 * lw->list.internal_width;
733 ListWidget lw = ( ListWidget ) w;
745 == OUT_OF_RANGE) || (lw->list.highlight != item) ) {
750 item_len = strlen(lw->list.list[item]);
752 if ( lw->list.paste ) /* if XtNpasteBuffer set then paste it. */
753 XStoreBytes(XtDisplay(w), lw->list.list[item], item_len);
759 ret_value.string = lw->list.list[item];
801 ListWidget lw = (ListWidget) w;
806 else if ( lw->list.is_highlighted != item ) /* If this item is not */
898 ListWidget lw = (ListWidget) w;
900 lw->list.list = list;
903 lw->list.nitems = nitems;
905 lw->list.longest = longest;
908 lw->list.is_highlighted = lw->list.highlight = NO_HIGHLIGHT;
923 ListWidget lw = ( ListWidget ) w;
925 lw->list.highlight = NO_HIGHLIGHT;
926 if (lw->list.is_highlighted != NO_HIGHLIGHT)
927 PaintItemName(w, lw->list.is_highlighted); /* unhighlight this one. */
942 ListWidget lw = ( ListWidget ) w;
945 lw->list.highlight = item;
946 if (lw->list.is_highlighted != NO_HIGHLIGHT)
947 PaintItemName(w, lw->list.is_highlighted); /* Unhighlight. */
962 ListWidget lw = ( ListWidget ) w;
967 ret_val->list_index = lw->list.highlight;
971 ret_val->string = lw->list.list[ ret_val->list_index ];