--- a/DataSetColumn.st Sat Jul 06 22:32:10 2019 +0100
+++ b/DataSetColumn.st Sat Jul 25 15:50:28 2020 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1997 by Claus Gittinger / eXept Software AG
All Rights Reserved
@@ -19,7 +21,10 @@
showColSeparator showRowSeparator columnAlignment label
containsText columnAdaptor descWidth descMinWidth
longStringCompression minValue maxValue'
- classVariableNames:''
+ classVariableNames:'EditorType_None EditorType_ComboBox EditorType_ComboList
+ EditorType_CheckToggle EditorType_RadioButton
+ EditorType_InputField EditorType_Text EditorType_PopUpList
+ EditorType_rowSelector'
poolDictionaries:''
category:'Views-DataSet'
!
@@ -115,6 +120,78 @@
"
! !
+!DataSetColumn class methodsFor:'initialization'!
+
+initialize
+ EditorType_None := #None.
+ EditorType_ComboBox := #ComboBox.
+ EditorType_ComboList := #ComboList.
+ EditorType_CheckToggle := #CheckToggle.
+ EditorType_RadioButton := #RadioButton.
+ EditorType_InputField := #InputField.
+ EditorType_Text := #Text.
+ EditorType_PopUpList := #PopUpList.
+ EditorType_rowSelector := #rowSelector.
+
+ "Created: / 25-07-2020 / 15:10:59 / cg"
+! !
+
+!DataSetColumn class methodsFor:'constants'!
+
+editorType_CheckToggle
+ ^ EditorType_CheckToggle
+
+ "Created: / 25-07-2020 / 14:55:34 / cg"
+!
+
+editorType_ComboBox
+ ^ EditorType_ComboBox
+
+ "Created: / 25-07-2020 / 14:55:18 / cg"
+!
+
+editorType_ComboList
+ ^ EditorType_ComboList
+
+ "Created: / 25-07-2020 / 14:55:26 / cg"
+!
+
+editorType_InputField
+ ^ EditorType_InputField
+
+ "Created: / 25-07-2020 / 14:56:45 / cg"
+!
+
+editorType_None
+ ^ EditorType_None
+
+ "Created: / 25-07-2020 / 14:55:10 / cg"
+!
+
+editorType_PopUpList
+ ^ EditorType_PopUpList
+
+ "Created: / 25-07-2020 / 15:09:22 / cg"
+!
+
+editorType_RadioButton
+ ^ EditorType_RadioButton
+
+ "Created: / 25-07-2020 / 14:55:41 / cg"
+!
+
+editorType_Text
+ ^ EditorType_Text
+
+ "Created: / 25-07-2020 / 15:09:02 / cg"
+!
+
+editorType_rowSelector
+ ^ EditorType_rowSelector
+
+ "Created: / 25-07-2020 / 15:12:28 / cg"
+! !
+
!DataSetColumn class methodsFor:'utilities'!
shortenedStringFor:aString on:aGC maxWidth:maxWidth
@@ -471,7 +548,7 @@
].
width := width max:(self widthOfLabel:(self shownValueForRow:(dataSet at:listSize) rowNr:listSize))
].
- description editorType ~~ #None ifTrue:[
+ description editorType ~~ DataSetColumn editorType_None ifTrue:[
width := width + (dataSet font widthOn:dataSet device)
].
] ifFalse:[
@@ -487,7 +564,7 @@
].
^ width
- "Modified: / 25.2.2000 / 14:29:16 / cg"
+ "Modified: / 25-07-2020 / 15:28:35 / cg"
!
width: aWidth
@@ -651,7 +728,7 @@
"/ GET AND DRAW LABEL
"/ ==================
(self isRowVisible:aRowNr) ifTrue:[
- rendererType == #rowSelector ifTrue:[
+ rendererType == DataSetColumn editorType_rowSelector ifTrue:[
isSel ifTrue:[
label := dataSet rowSelectorForm.
x := x + hspace.
@@ -701,24 +778,26 @@
yT := yT + h
]
- "Modified: / 20-01-2011 / 08:50:18 / cg"
+ "Modified: / 25-07-2020 / 15:49:13 / cg"
!
drawRendererInRow:rowNr x:xLeft y:y width:cellWidth value:cellValue
- (rendererType == #ComboBox or:[rendererType == #ComboList]) ifTrue:[
+ (rendererType == EditorType_ComboBox or:[rendererType == EditorType_ComboList]) ifTrue:[
(self hasChoices:rowNr) ifTrue:[
dataSet drawComboButtonAtX:xLeft y:y w:cellWidth
].
^ self
].
- rendererType == #CheckToggle ifTrue:[
+ rendererType == EditorType_CheckToggle ifTrue:[
dataSet drawCheckToggleAtX:xLeft y:y w:cellWidth state:cellValue.
^ self
].
- rendererType == #RadioButton ifTrue:[
+ rendererType == EditorType_RadioButton ifTrue:[
dataSet drawRadioButtonAtX:xLeft y:y w:cellWidth state:cellValue.
^ self
].
+
+ "Modified: / 25-07-2020 / 15:11:41 / cg"
!
drawSeparatorsAtX:xLeft y:yTop h:h from:start to:stop
@@ -866,14 +945,14 @@
shownValueForRow:aRowOrNil rowNr:aRowNr
|aRow selector format value type choices translatedChoices idx converter|
- rendererType == #CheckToggle ifTrue:[
+ rendererType == EditorType_CheckToggle ifTrue:[
^ nil
].
- rendererType == #RadioButton ifTrue:[
+ rendererType == EditorType_RadioButton ifTrue:[
^ nil
].
- rendererType == #rowSelector ifTrue:[
+ rendererType == EditorType_rowSelector ifTrue:[
^ nil
].
@@ -930,7 +1009,7 @@
^ value
- "Modified: / 28-07-2010 / 20:42:51 / cg"
+ "Modified: / 25-07-2020 / 15:20:35 / cg"
! !
!DataSetColumn methodsFor:'editing'!
@@ -981,9 +1060,9 @@
description := aDescription.
rendererType := description rendererType.
- containsText := ( rendererType ~~ #CheckToggle
- and:[rendererType ~~ #RadioButton
- and:[rendererType ~~ #rowSelector]]
+ containsText := ( rendererType ~~ EditorType_CheckToggle
+ and:[rendererType ~~ EditorType_RadioButton
+ and:[rendererType ~~ DataSetColumn editorType_rowSelector]]
).
descWidth := description width.
longStringCompression := description longStringCompression.
@@ -1016,11 +1095,11 @@
foregroundColor := foregroundColor onDevice:dataSet device
].
- rendererType == #CheckToggle ifTrue:[
+ rendererType == EditorType_CheckToggle ifTrue:[
buttonExtent := dataSet checkToggleExtent.
^ self
].
- rendererType == #RadioButton ifTrue:[
+ rendererType == EditorType_RadioButton ifTrue:[
buttonExtent := dataSet radioButtonExtent.
^ self
].
@@ -1030,13 +1109,13 @@
^ self
].
- (rendererType == #ComboBox or:[rendererType == #ComboList]) ifTrue:[
+ (rendererType == EditorType_ComboBox or:[rendererType == EditorType_ComboList]) ifTrue:[
buttonExtent := dataSet comboButtonExtent.
] ifFalse:[
columnAlignment := description columnAlignment
].
- "Modified: / 25.2.2000 / 14:25:56 / cg"
+ "Modified: / 25-07-2020 / 15:49:17 / cg"
! !
!DataSetColumn methodsFor:'private'!
@@ -1258,13 +1337,15 @@
(bE := buttonExtent y) = 0 ifTrue:[
editorType := description editorType.
- (editorType == #ComboList or:[ editorType == #ComboBox]) ifTrue:[
+ (editorType == DataSetColumn editorType_ComboList or:[ editorType == DataSetColumn editorType_ComboBox]) ifTrue:[
bE := dataSet comboButtonExtent y.
].
].
^ h max:bE
"Modified: / 20-01-2011 / 18:03:45 / cg"
+ "Modified (format): / 29-07-2018 / 09:51:43 / Claus Gittinger"
+ "Modified: / 25-07-2020 / 15:40:32 / cg"
!
heightOfLabel:aLabel
@@ -1403,3 +1484,5 @@
^ '$Header$'
! !
+
+DataSetColumn initialize!