DataSetColumn.st
changeset 2865 688eb125fe89
parent 2864 a2b8598dc659
child 2897 1ff11b4ffed5
--- a/DataSetColumn.st	Mon Nov 21 19:48:37 2005 +0100
+++ b/DataSetColumn.st	Tue Dec 13 17:51:39 2005 +0100
@@ -770,7 +770,7 @@
 !
 
 shownValueForRow:aRow rowNr:aRowNr
-    |selector format value|
+    |selector format value choices translatedChoices idx|
 
     rendererType == #CheckToggle ifTrue:[
         ^ nil
@@ -788,6 +788,16 @@
     ].
 
     value := self extractColFromRow:aRow rowNr:aRowNr.
+    description translatedChoices notNil ifTrue:[
+        choices := self choicesFor:aRow at:aRowNr.
+        idx := choices indexOf:value.
+        idx ~~ 0 ifTrue:[
+            translatedChoices := self translatedChoicesFor:aRow at:aRowNr.
+            translatedChoices notNil ifTrue:[
+                value := translatedChoices at:idx.
+            ].
+        ].
+    ].
 
     selector := description formatSelector.
     selector notNil ifTrue:[
@@ -1136,6 +1146,17 @@
     ^ description showSelectionHighLighted ~~ false
 !
 
+translatedChoicesFor:aRow at:aRowNr
+    |translatedChoicesSelector|
+
+    translatedChoicesSelector := description translatedChoices.
+
+    columnAdaptor notNil ifTrue:[
+        ^ columnAdaptor perform:translatedChoicesSelector withOptionalArgument:aRow and:columnNumber and:aRowNr and:dataSet
+    ].
+    ^ aRow perform:translatedChoicesSelector withOptionalArgument:aRowNr and:columnNumber and:dataSet
+!
+
 widthOfLabel:aLabel
     "returns the width of the label
     "
@@ -1197,5 +1218,5 @@
 !DataSetColumn class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetColumn.st,v 1.101 2005-11-21 18:48:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetColumn.st,v 1.102 2005-12-13 16:51:39 cg Exp $'
 ! !