--- a/VariableHorizontalPanel.st Thu Nov 23 11:44:18 1995 +0100
+++ b/VariableHorizontalPanel.st Thu Nov 23 15:37:40 1995 +0100
@@ -10,8 +10,6 @@
hereby transferred.
"
-'From Smalltalk/X, Version:2.10.5 on 14-mar-1995 at 11:10:40 am'!
-
VariableVerticalPanel subclass:#VariableHorizontalPanel
instanceVariableNames:''
classVariableNames:'DefaultCursor'
@@ -35,10 +33,6 @@
"
!
-version
- ^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanel.st,v 1.15 1995-11-14 20:27:51 cg Exp $'
-!
-
documentation
"
a View to separate its subviews horizontally by a movable bar
@@ -91,6 +85,135 @@
corner:1.0 @ 1.0.
top open
"
+!
+
+version
+ ^ '$Header: /cvs/stx/stx/libwidg/VariableHorizontalPanel.st,v 1.16 1995-11-23 14:36:56 cg Exp $'
+! !
+
+!VariableHorizontalPanel methodsFor:'drawing'!
+
+drawHandleAtX:hx y:hy
+ |w x m|
+
+ shadowForm notNil ifTrue:[
+ w := shadowForm width
+ ] ifFalse:[
+ w := barHeight - 4
+ ].
+
+ self paint:viewBackground.
+ self fillRectangleX:hx y:margin
+ width:barHeight
+ height:(height - margin - margin).
+
+ (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
+ m := (barHeight - w) // 2.
+ shadowForm isNil ifTrue:[
+ x := hx + (barHeight // 2).
+ separatingLine ifTrue:[
+ self paint:shadowColor.
+ self displayLineFromX:x y:margin toX:x y:(height - margin).
+ x := x + 1.
+ self paint:lightColor.
+ self displayLineFromX:x y:margin toX:x y:(height - margin).
+ ].
+ self paint:viewBackground.
+ self fillRectangleX:hx y:(hy - barWidth)
+ width:w
+ height:(barWidth + barWidth).
+
+ handleStyle == #line ifTrue:[
+ self paint:handleColor.
+ self displayLineFromX:x y:hy - barWidth toX:x y:hy + barWidth.
+ ] ifFalse:[
+ x := hx.
+ handleStyle == #st80 ifTrue:[
+ x := x - 1.
+ ].
+ self drawEdgesForX:(x + m)
+ y:(hy - barWidth)
+ width:w
+ height:(barWidth + barWidth)
+ level:handleLevel.
+ handleStyle == #iris ifTrue:[
+ self paint:handleColor.
+ self fillDeviceRectangleX:(x + m + 2)
+ y:(hy - barWidth + 2)
+ width:w - 4
+ height:(barWidth + barWidth - 4)
+ ].
+ ]
+ ] ifFalse:[
+ x := hx.
+ self drawHandleFormAtX:(x + m) y:hy
+ ].
+ handleStyle == #st80 ifTrue:[
+ x := hx - 1.
+ self paint:lightColor.
+ self displayLineFromX:x y:margin toX:x y:(height - margin).
+ self displayLineFromX:hx y:0 toX:(hx + barHeight - 1) y:0.
+ x := hx + barHeight - 2.
+ self paint:shadowColor.
+ self displayLineFromX:x y:margin toX:x y:(height - margin).
+ "uncomment the -1 if you dont like the notch at the bottom end"
+ " VVV"
+ self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeight - 1) y:height-1.
+ ].
+ ] ifFalse:[
+ x := hx + barHeight - 1.
+ self paint:handleColor.
+ separatingLine ifTrue:[
+ self displayLineFromX:hx+1 y:0 toX:hx+1 y:height.
+ self displayLineFromX:x y:0 toX:x y:height.
+ ].
+ self fillRectangleX:hx y:hy width:barHeight height:barWidth
+ ]
+
+ "Modified: 14.11.1995 / 20:30:12 / cg"
+!
+
+invertHandleBarAtX:hx y:hy
+ self noClipByChildren.
+ self xoring:[
+ |x|
+
+ trackLine ifTrue:[
+ x := hx + (barHeight // 2).
+ self displayLineFromX:x y:0 toX:x y:height.
+ ] ifFalse:[
+ self fillRectangleX:hx y:0 width:barHeight height:height
+ ]
+ ].
+ self clipByChildren.
+! !
+
+!VariableHorizontalPanel methodsFor:'initializing'!
+
+defaultControllerClass
+ ^ VariableHorizontalPanelController
+!
+
+initCursor
+ "set the cursor - a horizontal double arrow"
+
+ DefaultCursor notNil ifTrue:[
+ cursor := DefaultCursor
+ ] ifFalse:[
+ cursor := Cursor sourceForm:(Form fromFile:'VHPanel.xbm')
+ maskForm:(Form fromFile:'VHPanel_m.xbm')
+ hotX:8
+ hotY:8.
+ "
+ if bitmaps are not available, use a standard cursor
+ "
+ cursor isNil ifTrue:[
+ "which one looks better ?"
+ cursor := Cursor leftRightArrow
+ "cursor := Cursor leftLimitArrow"
+ ].
+ DefaultCursor := cursor
+ ]
! !
!VariableHorizontalPanel methodsFor:'private'!
@@ -197,33 +320,6 @@
]
!
-setupSubviewSizes
- "setup subviews sizes (in case of non-relative sizes)"
-
- |x w |
-
- self anyNonRelativeSubviews ifTrue:[
- "there is at least one subview without
- relative origin/extent - setup all subviews
- to spread evenly ..."
-
- x := 0.0.
- w := 1.0 / (subViews size).
-
- 1 to:(subViews size) do:[:index |
- |view|
-
- view := subViews at:index.
- index == subViews size ifTrue:[
- view origin:(x @ 0.0) corner:(1.0 @ 1.0)
- ] ifFalse:[
- view origin:(x @ 0.0) corner:((x + w) @ 1.0)
- ].
- x := x + w
- ]
- ]
-!
-
setupSubviewOrigins
"setup subviews origins (SV 16.1.95)"
@@ -251,130 +347,32 @@
].
]
-! !
-
-!VariableHorizontalPanel methodsFor:'initializing'!
-
-initCursor
- "set the cursor - a horizontal double arrow"
-
- DefaultCursor notNil ifTrue:[
- cursor := DefaultCursor
- ] ifFalse:[
- cursor := Cursor sourceForm:(Form fromFile:'VHPanel.xbm')
- maskForm:(Form fromFile:'VHPanel_m.xbm')
- hotX:8
- hotY:8.
- "
- if bitmaps are not available, use a standard cursor
- "
- cursor isNil ifTrue:[
- "which one looks better ?"
- cursor := Cursor leftRightArrow
- "cursor := Cursor leftLimitArrow"
- ].
- DefaultCursor := cursor
- ]
!
-defaultControllerClass
- ^ VariableHorizontalPanelController
+setupSubviewSizes
+ "setup subviews sizes (in case of non-relative sizes)"
+
+ |x w |
+
+ self anyNonRelativeSubviews ifTrue:[
+ "there is at least one subview without
+ relative origin/extent - setup all subviews
+ to spread evenly ..."
+
+ x := 0.0.
+ w := 1.0 / (subViews size).
+
+ 1 to:(subViews size) do:[:index |
+ |view|
+
+ view := subViews at:index.
+ index == subViews size ifTrue:[
+ view origin:(x @ 0.0) corner:(1.0 @ 1.0)
+ ] ifFalse:[
+ view origin:(x @ 0.0) corner:((x + w) @ 1.0)
+ ].
+ x := x + w
+ ]
+ ]
! !
-!VariableHorizontalPanel methodsFor:'drawing'!
-
-drawHandleAtX:hx y:hy
- |w x m|
-
- shadowForm notNil ifTrue:[
- w := shadowForm width
- ] ifFalse:[
- w := barHeight - 4
- ].
-
- self paint:viewBackground.
- self fillRectangleX:hx y:margin
- width:barHeight
- height:(height - margin - margin).
-
- (handleStyle ~~ #normal and:[handleStyle ~~ #mswindows]) ifTrue:[
- m := (barHeight - w) // 2.
- shadowForm isNil ifTrue:[
- x := hx + (barHeight // 2).
- separatingLine ifTrue:[
- self paint:shadowColor.
- self displayLineFromX:x y:margin toX:x y:(height - margin).
- x := x + 1.
- self paint:lightColor.
- self displayLineFromX:x y:margin toX:x y:(height - margin).
- ].
- self paint:viewBackground.
- self fillRectangleX:hx y:(hy - barWidth)
- width:w
- height:(barWidth + barWidth).
-
- handleStyle == #line ifTrue:[
- self paint:handleColor.
- self displayLineFromX:x y:hy - barWidth toX:x y:hy + barWidth.
- ] ifFalse:[
- x := hx.
- handleStyle == #st80 ifTrue:[
- x := x - 1.
- ].
- self drawEdgesForX:(x + m)
- y:(hy - barWidth)
- width:w
- height:(barWidth + barWidth)
- level:handleLevel.
- handleStyle == #iris ifTrue:[
- self paint:handleColor.
- self fillDeviceRectangleX:(x + m + 2)
- y:(hy - barWidth + 2)
- width:w - 4
- height:(barWidth + barWidth - 4)
- ].
- ]
- ] ifFalse:[
- x := hx.
- self drawHandleFormAtX:(x + m) y:hy
- ].
- handleStyle == #st80 ifTrue:[
- x := hx - 1.
- self paint:lightColor.
- self displayLineFromX:x y:margin toX:x y:(height - margin).
- self displayLineFromX:hx y:0 toX:(hx + barHeight - 1) y:0.
- x := hx + barHeight - 2.
- self paint:shadowColor.
- self displayLineFromX:x y:margin toX:x y:(height - margin).
- "uncomment the -1 if you dont like the notch at the bottom end"
- " VVV"
- self displayLineFromX:hx" "-1" " y:height-1 toX:(hx + barHeight - 1) y:height-1.
- ].
- ] ifFalse:[
- x := hx + barHeight - 1.
- self paint:handleColor.
- separatingLine ifTrue:[
- self displayLineFromX:hx+1 y:0 toX:hx+1 y:height.
- self displayLineFromX:x y:0 toX:x y:height.
- ].
- self fillRectangleX:hx y:hy width:barHeight height:barWidth
- ]
-
- "Modified: 14.11.1995 / 20:30:12 / cg"
-!
-
-invertHandleBarAtX:hx y:hy
- self noClipByChildren.
- self xoring:[
- |x|
-
- trackLine ifTrue:[
- x := hx + (barHeight // 2).
- self displayLineFromX:x y:0 toX:x y:height.
- ] ifFalse:[
- self fillRectangleX:hx y:0 width:barHeight height:height
- ]
- ].
- self clipByChildren.
-! !
-