--- a/PrintConverter.st Wed May 03 20:15:57 1995 +0200
+++ b/PrintConverter.st Sat May 06 16:15:18 1995 +0200
@@ -9,7 +9,7 @@
version
"
-$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.1 1995-05-03 18:15:57 claus Exp $
+$Header: /cvs/stx/stx/libview2/PrintConverter.st,v 1.2 1995-05-06 14:14:34 claus Exp $
"
!
@@ -46,6 +46,17 @@
(conv readValueFrom:'12345') inspect
+ |conv|
+
+ conv := (PrintConverter new) initForYesNo.
+ (conv printStringFor:true).
+ (conv printStringFor:false).
+ (conv readValueFrom:'yes').
+ (conv readValueFrom:'no').
+ 'if language is german:'.
+ (conv readValueFrom:'ja').
+ (conv readValueFrom:'nein')
+
see concrete uses in the EditField examples.
"
! !
@@ -83,6 +94,12 @@
initForDate
valueToStringBlock := [:date | date printString].
stringToValueBlock := [:string | Date readFromString:string onError:[Date today]]
+!
+
+initForYesNo
+ valueToStringBlock := [:bool | bool ifTrue:[ApplicationModel classResources string:'yes']
+ ifFalse:[ApplicationModel classResources string:'no']].
+ stringToValueBlock := [:string | string = (ApplicationModel classResources string:'yes')]
! !
!PrintConverter methodsFor:'converting'!