diff options
author | treectrl <treectrl> | 2006-11-15 23:52:54 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2006-11-15 23:52:54 (GMT) |
commit | 76a855857013ba3236b81220e381e91dffad38b1 (patch) | |
tree | e97c534133b24d069870b68a9931ab10e57ae356 | |
parent | 3588dd43aa97232f53744c39bdb96bac8300d4aa (diff) | |
download | tktreectrl-76a855857013ba3236b81220e381e91dffad38b1.zip tktreectrl-76a855857013ba3236b81220e381e91dffad38b1.tar.gz tktreectrl-76a855857013ba3236b81220e381e91dffad38b1.tar.bz2 |
Debug the drawing of borders.
-rw-r--r-- | generic/tkTreeDisplay.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c index 7c45141..2045688 100644 --- a/generic/tkTreeDisplay.c +++ b/generic/tkTreeDisplay.c @@ -5,7 +5,7 @@ * * Copyright (c) 2002-2006 Tim Baker * - * RCS: @(#) $Id: tkTreeDisplay.c,v 1.62 2006/11/13 04:45:30 treectrl Exp $ + * RCS: @(#) $Id: tkTreeDisplay.c,v 1.63 2006/11/15 23:52:54 treectrl Exp $ */ #include "tkTreeCtrl.h" @@ -5104,6 +5104,47 @@ DisplayDItem( return 1; } +void +DebugDrawBorder( + TreeCtrl *tree, + int inset, + int left, + int top, + int right, + int bottom + ) +{ + Tk_Window tkwin = tree->tkwin; + + if (tree->debug.enable && tree->debug.display && tree->debug.drawColor) { + if (left > 0) { + XFillRectangle(tree->display, Tk_WindowId(tkwin), + tree->debug.gcDraw, + inset, inset, + left, Tk_Height(tkwin) - inset * 2); + } + if (top > 0) { + XFillRectangle(tree->display, Tk_WindowId(tkwin), + tree->debug.gcDraw, + inset, inset, + Tk_Width(tkwin) - inset * 2, top); + } + if (right > 0) { + XFillRectangle(tree->display, Tk_WindowId(tkwin), + tree->debug.gcDraw, + Tk_Width(tkwin) - inset - right, inset, + right, Tk_Height(tkwin) - inset * 2); + } + if (bottom > 0) { + XFillRectangle(tree->display, Tk_WindowId(tkwin), + tree->debug.gcDraw, + inset, Tk_Height(tkwin) - inset - bottom, + Tk_Width(tkwin), bottom); + } + DisplayDelay(tree); + } +} + /* *-------------------------------------------------------------- * @@ -5666,6 +5707,9 @@ displayRetry: if ((dInfo->flags & DINFO_DRAW_HIGHLIGHT) && (tree->highlightWidth > 0)) { GC fgGC, bgGC; + DebugDrawBorder(tree, 0, tree->highlightWidth, tree->highlightWidth, + tree->highlightWidth, tree->highlightWidth); + bgGC = Tk_GCForColor(tree->highlightBgColorPtr, drawable); if (tree->gotFocus) fgGC = Tk_GCForColor(tree->highlightColorPtr, drawable); @@ -5677,6 +5721,10 @@ displayRetry: /* Draw 3D-border (inside of focus rectangle) */ if ((dInfo->flags & DINFO_DRAW_BORDER) && (tree->borderWidth > 0)) { + DebugDrawBorder(tree, tree->highlightWidth, + tree->borderWidth, tree->borderWidth, + tree->borderWidth, tree->borderWidth); + Tk_Draw3DRectangle(tkwin, drawable, tree->border, tree->highlightWidth, tree->highlightWidth, Tk_Width(tkwin) - tree->highlightWidth * 2, Tk_Height(tkwin) - tree->highlightWidth * 2, tree->borderWidth, |