--- a/VarPanelC.st Sat Apr 24 16:37:22 1999 +0200
+++ b/VarPanelC.st Sat Apr 24 17:47:34 1999 +0200
@@ -91,7 +91,7 @@
"speedup - if there is already another movement,
ignore thisone ... "
- view buttonMotionEventPending ifTrue:[^ self].
+"/ view buttonMotionEventPending ifTrue:[^ self].
subViews := view subViews.
barHeight := view barHeight.
@@ -166,10 +166,7 @@
prevPos := pos.
OpaqueResize == true ifTrue:[
- "/ simulate buttonRelease and repress,
- "/ to force immediate change
- self buttonRelease:1 x:bx y:by.
- self buttonPress:1 x:bx y:by.
+ self doResizeForX:bx y:by.
]
"Modified: / 13.11.1998 / 15:13:47 / cg"
@@ -215,13 +212,17 @@
thatsTheHandle ifTrue:[
movedHandle := handle.
- OpaqueResize ~~ true ifTrue:[
- view grabPointer.
- view invertHandleBarAtX:hx y:hy.
+ OpaqueResize == true ifTrue:[
+ view grabPointerWithCursor:view cursor.
].
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
+
+ OpaqueResize ~~ true ifTrue:[
+ view invertHandleBarAtX:hx y:hy.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
].
+
clickPos := bx @ by.
^ self
].
@@ -239,80 +240,89 @@
buttonRelease:button x:bx y:by
"end bar-move"
+ |group|
+
+ ((button == 1) or:[button == #select]) ifTrue:[
+ movedHandle isNil ifTrue:[^ self].
+
+ view ungrabPointer.
+ OpaqueResize ~~ true ifTrue:[
+ (group := view windowGroup) notNil ifTrue:[
+ group restoreCursors
+ ]
+ ].
+
+ self doResizeForX:bx y:by.
+ movedHandle := nil.
+
+ ] ifFalse:[
+ super buttonRelease:button x:bx y:by
+ ]
+
+ "Modified: / 11.3.1999 / 16:31:29 / cg"
+!
+
+doResizeForX:bx y:by
+ "end bar-move"
+
|aboveView belowView aboveIndex belowIndex
newPos oldPos group subViews
relCornerAbove fromIndex toIndex
hX hY isHorizontal newCorner newOrigin|
- ((button == 1) or:[button == #select]) ifTrue:[
- movedHandle isNil ifTrue:[^ self].
-
- isHorizontal := view orientation ~~ #vertical.
+ isHorizontal := view orientation ~~ #vertical.
- OpaqueResize ~~ true ifTrue:[
- view ungrabPointer.
- ].
-
- (group := view windowGroup) notNil ifTrue:[
- group restoreCursors
- ].
-
- "undo the last invert"
+ "undo the last invert"
- isHorizontal ifTrue:[
- hX := prevPos. hY := 0.
- ] ifFalse:[
- hX := 0. hY := prevPos.
- ].
- OpaqueResize ~~ true ifTrue:[
- view invertHandleBarAtX:hX y:hY.
- ].
+ isHorizontal ifTrue:[
+ hX := prevPos. hY := 0.
+ ] ifFalse:[
+ hX := 0. hY := prevPos.
+ ].
+ OpaqueResize ~~ true ifTrue:[
+ view invertHandleBarAtX:hX y:hY.
+ ].
- "/ any change ?
- ((isHorizontal and:[bx == clickPos x])
- or:[isHorizontal not and:[by == clickPos y]]) ifTrue:[
- movedHandle := nil.
- ^ self.
- ].
+ "/ any change ?
+ ((isHorizontal and:[bx == clickPos x])
+ or:[isHorizontal not and:[by == clickPos y]]) ifTrue:[
+ ^ self.
+ ].
- "compute the new relative heights"
+ "compute the new relative heights"
+
+ aboveIndex := movedHandle.
+ belowIndex := movedHandle + 1.
+ subViews := view subViews.
- aboveIndex := movedHandle.
- belowIndex := movedHandle + 1.
- movedHandle := nil.
- subViews := view subViews.
-
- aboveView := subViews at:aboveIndex.
- belowView := subViews at:belowIndex.
+ aboveView := subViews at:aboveIndex.
+ belowView := subViews at:belowIndex.
- relCornerAbove := aboveView relativeCorner.
- isHorizontal ifTrue:[
- oldPos := relCornerAbove x.
- newPos := (prevPos + startPos / view width) asFloat.
- newCorner := newPos @ relCornerAbove y.
- newOrigin := newPos @ belowView relativeOrigin y.
- ] ifFalse:[
- oldPos := relCornerAbove y.
- newPos := (prevPos + startPos / view height) asFloat.
- newCorner := relCornerAbove x @ newPos.
- newOrigin := belowView relativeOrigin x @ newPos.
- ].
- aboveView relativeCorner:newCorner.
- belowView relativeOrigin:newOrigin.
+ relCornerAbove := aboveView relativeCorner.
+ isHorizontal ifTrue:[
+ oldPos := relCornerAbove x.
+ newPos := (prevPos + startPos / view width) asFloat.
+ newCorner := newPos @ relCornerAbove y.
+ newOrigin := newPos @ belowView relativeOrigin y.
+ ] ifFalse:[
+ oldPos := relCornerAbove y.
+ newPos := (prevPos + startPos / view height) asFloat.
+ newCorner := relCornerAbove x @ newPos.
+ newOrigin := belowView relativeOrigin x @ newPos.
+ ].
+ aboveView relativeCorner:newCorner.
+ belowView relativeOrigin:newOrigin.
- view lockRedraw.
+ view lockRedraw.
- oldPos > newPos ifTrue:[
- fromIndex := aboveIndex. toIndex := belowIndex.
- ] ifFalse:[
- fromIndex := belowIndex. toIndex := aboveIndex.
- ].
- view resizeSubviewsFrom:fromIndex to:toIndex.
- view redrawHandlesFrom:aboveIndex to:belowIndex.
- view unlockRedraw.
+ oldPos > newPos ifTrue:[
+ fromIndex := aboveIndex. toIndex := belowIndex.
] ifFalse:[
- super buttonRelease:button x:bx y:by
- ]
+ fromIndex := belowIndex. toIndex := aboveIndex.
+ ].
+ view resizeSubviewsFrom:fromIndex to:toIndex.
+ view redrawHandlesFrom:aboveIndex to:belowIndex.
+ view unlockRedraw.
"Modified: / 11.3.1999 / 16:31:29 / cg"
!
@@ -329,5 +339,5 @@
!VariablePanelController class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarPanelC.st,v 1.21 1999-03-19 10:40:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/VarPanelC.st,v 1.22 1999-04-24 15:47:34 cg Exp $'
! !
--- a/VariablePanelController.st Sat Apr 24 16:37:22 1999 +0200
+++ b/VariablePanelController.st Sat Apr 24 17:47:34 1999 +0200
@@ -91,7 +91,7 @@
"speedup - if there is already another movement,
ignore thisone ... "
- view buttonMotionEventPending ifTrue:[^ self].
+"/ view buttonMotionEventPending ifTrue:[^ self].
subViews := view subViews.
barHeight := view barHeight.
@@ -166,10 +166,7 @@
prevPos := pos.
OpaqueResize == true ifTrue:[
- "/ simulate buttonRelease and repress,
- "/ to force immediate change
- self buttonRelease:1 x:bx y:by.
- self buttonPress:1 x:bx y:by.
+ self doResizeForX:bx y:by.
]
"Modified: / 13.11.1998 / 15:13:47 / cg"
@@ -215,13 +212,17 @@
thatsTheHandle ifTrue:[
movedHandle := handle.
- OpaqueResize ~~ true ifTrue:[
- view grabPointer.
- view invertHandleBarAtX:hx y:hy.
+ OpaqueResize == true ifTrue:[
+ view grabPointerWithCursor:view cursor.
].
- (group := view windowGroup) notNil ifTrue:[
- group showCursor:view cursor
+
+ OpaqueResize ~~ true ifTrue:[
+ view invertHandleBarAtX:hx y:hy.
+ (group := view windowGroup) notNil ifTrue:[
+ group showCursor:view cursor
+ ].
].
+
clickPos := bx @ by.
^ self
].
@@ -239,80 +240,89 @@
buttonRelease:button x:bx y:by
"end bar-move"
+ |group|
+
+ ((button == 1) or:[button == #select]) ifTrue:[
+ movedHandle isNil ifTrue:[^ self].
+
+ view ungrabPointer.
+ OpaqueResize ~~ true ifTrue:[
+ (group := view windowGroup) notNil ifTrue:[
+ group restoreCursors
+ ]
+ ].
+
+ self doResizeForX:bx y:by.
+ movedHandle := nil.
+
+ ] ifFalse:[
+ super buttonRelease:button x:bx y:by
+ ]
+
+ "Modified: / 11.3.1999 / 16:31:29 / cg"
+!
+
+doResizeForX:bx y:by
+ "end bar-move"
+
|aboveView belowView aboveIndex belowIndex
newPos oldPos group subViews
relCornerAbove fromIndex toIndex
hX hY isHorizontal newCorner newOrigin|
- ((button == 1) or:[button == #select]) ifTrue:[
- movedHandle isNil ifTrue:[^ self].
-
- isHorizontal := view orientation ~~ #vertical.
+ isHorizontal := view orientation ~~ #vertical.
- OpaqueResize ~~ true ifTrue:[
- view ungrabPointer.
- ].
-
- (group := view windowGroup) notNil ifTrue:[
- group restoreCursors
- ].
-
- "undo the last invert"
+ "undo the last invert"
- isHorizontal ifTrue:[
- hX := prevPos. hY := 0.
- ] ifFalse:[
- hX := 0. hY := prevPos.
- ].
- OpaqueResize ~~ true ifTrue:[
- view invertHandleBarAtX:hX y:hY.
- ].
+ isHorizontal ifTrue:[
+ hX := prevPos. hY := 0.
+ ] ifFalse:[
+ hX := 0. hY := prevPos.
+ ].
+ OpaqueResize ~~ true ifTrue:[
+ view invertHandleBarAtX:hX y:hY.
+ ].
- "/ any change ?
- ((isHorizontal and:[bx == clickPos x])
- or:[isHorizontal not and:[by == clickPos y]]) ifTrue:[
- movedHandle := nil.
- ^ self.
- ].
+ "/ any change ?
+ ((isHorizontal and:[bx == clickPos x])
+ or:[isHorizontal not and:[by == clickPos y]]) ifTrue:[
+ ^ self.
+ ].
- "compute the new relative heights"
+ "compute the new relative heights"
+
+ aboveIndex := movedHandle.
+ belowIndex := movedHandle + 1.
+ subViews := view subViews.
- aboveIndex := movedHandle.
- belowIndex := movedHandle + 1.
- movedHandle := nil.
- subViews := view subViews.
-
- aboveView := subViews at:aboveIndex.
- belowView := subViews at:belowIndex.
+ aboveView := subViews at:aboveIndex.
+ belowView := subViews at:belowIndex.
- relCornerAbove := aboveView relativeCorner.
- isHorizontal ifTrue:[
- oldPos := relCornerAbove x.
- newPos := (prevPos + startPos / view width) asFloat.
- newCorner := newPos @ relCornerAbove y.
- newOrigin := newPos @ belowView relativeOrigin y.
- ] ifFalse:[
- oldPos := relCornerAbove y.
- newPos := (prevPos + startPos / view height) asFloat.
- newCorner := relCornerAbove x @ newPos.
- newOrigin := belowView relativeOrigin x @ newPos.
- ].
- aboveView relativeCorner:newCorner.
- belowView relativeOrigin:newOrigin.
+ relCornerAbove := aboveView relativeCorner.
+ isHorizontal ifTrue:[
+ oldPos := relCornerAbove x.
+ newPos := (prevPos + startPos / view width) asFloat.
+ newCorner := newPos @ relCornerAbove y.
+ newOrigin := newPos @ belowView relativeOrigin y.
+ ] ifFalse:[
+ oldPos := relCornerAbove y.
+ newPos := (prevPos + startPos / view height) asFloat.
+ newCorner := relCornerAbove x @ newPos.
+ newOrigin := belowView relativeOrigin x @ newPos.
+ ].
+ aboveView relativeCorner:newCorner.
+ belowView relativeOrigin:newOrigin.
- view lockRedraw.
+ view lockRedraw.
- oldPos > newPos ifTrue:[
- fromIndex := aboveIndex. toIndex := belowIndex.
- ] ifFalse:[
- fromIndex := belowIndex. toIndex := aboveIndex.
- ].
- view resizeSubviewsFrom:fromIndex to:toIndex.
- view redrawHandlesFrom:aboveIndex to:belowIndex.
- view unlockRedraw.
+ oldPos > newPos ifTrue:[
+ fromIndex := aboveIndex. toIndex := belowIndex.
] ifFalse:[
- super buttonRelease:button x:bx y:by
- ]
+ fromIndex := belowIndex. toIndex := aboveIndex.
+ ].
+ view resizeSubviewsFrom:fromIndex to:toIndex.
+ view redrawHandlesFrom:aboveIndex to:belowIndex.
+ view unlockRedraw.
"Modified: / 11.3.1999 / 16:31:29 / cg"
!
@@ -329,5 +339,5 @@
!VariablePanelController class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.21 1999-03-19 10:40:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariablePanelController.st,v 1.22 1999-04-24 15:47:34 cg Exp $'
! !