--- a/DSVLabelView.st Tue Oct 26 19:51:26 1999 +0200
+++ b/DSVLabelView.st Wed Oct 27 14:22:45 1999 +0200
@@ -147,10 +147,53 @@
!
+redrawEdgesX:x y:yTop width:aWidth height:aHeight
+ "redraw the edges in the range
+ "
+ |tabXL desc drawWidth
+ maxX "{ Class:SmallInteger }"
+ h "{ Class:SmallInteger }"
+ x1 "{ Class:SmallInteger }"
+ x0 "{ Class:SmallInteger }"
+ |
+ maxX := (x + aWidth) min:(width - margin).
+ h := height - margin - margin.
+ x1 := dataSet xVisibleOfColNr:1.
+
+ columns keysAndValuesDo:[:aKey :aCol|
+ desc := aCol description.
+ x0 := x1.
+ x1 := x1 + aCol width.
+
+ aKey == selection ifTrue:[
+ (x1 > x and:[x0 < maxX]) ifTrue:[
+ dataSet drawEdgesAtX:x0 y:margin width:(x1 - x0) height:h level:-1 on:self.
+ ].
+ tabXL notNil ifTrue:[drawWidth := x0 - tabXL].
+ ] ifFalse:[
+ desc labelHasButtonLayout ifFalse:[
+ tabXL notNil ifTrue:[drawWidth := x0 - tabXL].
+ ] ifTrue:[
+ tabXL isNil ifTrue:[tabXL := x0].
+ desc labelIsPartOfGroup ifFalse:[drawWidth := x1 - tabXL].
+ ]
+ ].
+ drawWidth notNil ifTrue:[
+ ((tabXL + drawWidth) > x and:[tabXL < maxX]) ifTrue:[
+ dataSet drawEdgesAtX:tabXL y:margin width:drawWidth height:h level:1 on:self.
+ ].
+ drawWidth := tabXL := nil.
+ ]
+ ].
+ tabXL notNil ifTrue:[
+ dataSet drawEdgesAtX:tabXL y:margin width:(x1 - tabXL) height:h level:1 on:self
+ ]
+!
+
redrawX:x y:y width:w height:h
"redraw a rectangle
"
- |items savClip bg fg fgColor bgColor
+ |savClip bg fg fgColor bgColor
inset "{ Class:SmallInteger }"
maxX "{ Class:SmallInteger }"
lblH "{ Class:SmallInteger }"
@@ -193,19 +236,11 @@
bg := bgColor
].
- self paint:fg on:bg.
+ self paint:fg on:bg.
anItem redrawX:x0 w:wt h:height inset:inset on:self.
-
- selection == aKey ifTrue:[
- dataSet drawEdgesAtX:x0 y:margin width:wt height:lblH level:-1 on:self
- ] ifFalse:[
- anItem labelIsButton ifTrue:[
- dataSet drawEdgesAtX:x0 y:margin width:wt height:lblH level:1 on:self
- ]
- ]
]
].
-
+ self redrawEdgesX:x y:y width:w height:h.
self clippingRectangle:savClip.
@@ -503,5 +538,5 @@
!DSVLabelView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.30 1999-10-13 21:27:11 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/DSVLabelView.st,v 1.31 1999-10-27 12:21:45 ca Exp $'
! !
--- a/DataSetLabel.st Tue Oct 26 19:51:26 1999 +0200
+++ b/DataSetLabel.st Wed Oct 27 14:22:45 1999 +0200
@@ -1,18 +1,12 @@
Object subclass:#DataSetLabel
instanceVariableNames:'label selector argument adjust font fgColor bgColor
- preferredHeight preferredWidth labelIsButton'
+ preferredHeight preferredWidth'
classVariableNames:''
poolDictionaries:''
category:'Views-DataSet'
!
-!DataSetLabel methodsFor:'accessing'!
-
-labelIsButton
- ^ labelIsButton
-! !
-
!DataSetLabel methodsFor:'accessing colors'!
backgroundColor
@@ -116,14 +110,13 @@
description:aDescription builder:aBuilder on:aGC
|device gcFont|
- label := self resolveLabelFromDescription:aDescription withBuilder:aBuilder.
- selector := aDescription labelActionSelector.
- argument := (aDescription labelActionArgument) ? label.
- adjust := (aDescription labelAlignment) ? #left.
- device := aGC device.
- fgColor := aDescription labelForegroundColor.
- bgColor := aDescription labelBackgroundColor.
- labelIsButton := aDescription labelIsButton.
+ label := self resolveLabelFromDescription:aDescription withBuilder:aBuilder.
+ selector := aDescription labelActionSelector.
+ argument := (aDescription labelActionArgument) ? label.
+ adjust := (aDescription labelAlignment) ? #left.
+ device := aGC device.
+ fgColor := aDescription labelForegroundColor.
+ bgColor := aDescription labelBackgroundColor.
fgColor notNil ifTrue:[ fgColor := fgColor onDevice:device ].
bgColor notNil ifTrue:[ bgColor := bgColor onDevice:device ].
@@ -241,6 +234,16 @@
!DataSetLabel methodsFor:'queries'!
+hasSeparator
+ |l|
+
+ label size == 1 ifTrue:[
+"/ ^ (label at:1) ~= 'Alarm'
+ ^ (label at:1) ~= 'Area'
+ ].
+ ^ true
+!
+
isSelectable
"returns true if the item is selectable; a valid selector
to notify the receiver for a release button event exists
@@ -253,5 +256,5 @@
!DataSetLabel class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libwidg2/DataSetLabel.st,v 1.7 1999-10-14 07:51:07 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libwidg2/DataSetLabel.st,v 1.8 1999-10-27 12:22:45 ca Exp $'
! !