--- a/VariablePanel.st Thu Mar 07 19:49:31 1996 +0100
+++ b/VariablePanel.st Fri Mar 08 11:53:23 1996 +0100
@@ -54,23 +54,76 @@
Typically creation is done as:
- p := VariablePanel in:superView.
- p orientation:#vertical.
+ p := VariablePanel in:superView.
+ p orientation:#vertical.
- v1 := <someViewClass> origin:0.0 @ 0.0
- corner:1.0 @ 0.5
- in:p.
- v2 := <someViewClass> origin:0.0 @ 0.5
- corner:1.0 @ 0.8
- in:p.
- v3 := <someViewClass> origin:0.0 @ 0.8
- corner:1.0 @ 1.0
- in:p.
+ v1 := <someViewClass> origin:0.0 @ 0.0
+ corner:1.0 @ 0.5
+ in:p.
+ v2 := <someViewClass> origin:0.0 @ 0.5
+ corner:1.0 @ 0.8
+ in:p.
+ v3 := <someViewClass> origin:0.0 @ 0.8
+ corner:1.0 @ 1.0
+ in:p.
+
+ The two subclasses VariableHorizontalPanel and VariableVerticalPanel
+ preset the orientation. They are a kept for backward compatibility
+ (in previous versions, there used to be no common VariablePanel (super-) class).
Notice: if it is required to insert a fixed-size view in the panel,
use an extra view & insets, and place the subview into that extra view.
see examples.
+
+
+
+ instanceVariables:
+
+ barHeight <Integer> the height of the bar (for verticalPanels)
+ barWidth <Integer> the width of the bar (for horizontalPanels)
+
+ separatingLine <Boolean> show a separating line (as in motif style)
+
+ shadowForm <Image/Form> form (shadow part) drawn as handle - if nonNil
+
+ lightForm <Image/Form> form (light part) drawn as handle - if nonNil
+
+ showHandle <Boolean> if false, no handle is drawn
+
+ handlePosition <Symbol> where is the handle - one of #left, #center, #right
+
+ handleColor <Color> inside color of handle - defaults to viewBackground
+
+ handleStyle <Symbol> type of handle; one of #next, #motif or nil
+
+ handleLevel <Integer> 3D level of handle (only valid if no form is given)
+
+ trackLine <Boolean> if true, an inverted line is drawn for tracking;
+ otherwise, the whole bar is inverted.
+
+ redrawLocked internal - locks redraws while tracking
+
+ orientation <Symbol> one of #horizontal / #vertical
+
+
+ styleSheet values:
+ variablePanelShowHandle true/false - should a handle be shown (default:true)
+
+ variablePanelHandleStyle #next / #motif / nil (special handles)
+
+ variablePanelHandlePosition #left / #center / #right (default:#right)
+
+ variablePanelHandleLevel 3D level of heandle (default:2)
+
+ variablePanelTrackingLine when moved, track an inverted line (as in motif)
+ as opposed to tracking the whole bar (default:false)
+
+ variablePanelSeparatingLine draw a separating line in the bar as in motif (default:false)
+
+ variablePanelHandleColor color of the handle. (default:Black)
+
+ variablePanelHandleEnteredColor color of the handle when the pointer is in the bar (default:nil)
"
!
@@ -831,50 +884,56 @@
!
initStyle
- |mm|
+ |mm h bH|
super initStyle.
handleColor := DefaultHandleColor on:device.
- handleLevel := DefaultHandleLevel.
-
- showHandle := DefaultShowHandle.
DefaultHandleStyle isNil ifTrue:[
- handleStyle := styleSheet name
+ handleStyle := styleSheet name
] ifFalse:[
- handleStyle := DefaultHandleStyle
- ].
- handleStyle == #next ifTrue:[
- shadowForm := self class shadowFormOn:device.
- lightForm := self class lightFormOn:device.
-
- self barHeight:(shadowForm height + 2).
- barWidth := shadowForm width.
- ] ifFalse:[
- shadowForm := lightForm := nil.
+ handleStyle := DefaultHandleStyle
].
+ handleLevel := DefaultHandleLevel.
+ showHandle := DefaultShowHandle.
handlePosition := DefaultHandlePosition.
trackLine := DefaultTrackingLine.
separatingLine := DefaultSeparatingLine.
- mm := device verticalPixelPerMillimeter.
- self is3D ifTrue:[
- self barHeight:(3 * mm) rounded
+ handleStyle == #next ifTrue:[
+ shadowForm := self class shadowFormOn:device.
+ lightForm := self class lightFormOn:device.
+
+ bH := shadowForm height + 2.
+ barWidth := shadowForm width.
] ifFalse:[
- self barHeight:(2 * mm) rounded
+ shadowForm := lightForm := nil.
+
+ mm := device verticalPixelPerMillimeter.
+ self is3D ifTrue:[
+ h := 3
+ ] ifFalse:[
+ h := 2
+ ].
+ bH := (h * mm) rounded.
+ barWidth := (2 * mm) rounded. "motif style width"
].
- barWidth := (2 * mm) rounded. "motif style width"
+ self barHeight:bH.
+
handleStyle == #mswindows ifTrue:[
- barWidth := (ArrowButton new direction:#up) width + 1
+ barWidth := (ArrowButton new direction:#up) width + 1
].
+
+ "Modified: 8.3.1996 / 11:51:59 / cg"
!
initialize
+ orientation isNil ifTrue:[orientation := #vertical].
super initialize.
- orientation := #vertical.
- noColor := Color noColor.
+
+ "Modified: 7.3.1996 / 14:08:25 / cg"
! !
!VariablePanel methodsFor:'private'!
@@ -1106,5 +1165,5 @@
!VariablePanel class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.8 1996-03-06 17:09:32 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.9 1996-03-08 10:53:01 cg Exp $'
! !