--- a/VariableVerticalPanel.st Mon Feb 06 01:53:32 1995 +0100
+++ b/VariableVerticalPanel.st Mon Feb 06 01:55:07 1995 +0100
@@ -27,7 +27,7 @@
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
-$Header: /cvs/stx/stx/libwidg/VariableVerticalPanel.st,v 1.11 1994-11-28 21:05:40 claus Exp $
+$Header: /cvs/stx/stx/libwidg/VariableVerticalPanel.st,v 1.12 1995-02-06 00:54:57 claus Exp $
'!
!VariableVerticalPanel class methodsFor:'documentation'!
@@ -48,7 +48,7 @@
version
"
-$Header: /cvs/stx/stx/libwidg/VariableVerticalPanel.st,v 1.11 1994-11-28 21:05:40 claus Exp $
+$Header: /cvs/stx/stx/libwidg/VariableVerticalPanel.st,v 1.12 1995-02-06 00:54:57 claus Exp $
"
!
@@ -91,8 +91,7 @@
corner:1.0 @ 1.0
in:top.
v1 := ScrollableView for:SelectionInListView in:p.
- v1 origin:0.0 @ 0.0
- corner:1.0 @ 0.5.
+ v1 origin:0.0 @ 0.0 corner:1.0 @ 0.5.
v1 list:(FileDirectory directoryNamed:'/etc') contents.
v1 action:[:selNr |
|fullName stream text|
@@ -106,14 +105,12 @@
].
v2 := TextView
- origin:0.0 @ 0.5
- corner:1.0 @ 0.8
- in:p.
+ origin:0.0 @ 0.5 corner:1.0 @ 0.8 in:p.
+
v3 := ScrollableView
- for:EditTextView
+ for:TextView
in:p.
- v3 origin:0.0 @ 0.8
- corner:1.0 @ 1.0.
+ v3 origin:0.0 @ 0.8 corner:1.0 @ 1.0.
top open
"
! !
@@ -277,7 +274,7 @@
style:styleSymbol
"define the style of the handle;
styleSymbol may be #motif to draw a little knob or
- enything else to draw scrollBars handleForm"
+ anything else to draw scrollBars handleForm"
(styleSymbol ~~ handleStyle) ifTrue:[
handleStyle := styleSymbol.
@@ -304,6 +301,8 @@
!VariableVerticalPanel methodsFor:'drawing'!
drawHandleFormAtX:hx y:hy
+ "draw a handles bitmap at hx/hy"
+
self paint:shadowColor.
self displayForm:shadowForm x:hx y:hy.
self paint:lightColor.
@@ -312,6 +311,8 @@
!
drawHandleAtX:hx y:hy
+ "draw a single handle at hx/hy"
+
|h y m|
shadowForm notNil ifTrue:[
@@ -320,10 +321,10 @@
h := barHeight - 4
].
- self paint:viewBackground.
- self fillRectangleX:margin y:hy
- width:(width - margin - margin)
- height:barHeight.
+"/ self paint:viewBackground.
+"/ self fillRectangleX:margin y:hy
+"/ width:(width - margin - margin)
+"/ height:barHeight.
(handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
m := (barHeight - h) // 2.
@@ -395,9 +396,11 @@
movedHandle notNil ifTrue:[
self noClipByChildren.
self xoring:[
+ |y|
+
trackLine ifTrue:[
- self displayLineFromX:0 y:prev+(barHeight // 2)
- toX:width y:prev+(barHeight // 2).
+ y := prev+(barHeight // 2).
+ self displayLineFromX:0 y:y toX:width y:y.
] ifFalse:[
self fillRectangleX:0 y:prev width:width height:barHeight
]
@@ -409,7 +412,7 @@
!
redraw
- "redraw the handles"
+ "redraw all of the handles"
redrawLocked ~~ true ifTrue:[
self redrawHandlesFrom:1 to:(subViews size)
@@ -447,9 +450,11 @@
start := by - hy.
self noClipByChildren.
self xoring:[
+ |y|
+
trackLine ifTrue:[
- self displayLineFromX:0 y:hy+(barHeight // 2)
- toX:width y:hy+(barHeight // 2).
+ y := hy + (barHeight // 2).
+ self displayLineFromX:0 y:y toX:width y:y.
] ifFalse:[
self fillRectangleX:0 y:hy width:width height:barHeight
]
@@ -511,11 +516,14 @@
self noClipByChildren.
self xoring:[
+ |halfHeight y|
+
trackLine ifTrue:[
- self displayLineFromX:0 y:prev+(barHeight // 2)
- toX:width y:prev+(barHeight // 2).
- self displayLineFromX:0 y:ypos+(barHeight // 2)
- toX:width y:ypos+(barHeight // 2).
+ halfHeight := barHeight // 2.
+ y := prev + halfHeight.
+ self displayLineFromX:0 y:y toX:width y:y.
+ y := ypos + halfHeight.
+ self displayLineFromX:0 y:y toX:width y:y.
] ifFalse:[
self fillRectangleX:0 y:prev width:width height:barHeight.
self fillRectangleX:0 y:ypos width:width height:barHeight
@@ -537,9 +545,11 @@
self noClipByChildren.
self xoring:[
+ |y|
+
trackLine ifTrue:[
- self displayLineFromX:0 y:prev+(barHeight // 2)
- toX:width y:prev+(barHeight // 2).
+ y := prev + (barHeight // 2).
+ self displayLineFromX:0 y:y toX:width y:y.
] ifFalse:[
self fillRectangleX:0 y:prev width:width height:barHeight
].
@@ -550,6 +560,8 @@
aboveIndex := movedHandle.
belowIndex := movedHandle + 1.
+ movedHandle := nil.
+
aboveView := subViews at:aboveIndex.
belowView := subViews at:belowIndex.
@@ -557,14 +569,13 @@
newY := (prev + start / height) asFloat.
aboveView relativeCorner:aboveView relativeCorner x @ newY.
belowView relativeOrigin:belowView relativeOrigin x @ newY.
- movedHandle := nil.
+ redrawLocked := true.
oldY > newY ifTrue:[
self resizeSubviewsFrom:aboveIndex to:belowIndex.
] ifFalse:[
self resizeSubviewsFrom:belowIndex to:aboveIndex.
].
-
redrawLocked := true.
self redrawHandlesFrom:aboveIndex to:belowIndex.
redrawLocked := false.