--- a/VariablePanel.st Thu Jul 19 17:07:48 2012 +0200
+++ b/VariablePanel.st Fri Jul 20 09:53:44 2012 +0200
@@ -885,77 +885,6 @@
ifAbsentPut:[(Depth2Image new) width: 62; height: 5; photometric:(#palette); bitsPerSample:(#(2 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@H@@@@@@ @@@@@@@@@B J@BB J@(@HJ@(@@@@@@@!!BDD !!BDHPBBDHP@@@@@@APE@HAPE@T@ E@T@@@@@@@@@@B@@@@@@H@@@@@@@b') ; colorMapFromArray:#[0 0 0 68 68 68 255 255 255]; mask:((Depth1Image new) width: 62; height: 5; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@J@@B @@@PLX)#FJX1?C )R%JT)R#8_A#JLX2#FGC>@@(@@J@@H@@a') ; yourself); yourself]
! !
-!VariablePanel methodsFor:'accessing'!
-
-isHorizontal
- ^ orientation == #horizontal
-!
-
-orientation
- "return my orientation; either #horizontal or #vertical"
-
- ^ orientation
-
- "Modified: 6.3.1996 / 18:08:45 / cg"
-!
-
-orientation:aSymbol
- "change my orientation; aSymbol must be one of #horizontal or #vertical.
- Changing implies a resize of my subViews."
-
- aSymbol ~~ orientation ifTrue:[
- orientation := aSymbol.
- self initCursor.
- self anyNonRelativeSubviews ifTrue:[
- self setupSubviews
- ].
- shown ifTrue:[
- self cursor:cursor.
- self sizeChanged:nil.
- self redrawIfShown.
- ]
- ]
-
- "Modified: 29.5.1996 / 16:22:35 / cg"
-!
-
-relativeCorners
- "the returned collection gives the corner-fractional value for each component;
- i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)"
-
- ^ self subViews
- collect:[:eachView |
- self isHorizontal ifTrue:[
- eachView relativeCorner x
- ] ifFalse:[
- eachView relativeCorner y
- ]
- ]
-!
-
-relativeCorners:aCollectionOfRelativeCornerPositions
- "the argument gives the corner-fractional value for each component;
- i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)"
-
- |pos|
-
- aCollectionOfRelativeCornerPositions size == self subViews size ifFalse:[^ self ].
-
- pos := 0.0.
- self subViews with:aCollectionOfRelativeCornerPositions
- do:[:eachView :eachCorner |
- self isHorizontal ifTrue:[
- eachView origin:(pos @ 0.0) corner:(eachCorner @ 1.0)
- ] ifFalse:[
- eachView origin:(0.0 @ pos) corner:(1.0 @ eachCorner)
- ].
- pos := eachCorner
- ].
- self realized ifTrue:[
- self resizeSubviews
- ].
-! !
-
!VariablePanel methodsFor:'accessing-look'!
barHeight
@@ -1103,6 +1032,71 @@
"Modified: 29.5.1996 / 16:22:24 / cg"
!
+orientation
+ "return my orientation; either #horizontal or #vertical"
+
+ ^ orientation
+
+ "Modified: 6.3.1996 / 18:08:45 / cg"
+!
+
+orientation:aSymbol
+ "change my orientation; aSymbol must be one of #horizontal or #vertical.
+ Changing implies a resize of my subViews."
+
+ aSymbol ~~ orientation ifTrue:[
+ orientation := aSymbol.
+ self initCursor.
+ self anyNonRelativeSubviews ifTrue:[
+ self setupSubviews
+ ].
+ shown ifTrue:[
+ self cursor:cursor.
+ self sizeChanged:nil.
+ self redrawIfShown.
+ ]
+ ]
+
+ "Modified: 29.5.1996 / 16:22:35 / cg"
+!
+
+relativeCorners
+ "the returned collection gives the corner-fractional value for each component;
+ i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)"
+
+ ^ self subViews
+ collect:[:eachView |
+ self isHorizontal ifTrue:[
+ eachView relativeCorner x
+ ] ifFalse:[
+ eachView relativeCorner y
+ ]
+ ]
+!
+
+relativeCorners:aCollectionOfRelativeCornerPositions
+ "the argument gives the corner-fractional value for each component;
+ i.e. for a 20-40-40 look, it would be #(0.2 0.6 1.0)"
+
+ |pos|
+
+ aCollectionOfRelativeCornerPositions size == self subViews size ifFalse:[^ self ].
+
+ pos := 0.0.
+ self subViews with:aCollectionOfRelativeCornerPositions
+ do:[:eachView :eachCorner |
+ self isHorizontal ifTrue:[
+ eachView origin:(pos @ 0.0) corner:(eachCorner @ 1.0)
+ ] ifFalse:[
+ eachView origin:(0.0 @ pos) corner:(1.0 @ eachCorner)
+ ].
+ pos := eachCorner
+ ].
+ self realized ifTrue:[
+ self resizeSubviews
+ ].
+!
+
setBarHeight:nPixel
"check whether snap matches to extent of bar otherwise disable snap"
@@ -1709,6 +1703,17 @@
redrawLocked := true
!
+redraw
+ "redraw all of the handles"
+
+ redrawLocked ~~ true ifTrue:[
+ "/ self clear.
+ self redrawHandlesFrom:1 to:(self subViews size)
+ ]
+
+ "Modified: 28.1.1997 / 17:54:15 / cg"
+!
+
redrawHandlesFrom:start to:stop
"redraw some handles and snaps"
@@ -2180,6 +2185,54 @@
"Modified: 28.1.1997 / 17:56:20 / cg"
!
+setupSubviewOrigins
+ "setup subviews origins
+ if we only have relative extents
+ (Variable Panels need relative origins and corners!!) (SV 16.1.95)"
+
+ |x y e eX eY subViews n "{ Class: SmallInteger }"|
+
+ x := y := 0.0.
+
+ subViews := self subViews.
+ n := subViews size.
+ 1 to:n do:[:index |
+ |view|
+
+ view := subViews at:index.
+ e := view relativeExtent.
+ e notNil ifTrue:[
+ view relativeExtent:nil.
+ eX := e x.
+ eY := e y.
+ index == n ifTrue:[
+ view origin:(x @ y) corner:(1.0 @ 1.0)
+ ] ifFalse:[
+ orientation == #vertical ifTrue:[
+ view origin:(x @ y) corner:(1.0 @ (y+eY))
+ ] ifFalse:[
+ view origin:(x @ y) corner:((x+eX) @ 1.0)
+ ].
+ ].
+ orientation == #vertical ifTrue:[
+ y := y + eY.
+ ] ifFalse:[
+ x := x + eX.
+ ]
+ ] ifFalse: [
+ view origin:(x @ y).
+ orientation == #vertical ifTrue:[
+ y := view relativeCorner y.
+ ] ifFalse:[
+ x := view relativeCorner x.
+ ]
+ ].
+ ]
+
+ "Modified: 21.8.1996 / 10:01:29 / stefan"
+ "Modified: 28.1.1997 / 17:55:21 / cg"
+!
+
setupSubviews
"setup subviews sizes (in case of non-relative sizes)"
@@ -2366,56 +2419,6 @@
"Modified: / 31-10-2010 / 12:47:16 / cg"
! !
-!VariablePanel methodsFor:'private-tableView protocol'!
-
-setupSubviewOrigins
- "setup subviews origins
- if we only have relative extents
- (Variable Panels need relative origins and corners!!) (SV 16.1.95)"
-
- |x y e eX eY subViews n "{ Class: SmallInteger }"|
-
- x := y := 0.0.
-
- subViews := self subViews.
- n := subViews size.
- 1 to:n do:[:index |
- |view|
-
- view := subViews at:index.
- e := view relativeExtent.
- e notNil ifTrue:[
- view relativeExtent:nil.
- eX := e x.
- eY := e y.
- index == n ifTrue:[
- view origin:(x @ y) corner:(1.0 @ 1.0)
- ] ifFalse:[
- orientation == #vertical ifTrue:[
- view origin:(x @ y) corner:(1.0 @ (y+eY))
- ] ifFalse:[
- view origin:(x @ y) corner:((x+eX) @ 1.0)
- ].
- ].
- orientation == #vertical ifTrue:[
- y := y + eY.
- ] ifFalse:[
- x := x + eX.
- ]
- ] ifFalse: [
- view origin:(x @ y).
- orientation == #vertical ifTrue:[
- y := view relativeCorner y.
- ] ifFalse:[
- x := view relativeCorner x.
- ]
- ].
- ]
-
- "Modified: 21.8.1996 / 10:01:29 / stefan"
- "Modified: 28.1.1997 / 17:55:21 / cg"
-! !
-
!VariablePanel methodsFor:'queries'!
hasSnapHandle
@@ -2424,6 +2427,10 @@
"Created: / 31-10-2010 / 12:43:21 / cg"
!
+isHorizontal
+ ^ orientation == #horizontal
+!
+
isLayoutWrapper
"answer true, if this view defines the layout of it's subviews"
@@ -2449,19 +2456,6 @@
].
! !
-!VariablePanel methodsFor:'redrawing'!
-
-redraw
- "redraw all of the handles"
-
- redrawLocked ~~ true ifTrue:[
- "/ self clear.
- self redrawHandlesFrom:1 to:(self subViews size)
- ]
-
- "Modified: 28.1.1997 / 17:54:15 / cg"
-! !
-
!VariablePanel::SnapAdornment methodsFor:'accessing'!
enterBgColor
@@ -2602,9 +2596,9 @@
!VariablePanel class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.93 2011-06-29 13:17:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.94 2012-07-20 07:53:44 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.93 2011-06-29 13:17:58 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/VariablePanel.st,v 1.94 2012-07-20 07:53:44 cg Exp $'
! !