diff options
author | treectrl <treectrl> | 2006-10-31 23:12:24 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-10-31 23:12:24 (GMT) |
commit | 967104e61a9f04ae7c5de4e80e03daed3fe7ba77 (patch) | |
tree | 2589c1d97ae2fb899fea0a8b9dd3302d0278fd5e /generic/tkTreeUtils.c | |
parent | 26853317331bd54ca43b6be856246e7eee173b57 (diff) | |
download | tktreectrl-967104e61a9f04ae7c5de4e80e03daed3fe7ba77.zip tktreectrl-967104e61a9f04ae7c5de4e80e03daed3fe7ba77.tar.gz tktreectrl-967104e61a9f04ae7c5de4e80e03daed3fe7ba77.tar.bz2 |
Added underline arg to TextLayout_Draw. [ Patch 1580928 ]
Diffstat (limited to 'generic/tkTreeUtils.c')
-rw-r--r-- | generic/tkTreeUtils.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/generic/tkTreeUtils.c b/generic/tkTreeUtils.c index 6c93f07..38cbf4e 100644 --- a/generic/tkTreeUtils.c +++ b/generic/tkTreeUtils.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2006 Tim Baker * - * RCS: @(#) $Id: tkTreeUtils.c,v 1.47 2006/10/30 23:50:18 treectrl Exp $ + * RCS: @(#) $Id: tkTreeUtils.c,v 1.48 2006/10/31 23:12:24 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -1739,9 +1739,11 @@ void TextLayout_Draw( int firstChar, /* The index of the first character to draw * * from the given text item. 0 specfies the * * beginning. */ - int lastChar /* The index just after the last character + int lastChar, /* The index just after the last character * * to draw from the given text item. A number * * < 0 means to draw all characters. */ + int underline /* Character index to underline, or < 0 for + * no underline. */ ) { LayoutInfo *layoutPtr = (LayoutInfo *) layout; @@ -1795,9 +1797,23 @@ void TextLayout_Draw( Tk_DrawChars(display, drawable, gc, layoutPtr->tkfont, firstByte, lastByte - firstByte, x + chunkPtr->x + drawX, y + chunkPtr->y); +#if 1 + if (underline >= firstChar && underline < numDisplayChars) + { + CONST char *fstBytePtr = Tcl_UtfAtIndex(chunkPtr->start, underline); + CONST char *sndBytePtr = Tcl_UtfNext(fstBytePtr); + Tk_UnderlineChars(display, drawable, gc, + layoutPtr->tkfont, firstByte, + x + chunkPtr->x + drawX, y + chunkPtr->y, + fstBytePtr - chunkPtr->start, sndBytePtr - chunkPtr->start); + } +#endif } firstChar -= chunkPtr->numChars; lastChar -= chunkPtr->numChars; +#if 1 + underline -= chunkPtr->numChars; +#endif if (lastChar <= 0) break; chunkPtr++; |