VariablePanelController.st
changeset 2252 67269562b687
parent 2245 e561458f9232
child 2260 ce3be65862db
--- a/VariablePanelController.st	Thu Aug 31 12:03:19 2000 +0200
+++ b/VariablePanelController.st	Fri Sep 01 16:22:15 2000 +0200
@@ -94,18 +94,24 @@
     "compute new position ...."
 
     nextPos := self checkedHandleMovementX:bx y:by.
+"/    nextPos = prevPos ifTrue:[
+"/        ^ self
+"/    ].
+
     opaqueResizing := UserPreferences current opaqueVariablePanelResizing == true.
 
     resizeMode == #active ifTrue:[
         "check position changed ..."
-        (prevPos  - nextPos) abs < 2 ifTrue:[^ self].
-
+"/        nextPos > 10 ifTrue:[
+"/            (prevPos - nextPos) abs < 2 ifTrue:[^ self].
+"/        ].
         opaqueResizing ifFalse:[
             self doInvertHandle   "undo the last invert"
         ]
     ] ifFalse:[
-        (clickPos - nextPos) abs < 5 ifTrue:[^ self].
-
+"/        nextPos > 10 ifTrue:[
+"/            (clickPos - nextPos) abs < 5 ifTrue:[^ self].
+"/        ].
         resizeMode := #active.
 
         "/ restore the snap cursor
@@ -196,7 +202,9 @@
                 aboveView := view subViews at:movedHandle.
                 aboveView objectAttributeAt:#vpext put:(aboveView relativeCorner).
             ].
-            self doResize
+            (UserPreferences current opaqueVariablePanelResizing == true) ifFalse:[
+                self doResize
+            ].
         ] ifFalse:[
             (    (layout := view snapLayoutAt:movedHandle) notNil
              and:[layout containsPointX:bx y:by]
@@ -244,30 +252,49 @@
 checkedHandleMovementX:bx y:by
     "check and return valid position a handle can be placed
     "
-    |max min pos subViews halfBarHeight|
+    |max min pos subViews halfBarHeight barHeight thisView nextView nextView2|
 
     subViews := view subViews.
+    barHeight := view barHeight.
 "/    halfBarHeight := view barHeight + 1 // 2.
-    halfBarHeight := view barHeight // 2.
+    halfBarHeight := barHeight // 2.
+
+    thisView := subViews at:movedHandle.
+    nextView := subViews at:movedHandle + 1.
+    nextView2 := subViews at:movedHandle + 2 ifAbsent:nil.
 
     view orientation == #vertical ifTrue:[
         pos := by.
-        min := (subViews at:movedHandle)     top.
-        max := (subViews at:movedHandle + 1) bottom.
+        min := thisView top.
+        nextView2 isNil ifTrue:[
+            max := view height.
+        ] ifFalse:[
+            max := nextView2 top.
+        ].
     ] ifFalse:[
         pos := bx.
-        min := (subViews at:movedHandle)     left.
-        max := (subViews at:movedHandle + 1) right.
+        min := thisView left.
+        nextView2 isNil ifTrue:[
+            max := view width.
+        ] ifFalse:[
+            max := nextView2 left.
+        ].
     ].
 
     min := min + halfBarHeight - 1.
-    view barHeight odd ifTrue:[ min := min + 1 ].
+    barHeight odd ifTrue:[ min := min + 1 ].
 
 "/    max := max - halfBarHeight.
-    max := max - halfBarHeight + 1.
+"/    movedHandle == (subViews size-1) ifTrue:[
+"/        max := max - barHeight + 2.
+"/    ] ifFalse:[
+        max := max - halfBarHeight + 1.
+        barHeight odd ifTrue:[ max := max - 1 ].
+"/    ].
 
     pos < min ifTrue:[^ min].
-    ^ pos min:max
+    pos > max ifTrue:[^ max].
+    ^ pos
 !
 
 detectHandleIndexAt:x y:y
@@ -375,9 +402,6 @@
 
     prevPos := isVertical ifTrue:[aboveView bottom] ifFalse:[aboveView right].
     prevPos := prevPos + (view barHeight + 1 // 2).
-
-
-
 !
 
 doSnapPressedX:x y:y
@@ -469,7 +493,7 @@
 !VariablePanelController class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.30 2000-08-30 10:15:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.31 2000-09-01 14:21:43 cg Exp $'
 
 
 ! !