summaryrefslogtreecommitdiffstats
path: root/generic/tkTreeItem.c
diff options
context:
space:
mode:
authortreectrl <treectrl>2005-05-01 01:38:42 (GMT)
committertreectrl <treectrl>2005-05-01 01:38:42 (GMT)
commit6192aae8a9fc62a3cd5874cd6ccbfef99588649c (patch)
tree38be9c5a110cc5d414f5604386596c092292fcb5 /generic/tkTreeItem.c
parent7f6a45c8cd56552d244a2bef30e058dab84059e0 (diff)
downloadtktreectrl-6192aae8a9fc62a3cd5874cd6ccbfef99588649c.zip
tktreectrl-6192aae8a9fc62a3cd5874cd6ccbfef99588649c.tar.gz
tktreectrl-6192aae8a9fc62a3cd5874cd6ccbfef99588649c.tar.bz2
Bumped copyright to 2005.
Don't draw horizontal line unless it connects to a vertical line. Use new Theme API to draw buttons.
Diffstat (limited to 'generic/tkTreeItem.c')
-rw-r--r--generic/tkTreeItem.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/generic/tkTreeItem.c b/generic/tkTreeItem.c
index b821a40..af202be 100644
--- a/generic/tkTreeItem.c
+++ b/generic/tkTreeItem.c
@@ -3,9 +3,9 @@
*
* This module implements items for treectrl widgets.
*
- * Copyright (c) 2002-2004 Tim Baker
+ * Copyright (c) 2002-2005 Tim Baker
*
- * RCS: @(#) $Id: tkTreeItem.c,v 1.27 2005/03/29 21:05:55 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeItem.c,v 1.28 2005/05/01 01:38:42 treectrl Exp $
*/
#include "tkTreeCtrl.h"
@@ -1558,7 +1558,6 @@ void TreeItem_DrawLines(TreeCtrl *tree, TreeItem item_, int x, int y, int width,
Item *item, *parent;
int indent, left, lineLeft, lineTop;
int hasPrev, hasNext;
- int hasButton;
int i, vert = 0;
indent = TreeItem_Indent(tree, item_);
@@ -1622,10 +1621,7 @@ void TreeItem_DrawLines(TreeCtrl *tree, TreeItem item_, int x, int y, int width,
}
/* Horizontal line to self */
- hasButton = tree->showButtons && self->hasButton;
- if (ISROOT(self) && !tree->showRootButton)
- hasButton = FALSE;
- if (hasButton || hasPrev || hasNext) {
+ if (hasPrev || hasNext) {
if (tree->lineStyle == LINE_STYLE_DOT) {
for (i = 0; i < tree->lineThickness; i++)
HDotLine(tree, drawable, tree->lineGC,
@@ -1730,6 +1726,20 @@ void TreeItem_DrawButton(TreeCtrl *tree, TreeItem item_, int x, int y, int width
return;
}
+#ifdef THEME
+ if (tree->useTheme) {
+ int bw = (self->state & STATE_OPEN) ?
+ tree->openButtonWidth : tree->closedButtonWidth;
+ int bh = (self->state & STATE_OPEN) ?
+ tree->openButtonHeight : tree->closedButtonHeight;
+ if (TreeTheme_DrawButton(tree, drawable, self->state & STATE_OPEN,
+ left + (tree->useIndent - bw) / 2, y + (height - bh) / 2,
+ bw, bh) == TCL_OK) {
+ return;
+ }
+ }
+#endif
+
w1 = tree->buttonThickness / 2;
/* Left edge of vertical line */