--- a/SelListV.st Wed Feb 28 19:48:03 1996 +0100
+++ b/SelListV.st Wed Feb 28 19:48:46 1996 +0100
@@ -1375,6 +1375,142 @@
^ super update:something with:aParameter from:changedObject
! !
+!SelectionInListView methodsFor:'drawing'!
+
+drawRightArrowInVisibleLine:visLineNr
+ "draw a right arrow (for submenus).
+ This method is not used here, but provided for subclasses such
+ as menus or file-lists."
+
+ |y x form form2 topLeftColor botRightColor t|
+
+ x := width - 16.
+ y := (self yOfVisibleLine:visLineNr).
+
+ (device depth == 1 or:[arrowLevel == 0]) ifTrue:[
+ form := self class rightArrowFormOn:device.
+ form notNil ifTrue:[
+ y := y + ((font height - form height) // 2).
+ (self isInSelection:(self visibleLineToListLine:visLineNr)) ifTrue:[
+ self foreground:hilightFgColor
+ ] ifFalse:[
+ self foreground:fgColor.
+ ].
+ self displayForm:form x:x y:y.
+ ]
+ ] ifFalse:[
+ smallArrow ifTrue:[
+ form := self class smallRightArrowLightFormOn:device.
+ form2 := self class smallRightArrowShadowFormOn:device.
+ ] ifFalse:[
+ form := self class rightArrowLightFormOn:device.
+ form2 := self class rightArrowShadowFormOn:device.
+ ].
+ (form isNil or:[form2 isNil]) ifTrue:[
+ "/ very bad conditions
+ ^ self
+ ].
+ y := y + ((font height - form height) // 2).
+
+ topLeftColor := lightColor.
+ botRightColor := shadowColor.
+
+ "openwin arrow stays down"
+ styleSheet name ~~ #openwin ifTrue:[
+ (self isInSelection:(self visibleLineToListLine:visLineNr)) ifTrue:[
+ t := topLeftColor.
+ topLeftColor := botRightColor.
+ botRightColor := t.
+ ]
+ ].
+ arrowLevel < 0 ifTrue:[
+ t := topLeftColor.
+ topLeftColor := botRightColor.
+ botRightColor := t.
+ ].
+
+"/ self foreground:topLeftColor.
+self paint:topLeftColor.
+ self displayForm:form x:x y:y.
+"/ self foreground:botRightColor.
+self paint:botRightColor.
+ self displayForm:form2 x:x y:y.
+ ]
+!
+
+drawVisibleLineSelected:visLineNr
+ "redraw a single line as selected."
+
+ self drawVisibleLineSelected:visLineNr with:hilightFgColor and:hilightBgColor
+
+ "Modified: 31.8.1995 / 19:24:09 / claus"
+ "Modified: 28.2.1996 / 18:40:52 / cg"
+!
+
+drawVisibleLineSelected:visLineNr with:fg and:bg
+ "redraw a single line as selected."
+
+ |listLine
+ y "{ Class: SmallInteger }"
+ y2 "{ Class: SmallInteger }"
+ wEdge|
+
+ listLine := self visibleLineToListLine:visLineNr.
+ listLine notNil ifTrue:[
+ strikeOut ifTrue:[
+ self drawVisibleLine:visLineNr with:fgColor and:bgColor.
+ y := self yOfVisibleLine:visLineNr.
+
+ self paint:fgColor.
+ y := y + (fontHeight // 2).
+ self displayLineFromX:0 y:y toX:width y:y.
+ ^ self
+ ].
+
+ self drawVisibleLine:visLineNr with:fg and:bg.
+ y := (self yOfVisibleLine:visLineNr) - (lineSpacing//2).
+
+ "
+ a line above and below
+ "
+ hilightFrameColor notNil ifTrue:[
+ hilightLevel == 0 ifTrue:[
+ self paint:hilightFrameColor.
+ self displayLineFromX:0 y:y toX:width y:y.
+ y2 := y + fontHeight - 1.
+ self displayLineFromX:0 y:y2 toX:width y:y2.
+ ^ self
+ ]
+ ].
+
+ "
+ an edge it around
+ "
+ (hilightLevel ~~ 0) ifTrue:[
+ "
+ let edge start at left, extending to the full width
+ XXX: widthOfContents should be cached in ListView
+ (instead of recomputing all over)
+ "
+ wEdge := width-(2 * margin).
+ includesNonStrings ifFalse:[
+ wEdge := wEdge max:(self widthOfContents).
+ ].
+ self drawEdgesForX:(margin - leftOffset) y:y
+ width:wEdge+leftOffset height:fontHeight
+ level:hilightLevel.
+
+
+ ].
+ ^ self
+ ].
+ ^ super drawVisibleLine:visLineNr with:fg and:bg
+
+ "Modified: 31.8.1995 / 19:24:09 / claus"
+ "Modified: 17.11.1995 / 09:36:25 / cg"
+ "Created: 28.2.1996 / 18:40:21 / cg"
+! !
+
!SelectionInListView methodsFor:'event handling'!
buttonMotion:buttonMask x:x y:y
@@ -2063,132 +2199,6 @@
!SelectionInListView methodsFor:'redrawing'!
-drawRightArrowInVisibleLine:visLineNr
- "draw a right arrow (for submenus).
- This method is not used here, but provided for subclasses such
- as menus or file-lists."
-
- |y x form form2 topLeftColor botRightColor t|
-
- x := width - 16.
- y := (self yOfVisibleLine:visLineNr).
-
- (device depth == 1 or:[arrowLevel == 0]) ifTrue:[
- form := self class rightArrowFormOn:device.
- form notNil ifTrue:[
- y := y + ((font height - form height) // 2).
- (self isInSelection:(self visibleLineToListLine:visLineNr)) ifTrue:[
- self foreground:hilightFgColor
- ] ifFalse:[
- self foreground:fgColor.
- ].
- self displayForm:form x:x y:y.
- ]
- ] ifFalse:[
- smallArrow ifTrue:[
- form := self class smallRightArrowLightFormOn:device.
- form2 := self class smallRightArrowShadowFormOn:device.
- ] ifFalse:[
- form := self class rightArrowLightFormOn:device.
- form2 := self class rightArrowShadowFormOn:device.
- ].
- (form isNil or:[form2 isNil]) ifTrue:[
- "/ very bad conditions
- ^ self
- ].
- y := y + ((font height - form height) // 2).
-
- topLeftColor := lightColor.
- botRightColor := shadowColor.
-
- "openwin arrow stays down"
- styleSheet name ~~ #openwin ifTrue:[
- (self isInSelection:(self visibleLineToListLine:visLineNr)) ifTrue:[
- t := topLeftColor.
- topLeftColor := botRightColor.
- botRightColor := t.
- ]
- ].
- arrowLevel < 0 ifTrue:[
- t := topLeftColor.
- topLeftColor := botRightColor.
- botRightColor := t.
- ].
-
-"/ self foreground:topLeftColor.
-self paint:topLeftColor.
- self displayForm:form x:x y:y.
-"/ self foreground:botRightColor.
-self paint:botRightColor.
- self displayForm:form2 x:x y:y.
- ]
-!
-
-drawVisibleLineSelected:visLineNr
- "redraw a single line as selected."
-
- |listLine fg bg
- y "{ Class: SmallInteger }"
- y2 "{ Class: SmallInteger }"
- wEdge|
-
- bg := hilightBgColor.
- fg := hilightFgColor.
- listLine := self visibleLineToListLine:visLineNr.
- listLine notNil ifTrue:[
- strikeOut ifTrue:[
- self drawVisibleLine:visLineNr with:fgColor and:bgColor.
- y := self yOfVisibleLine:visLineNr.
-
- self paint:fgColor.
- y := y + (fontHeight // 2).
- self displayLineFromX:0 y:y toX:width y:y.
- ^ self
- ].
-
- self drawVisibleLine:visLineNr with:fg and:bg.
- y := (self yOfVisibleLine:visLineNr) - (lineSpacing//2).
-
- "
- a line above and below
- "
- hilightFrameColor notNil ifTrue:[
- hilightLevel == 0 ifTrue:[
- self paint:hilightFrameColor.
- self displayLineFromX:0 y:y toX:width y:y.
- y2 := y + fontHeight - 1.
- self displayLineFromX:0 y:y2 toX:width y:y2.
- ^ self
- ]
- ].
-
- "
- an edge it around
- "
- (hilightLevel ~~ 0) ifTrue:[
- "
- let edge start at left, extending to the full width
- XXX: widthOfContents should be cached in ListView
- (instead of recomputing all over)
- "
- wEdge := width-(2 * margin).
- includesNonStrings ifFalse:[
- wEdge := wEdge max:(self widthOfContents).
- ].
- self drawEdgesForX:(margin - leftOffset) y:y
- width:wEdge+leftOffset height:fontHeight
- level:hilightLevel.
-
-
- ].
- ^ self
- ].
- ^ super drawVisibleLine:visLineNr with:fg and:bg
-
- "Modified: 31.8.1995 / 19:24:09 / claus"
- "Modified: 17.11.1995 / 09:36:25 / cg"
-!
-
redrawElement:aNumber
"redraw an individual element"
@@ -2677,5 +2687,5 @@
!SelectionInListView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg/Attic/SelListV.st,v 1.56 1996-02-26 19:04:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg/Attic/SelListV.st,v 1.57 1996-02-28 18:48:46 cg Exp $'
! !