Lines Matching refs:lw

187     ListWidget lw = (ListWidget) w;    
189 values.foreground = lw->list.foreground;
190 values.font = lw->list.font->fid;
192 if ( lw->simple.international == True )
193 lw->list.normgc = XtAllocateGC( w, 0, (unsigned) GCForeground,
196 lw->list.normgc = XtGetGC( w, (unsigned) GCForeground | GCFont,
199 values.foreground = lw->core.background_pixel;
201 if ( lw->simple.international == True )
202 lw->list.revgc = XtAllocateGC( w, 0, (unsigned) GCForeground,
205 lw->list.revgc = XtGetGC( w, (unsigned) GCForeground | GCFont,
209 lw->list.foreground,
210 lw->core.background_pixel,
211 lw->core.depth);
214 if ( lw->simple.international == True )
215 lw->list.graygc = XtAllocateGC( w, 0, (unsigned) GCTile | GCFillStyle,
218 lw->list.graygc = XtGetGC( w, (unsigned) GCFont | GCTile | GCFillStyle,
238 ListWidget lw = (ListWidget) w;
242 if (lw->list.list == NULL) {
243 lw->list.list = &(lw->core.name);
244 lw->list.nitems = 1;
249 if (lw->list.nitems == 0)
250 for ( ; lw->list.list[lw->list.nitems] != NULL ; lw->list.nitems++);
254 if ( LongestFree( lw ) ) {
256 lw->list.longest = 0; /* so it will accumulate real longest below */
258 for ( i = 0 ; i < lw->list.nitems; i++) {
259 if ( lw->simple.international == True )
260 len = XmbTextEscapement(lw->list.fontset, lw->list.list[i],
261 strlen(lw->list.list[i]));
263 len = XTextWidth(lw->list.font, lw->list.list[i],
264 strlen(lw->list.list[i]));
265 if (len > lw->list.longest)
266 lw->list.longest = len;
270 lw->list.col_width = lw->list.longest + lw->list.column_space;
359 ListWidget lw = (ListWidget) new;
366 lw->list.freedoms = (lw->core.width != 0) * WidthLock +
367 (lw->core.height != 0) * HeightLock +
368 (lw->list.longest != 0) * LongestLock;
374 if (lw->simple.international == True )
375 lw->list.row_height =
376 XExtentsOfFontSet(lw->list.fontset)->max_ink_extent.height
377 + lw->list.row_space;
379 lw->list.row_height = lw->list.font->max_bounds.ascent
380 + lw->list.font->max_bounds.descent
381 + lw->list.row_space;
383 ResetList( new, WidthFree( lw ), HeightFree( lw ) );
385 lw->list.highlight = lw->list.is_highlighted = NO_HIGHLIGHT;
404 ListWidget lw = (ListWidget) w;
407 if (lw->list.vertical_cols) {
408 one = lw->list.nrows * ((xloc - (int) lw->list.internal_width)
409 / lw->list.col_width);
410 another = (yloc - (int) lw->list.internal_height)
411 / lw->list.row_height;
413 if (another >= lw->list.nrows) {
414 another = lw->list.nrows - 1;
419 one = (lw->list.ncols * ((yloc - (int) lw->list.internal_height)
420 / lw->list.row_height)) ;
422 another = (xloc - (int) lw->list.internal_width) / lw->list.col_width;
423 if (another >= lw->list.ncols) {
424 another = lw->list.ncols - 1;
433 if (*item >= lw->list.nitems) return(OUT_OF_RANGE);
474 ListWidget lw = (ListWidget) w;
480 if (lw->list.vertical_cols)
481 things = lw->list.nrows;
483 things = lw->list.ncols;
507 ListWidget lw = (ListWidget) w;
511 Dimension width = lw->list.col_width;
512 Dimension height = lw->list.row_height;
513 Dimension frame_limited_width = w->core.width - lw->list.internal_width - x;
514 Dimension frame_limited_height= w->core.height- lw->list.internal_height- y;
525 if ( x < lw->list.internal_width ) {
526 width = width - ( lw->list.internal_width - x );
527 x = lw->list.internal_width;
529 if ( y < lw->list.internal_height) {
530 height = height - ( lw->list.internal_height - x );
531 y = lw->list.internal_height;
547 static void ClipToShadowInteriorAndLongest(lw, gc_p, x)
548 ListWidget lw;
555 rect.y = lw->list.internal_height;
556 rect.height = lw->core.height - lw->list.internal_height * 2;
557 rect.width = lw->core.width - lw->list.internal_width - x;
558 if ( rect.width > lw->list.longest )
559 rect.width = lw->list.longest;
561 XSetClipRectangles( XtDisplay((Widget)lw),*gc_p,0,0,&rect,1,YXBanded );
581 ListWidget lw = (ListWidget) w;
582 XFontSetExtents *ext = XExtentsOfFontSet(lw->list.fontset);
586 if (lw->list.vertical_cols) {
587 x = lw->list.col_width * (item / lw->list.nrows)
588 + lw->list.internal_width;
589 y = lw->list.row_height * (item % lw->list.nrows)
590 + lw->list.internal_height;
593 x = lw->list.col_width * (item % lw->list.ncols)
594 + lw->list.internal_width;
595 y = lw->list.row_height * (item / lw->list.ncols)
596 + lw->list.internal_height;
599 if ( lw->simple.international == True )
602 str_y = y + lw->list.font->max_bounds.ascent;
604 if (item == lw->list.is_highlighted) {
605 if (item == lw->list.highlight) {
606 gc = lw->list.revgc;
607 HighlightBackground(w, x, y, lw->list.normgc);
611 gc = lw->list.normgc;
613 gc = lw->list.graygc;
614 HighlightBackground(w, x, y, lw->list.revgc);
615 lw->list.is_highlighted = NO_HIGHLIGHT;
619 if (item == lw->list.highlight) {
620 gc = lw->list.revgc;
621 HighlightBackground(w, x, y, lw->list.normgc);
622 lw->list.is_highlighted = item;
626 gc = lw->list.normgc;
628 gc = lw->list.graygc;
637 x += lw->list.column_space / 2;
638 str_y += lw->list.row_space / 2;
640 str = lw->list.list[item]; /* draw it */
642 ClipToShadowInteriorAndLongest( lw, &gc, x );
644 if ( lw->simple.international == True )
645 XmbDrawString( XtDisplay( w ), XtWindow( w ), lw->list.fontset,
671 ListWidget lw = (ListWidget) w;
675 lr_item = lw->list.nrows * lw->list.ncols - 1;
681 for (item = ul_item; (item <= lr_item && item < lw->list.nitems) ; item++)
775 ListWidget lw = (ListWidget) w;
783 if (lw->list.force_cols) {
784 lw->list.ncols = lw->list.default_cols;
785 if (lw->list.ncols <= 0) lw->list.ncols = 1;
787 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
794 *width = lw->list.ncols * lw->list.col_width
795 + 2 * lw->list.internal_width;
799 *height = (lw->list.nrows * lw->list.row_height)
800 + 2 * lw->list.internal_height;
813 lw->list.ncols = lw->list.default_cols;
814 if (lw->list.ncols <= 0) lw->list.ncols = 1;
815 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
816 *width = lw->list.ncols * lw->list.col_width
817 + 2 * lw->list.internal_width;
818 *height = (lw->list.nrows * lw->list.row_height)
819 + 2 * lw->list.internal_height;
828 lw->list.ncols = ( (int)(*width - 2 * lw->list.internal_width)
829 / (int)lw->list.col_width);
830 if (lw->list.ncols <= 0) lw->list.ncols = 1;
831 lw->list.nrows = ( ( lw->list.nitems - 1) / lw->list.ncols) + 1 ;
833 *height = (lw->list.nrows * lw->list.row_height)
834 + 2 * lw->list.internal_height;
844 lw->list.nrows = (int)(*height - 2 * lw->list.internal_height)
845 / (int)lw->list.row_height;
846 if (lw->list.nrows <= 0) lw->list.nrows = 1;
847 lw->list.ncols = (( lw->list.nitems - 1 ) / lw->list.nrows) + 1;
848 *width = lw->list.ncols * lw->list.col_width
849 + 2 * lw->list.internal_width;
870 ListWidget lw = ( ListWidget ) w;
882 == OUT_OF_RANGE) || (lw->list.highlight != item) ) {
887 item_len = strlen(lw->list.list[item]);
889 if ( lw->list.paste ) /* if XtNpasteBuffer set then paste it. */
890 XStoreBytes(XtDisplay(w), lw->list.list[item], item_len);
896 ret_value.string = lw->list.list[item];
932 ListWidget lw = (ListWidget) w;
937 else if ( lw->list.is_highlighted != item ) /* If this item is not */
1055 ListWidget lw = (ListWidget) w;
1058 XGetGCValues(XtDisplay(w), lw->list.graygc, GCTile, &values);
1060 XtReleaseGC(w, lw->list.graygc);
1061 XtReleaseGC(w, lw->list.revgc);
1062 XtReleaseGC(w, lw->list.normgc);
1097 ListWidget lw = (ListWidget) w;
1101 lw->list.list = list;
1104 lw->list.nitems = nitems;
1109 lw->list.freedoms |= LongestLock;
1111 lw->list.freedoms &= ~LongestLock;
1114 lw->list.freedoms &= ~WidthLock & ~HeightLock;
1117 lw->list.longest = longest;
1125 lw->list.is_highlighted = lw->list.highlight = NO_HIGHLIGHT;
1144 ListWidget lw = ( ListWidget ) w;
1146 lw->list.highlight = NO_HIGHLIGHT;
1147 if (lw->list.is_highlighted != NO_HIGHLIGHT)
1148 PaintItemName(w, lw->list.is_highlighted); /* unhighlight this one. */
1167 ListWidget lw = ( ListWidget ) w;
1170 lw->list.highlight = item;
1171 if (lw->list.is_highlighted != NO_HIGHLIGHT)
1172 PaintItemName(w, lw->list.is_highlighted); /* Unhighlight. */
1191 ListWidget lw = ( ListWidget ) w;
1197 ret_val->list_index = lw->list.highlight;
1201 ret_val->string = lw->list.list[ ret_val->list_index ];