diff options
author | treectrl <treectrl> | 2002-12-22 01:26:13 (GMT) |
---|---|---|
committer | treectrl <treectrl> | 2002-12-22 01:26:13 (GMT) |
commit | 22cf2375f00a78e6def1dd600f7e8c775b3fd2d2 (patch) | |
tree | 690e11bbb77f58978ba8e8874ba12af4d61dd742 | |
parent | de1f2242648b5bbc0f35faacb8de51d2c20d5c8c (diff) | |
download | tktreectrl-22cf2375f00a78e6def1dd600f7e8c775b3fd2d2.zip tktreectrl-22cf2375f00a78e6def1dd600f7e8c775b3fd2d2.tar.gz tktreectrl-22cf2375f00a78e6def1dd600f7e8c775b3fd2d2.tar.bz2 |
Scroll-by-pages fix.
-rw-r--r-- | generic/tkTreeCtrl.c | 6 | ||||
-rw-r--r-- | generic/tkTreeDisplay.c | 26 |
2 files changed, 21 insertions, 11 deletions
diff --git a/generic/tkTreeCtrl.c b/generic/tkTreeCtrl.c index 5791998..12f61cd 100644 --- a/generic/tkTreeCtrl.c +++ b/generic/tkTreeCtrl.c @@ -2355,6 +2355,9 @@ static int A_XviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[]) offset = tree->inset + tree->xOrigin; offset += (int) (count * visWidth * 0.9); index = Increment_FindX(tree, offset); + if ((count > 0) && (index == + Increment_FindX(tree, tree->inset + tree->xOrigin))) + index++; break; case TK_SCROLL_UNITS: offset = tree->inset + tree->xOrigin; @@ -2440,6 +2443,9 @@ static int A_YviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[]) offset = topInset + tree->yOrigin; offset += (int) (count * visHeight * 0.9); index = Increment_FindY(tree, offset); + if ((count > 0) && (index == + Increment_FindY(tree, topInset + tree->yOrigin))) + index++; break; case TK_SCROLL_UNITS: offset = topInset + tree->yOrigin; diff --git a/generic/tkTreeDisplay.c b/generic/tkTreeDisplay.c index e6c0d86..0ac0cdd 100644 --- a/generic/tkTreeDisplay.c +++ b/generic/tkTreeDisplay.c @@ -1069,7 +1069,8 @@ int B_XviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[]) offset = tree->inset + tree->xOrigin; offset += (int) (count * visWidth * 0.9); index = Increment_FindX(tree, offset); - if (index == Increment_FindX(tree, tree->inset + tree->xOrigin)) + if ((count > 0) && (index == + Increment_FindX(tree, tree->inset + tree->xOrigin))) index++; break; case TK_SCROLL_UNITS: @@ -1155,7 +1156,8 @@ int B_YviewCmd(TreeCtrl *tree, int objc, Tcl_Obj *CONST objv[]) offset = topInset + tree->yOrigin; offset += (int) (count * visHeight * 0.9); index = Increment_FindY(tree, offset); - if (index == Increment_FindY(tree, topInset + tree->yOrigin)) + if ((count > 0) && (index == + Increment_FindY(tree, topInset + tree->yOrigin))) index++; break; case TK_SCROLL_UNITS: @@ -2577,6 +2579,17 @@ if (tree->debug.enable && tree->debug.display && 0) } dInfo->flags &= ~DINFO_CHECK_COLUMN_WIDTH; } + if (dInfo->headerHeight != Tree_HeaderHeight(tree)) + { + dInfo->headerHeight = Tree_HeaderHeight(tree); + dInfo->flags |= + DINFO_OUT_OF_DATE | + DINFO_SET_ORIGIN_Y | + DINFO_UPDATE_SCROLLBAR_Y | + DINFO_DRAW_HEADER; + if (tree->vertical && (tree->wrapMode == TREE_WRAP_WINDOW)) + dInfo->flags |= DINFO_REDO_RANGES; + } Range_RedoIfNeeded(tree); #ifdef INCREMENTS Increment_RedoIfNeeded(tree); @@ -2610,15 +2623,6 @@ if (tree->debug.enable && tree->debug.display && 0) DINFO_UPDATE_SCROLLBAR_Y | DINFO_OUT_OF_DATE; } - if (dInfo->headerHeight != Tree_HeaderHeight(tree)) - { - dInfo->headerHeight = Tree_HeaderHeight(tree); - dInfo->flags |= - DINFO_OUT_OF_DATE | - DINFO_SET_ORIGIN_Y | - DINFO_UPDATE_SCROLLBAR_Y | - DINFO_DRAW_HEADER; - } if (dInfo->flags & DINFO_SET_ORIGIN_X) { Tree_SetOriginX(tree, tree->xOrigin); |