comparison lwlib/xlwmenu.c @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents f53b5ca2e663
children acd284d43ca1
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
429 XmStringExtent (mw->menu.font_list, newstring, &width, &height); 429 XmStringExtent (mw->menu.font_list, newstring, &width, &height);
430 XmStringFree(newstring); 430 XmStringFree(newstring);
431 return width; 431 return width;
432 #else 432 #else
433 # ifdef USE_XFONTSET 433 # ifdef USE_XFONTSET
434 int i, s=0, w=0; 434 XmbTextExtents(mw->menu.font_set, newchars, j, &ri, &rl);
435 for (i=0; string[i]; ++i) { 435 return rl.width;
436 if (string[i]=='%' && string[i+1]=='_') {
437 XmbTextExtents(mw->menu.font_set, &string[s], i-s, &ri, &rl);
438 w += rl.width;
439 s = i + 2;
440 ++i;
441 }
442 }
443 if (string[s]) {
444 XmbTextExtents(mw->menu.font_set, &string[s], i-s, &ri, &rl);
445 w += rl.width;
446 }
447 return w;
448 # else /* ! USE_XFONTSET */ 436 # else /* ! USE_XFONTSET */
449 XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop, &xcs); 437 XTextExtents (mw->menu.font, newchars, j, &drop, &drop, &drop, &xcs);
450 return xcs.width; 438 return xcs.width;
451 # endif /* USE_XFONTSET */ 439 # endif /* USE_XFONTSET */
452 #endif 440 #endif
835 823
836 if (end <= start) 824 if (end <= start)
837 return 0; 825 return 0;
838 XmbDrawString ( 826 XmbDrawString (
839 XtDisplay (mw), window, mw->menu.font_set, gc, 827 XtDisplay (mw), window, mw->menu.font_set, gc,
840 x, y + mw->menu.font_ascent, &string[start], i-s 828 x, y + mw->menu.font_ascent, &string[start], end - start);
841 );
842 XmbTextExtents ( 829 XmbTextExtents (
843 mw->menu.font_set, &string[start], end - start, &ri, &rl 830 mw->menu.font_set, &string[start], end - start, &ri, &rl);
844 );
845 return rl.width; 831 return rl.width;
846 # else 832 # else
847 XCharStruct xcs; 833 XCharStruct xcs;
848 int drop; 834 int drop;
849 835