summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-01-17 20:40:01 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-01-17 20:40:01 (GMT)
commit61a97384456cdf43006536d3436fa51ee3e9acff (patch)
tree20334da9dcde6eddcc92fcd310be26fdf8552a34
parent24a1905f5c41cebbad36b04ef8c1f9327fe5a109 (diff)
downloadtk-61a97384456cdf43006536d3436fa51ee3e9acff.zip
tk-61a97384456cdf43006536d3436fa51ee3e9acff.tar.gz
tk-61a97384456cdf43006536d3436fa51ee3e9acff.tar.bz2
Addressed questions 3 and 5 (see artifact [9d48a9c212] of ticket [3f456a5bb9]). It is not desirable to make the listbox xview jump on resizing.
-rw-r--r--generic/tkListbox.c61
1 files changed, 0 insertions, 61 deletions
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index 4f20d44..9ff9d23 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -167,8 +167,6 @@ typedef struct {
int flags; /* Various flag bits: see below for
* definitions. */
Tk_Justify justify; /* Justification. */
- int oldMaxOffset; /* Used in scrolling for right/center
- * justification. */
} Listbox;
/*
@@ -554,7 +552,6 @@ Tk_ListboxObjCmd(
listPtr->state = STATE_NORMAL;
listPtr->gray = None;
listPtr->justify = TK_JUSTIFY_LEFT;
- listPtr->oldMaxOffset = 0;
/*
* Keep a hold of the associated tkwin until we destroy the listbox,
@@ -2623,7 +2620,6 @@ ListboxEventProc(
ClientData clientData, /* Information about window. */
XEvent *eventPtr) /* Information about event. */
{
- int tmpOffset, tmpOffset2, maxOffset;
Listbox *listPtr = clientData;
if (eventPtr->type == Expose) {
@@ -2655,63 +2651,6 @@ ListboxEventProc(
}
listPtr->flags |= UPDATE_V_SCROLLBAR|UPDATE_H_SCROLLBAR;
ChangeListboxView(listPtr, listPtr->topIndex);
- if (listPtr->justify == TK_JUSTIFY_RIGHT) {
- maxOffset = GetMaxOffset(listPtr);
- if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {
-
- /*
- * Window has shrunk.
- */
-
- if (maxOffset > listPtr->oldMaxOffset) {
- tmpOffset = maxOffset - listPtr->oldMaxOffset;
- } else {
- tmpOffset = listPtr->oldMaxOffset - maxOffset;
- }
- tmpOffset -= tmpOffset % listPtr->xScrollUnit;
- if ((tmpOffset + listPtr->xOffset) > maxOffset) {
- tmpOffset = maxOffset - listPtr->xOffset;
- }
- if (tmpOffset < 0) {
- tmpOffset = 0;
- }
- listPtr->xOffset += tmpOffset;
- } else {
- listPtr->xOffset = maxOffset;
- }
- listPtr->oldMaxOffset = maxOffset;
- } else if (listPtr->justify == TK_JUSTIFY_CENTER) {
- maxOffset = GetMaxOffset(listPtr);
- if (maxOffset != listPtr->oldMaxOffset && listPtr->oldMaxOffset > 0) {
-
- /*
- * Window has shrunk.
- */
-
- tmpOffset2 = maxOffset / 2;
- if (maxOffset > listPtr->oldMaxOffset) {
- tmpOffset = maxOffset/2 - listPtr->oldMaxOffset/2;
- } else {
- tmpOffset = listPtr->oldMaxOffset/2 - maxOffset/2;
- }
- tmpOffset -= tmpOffset % listPtr->xScrollUnit;
- if ((tmpOffset + listPtr->xOffset) > maxOffset) {
- tmpOffset = maxOffset - listPtr->xOffset;
- }
- if (tmpOffset < 0) {
- tmpOffset = 0;
- }
- if (listPtr->xOffset < tmpOffset2) {
- listPtr->xOffset += tmpOffset;
- } else {
- listPtr->xOffset -= tmpOffset;
- }
- } else {
- listPtr->xOffset = maxOffset/2;
- listPtr->xOffset -= listPtr->xOffset % listPtr->xScrollUnit;
- }
- listPtr->oldMaxOffset = maxOffset;
- }
ChangeListboxOffset(listPtr, listPtr->xOffset);
/*