VariableVerticalPanelController.st
changeset 105 3d064ba4a0cc
parent 98 987762f1f7ad
child 126 40228f4fd66b
--- a/VariableVerticalPanelController.st	Sat Mar 18 06:16:33 1995 +0100
+++ b/VariableVerticalPanelController.st	Sat Mar 18 06:16:50 1995 +0100
@@ -10,10 +10,10 @@
  hereby transferred.
 "
 
-'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:02'!
+'From Smalltalk/X, Version:2.10.4 on 6-mar-1995 at 20:00:05'!
 
-Controller subclass:#VariableVerticalPanelController
-	 instanceVariableNames:'movedHandle prev start'
+VariablePanelController subclass:#VariableVerticalPanelController
+	 instanceVariableNames:''
 	 classVariableNames:''
 	 poolDictionaries:''
 	 category:'Interface-Support'
@@ -37,134 +37,14 @@
 
 version
 "
-$Header: /cvs/stx/stx/libwidg/VariableVerticalPanelController.st,v 1.1 1995-03-06 21:06:04 claus Exp $
+$Header: /cvs/stx/stx/libwidg/VariableVerticalPanelController.st,v 1.2 1995-03-18 05:16:41 claus Exp $
 "
 ! !
 
-!VariableVerticalPanelController methodsFor:'event handling'!
-
-buttonMotion:button x:bx y:by
-    "mouse-button was moved while pressed;
-     clear prev handleBar and draw handle bar at new position" 
-
-    |ypos limitTop limitBot subViews barHeight|
-
-    movedHandle isNil ifTrue: [^ self].          "should not happen"
-
-    "speedup - if there is already another movement, 
-     ignore thisone ... "
-
-    view buttonMotionEventPending ifTrue:[^ self].
-
-    ypos := by - start.
-
-    "
-     the two lines below will not allow resizing down to zero
-     (so that some is always visible)
-    "
-"/    limitTop := barHeight // 2.
-"/    limitBot := self height - barHeight.
-
-    "
-     these allow resizing to zero - which is better ?
-    "
-    limitTop := 0.
-    limitBot := view innerHeight.
-    subViews := view subViews.
-    barHeight := view barHeight.
-
-    movedHandle > 1 ifTrue:[
-	limitTop := (subViews at:movedHandle) origin y + (barHeight // 2)
-    ].
-    movedHandle < (subViews size - 1) ifTrue:[
-	limitBot := (subViews at:(movedHandle + 2)) origin y - barHeight
-    ].
-    limitBot := limitBot - barHeight.
-    (ypos < limitTop) ifTrue:[ "check against view limits"
-	ypos := limitTop
-    ] ifFalse:[
-	(ypos > limitBot) ifTrue:[
-	    ypos := limitBot
-	]
-    ].
-
-    view invertHandleBarAtX:0 y:prev.
-    view invertHandleBarAtX:0 y:ypos.
-
-    prev := ypos
-!
-
-buttonRelease:button x:x y:y
-    "end bar-move"
-
-    |aboveView belowView aboveIndex belowIndex newY oldY group subViews|
-
-    ((button == 1) or:[button == #select]) ifTrue:[
-	movedHandle isNil ifTrue:[^ self].
+!VariableVerticalPanelController methodsFor:'initialization'!
 
-	(group := view windowGroup) notNil ifTrue:[
-	    group restoreCursors
-	].
-
-	"undo the last xor"
-
-	view invertHandleBarAtX:0 y:prev. 
-
-	"compute the new relative heights"
-
-	aboveIndex := movedHandle.
-	belowIndex := movedHandle + 1.
-	movedHandle := nil.
-	subViews := view subViews.
-
-	aboveView := subViews at:aboveIndex.
-	belowView := subViews at:belowIndex.
-
-	oldY := aboveView relativeCorner y.
-	newY := (prev + start / view height) asFloat.
-	aboveView relativeCorner:aboveView relativeCorner x @ newY.
-	belowView relativeOrigin:belowView relativeOrigin x @ newY.
+initialize
+    super initialize.
+    isHorizontal := false
+! !
 
-	view lockRedraw.
-	oldY > newY ifTrue:[
-	    view resizeSubviewsFrom:aboveIndex to:belowIndex.
-	] ifFalse:[
-	    view resizeSubviewsFrom:belowIndex to:aboveIndex.
-	].
-	view redrawHandlesFrom:aboveIndex to:belowIndex.
-	view unlockRedraw.
-    ] ifFalse:[
-	super buttonRelease:button x:x y:y
-    ]
-!
-
-buttonPress:button x:bx y:by
-    "button was pressed - if it hits a handle, start move"
-
-    |handle barHeight group|
-
-    ((button == 1) or:[button == #select]) ifTrue:[
-	handle := 1.
-	barHeight := view barHeight.
-	view handleOriginsDo:[:hPoint |
-	    |hy|
-
-	    hy := hPoint y.
-	    (by between:hy and:(hy + barHeight)) ifTrue:[
-		movedHandle := handle.
-		prev := hy.
-		start := by - hy.
-
-		view invertHandleBarAtX:0 y:hy.
-		(group := view windowGroup) notNil ifTrue:[
-		    group showCursor:view cursor
-		].
-		^ self
-	    ].
-	    handle := handle + 1
-	].
-	movedHandle := nil
-    ] ifFalse:[
-	super buttonPress:button x:bx y:by
-    ]
-! !