checkin from browser
authorClaus Gittinger <cg@exept.de>
Wed, 29 Oct 1997 17:10:44 +0100
changeset 726 cdab756aebe4
parent 725 3a52a52576cb
child 727 74603345637d
checkin from browser
ActiveHelp.st
TypeConv.st
TypeConverter.st
--- a/ActiveHelp.st	Tue Oct 28 21:00:40 1997 +0100
+++ b/ActiveHelp.st	Wed Oct 29 17:10:44 1997 +0100
@@ -729,19 +729,19 @@
 
     self hideHelp.
     applicationsOrTopViewsWithHelp remove:anApp ifAbsent:nil.
-    listeningForAll ifFalse:[
+    listeningForAll == true ifFalse:[
         applicationsOrTopViewsWithHelp size == 0 ifTrue:[
             super unlisten.
         ]
     ]
 
-    "Modified: / 26.10.1997 / 23:17:43 / cg"
     "Created: / 26.10.1997 / 23:22:42 / cg"
+    "Modified: / 29.10.1997 / 15:48:34 / cg"
 ! !
 
 !ActiveHelp class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.29 1997-10-28 18:43:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/ActiveHelp.st,v 1.30 1997-10-29 16:10:29 cg Exp $'
 ! !
 ActiveHelp initialize!
--- a/TypeConv.st	Tue Oct 28 21:00:40 1997 +0100
+++ b/TypeConv.st	Wed Oct 29 17:10:44 1997 +0100
@@ -155,7 +155,7 @@
     "Created: 21.2.1997 / 18:45:39 / cg"
 ! !
 
-!TypeConverter methodsFor:'initialize-release'!
+!TypeConverter methodsFor:'standard converters'!
 
 arrayLiteralOrSymbolOrNil
     "setup the converter to convert from a string to either a literal
@@ -311,6 +311,52 @@
     "Created: 21.2.1997 / 18:58:38 / cg"
 !
 
+numberOrSymbolOrNil
+    "setup the converter to convert from a string to either a numeric literal
+     or a symbol and vice versa. 
+     Invalid strings (i.e. empty) are converted to nil;
+     nil values are converted to an empty string.
+     This is a very special converter (for the GUI builder) 
+     - probably not belonging to here"
+
+    self
+        getBlock:[:model |
+                |litValue|
+
+                (litValue := model value) isNil ifTrue:[
+                    String new
+                ] ifFalse:[
+                    litValue storeString
+                ]]
+
+        putBlock:
+                [:model :string |
+
+                |value s|
+
+                string isEmpty ifTrue:[
+                    value := nil
+                ] ifFalse:[
+                    value := Number readFrom:string onError:nil.
+                    value isNil ifTrue:[
+                        s := string withoutSeparators.
+                        (s startsWith:'#') ifTrue:[
+                            s := s copyFrom:2.
+                            (s startsWith:$') ifTrue:[
+                                s := s copyFrom:2 to:(s size - 1)
+                            ].
+                        ].
+                        value := s asSymbol
+                    ]
+                ].
+                model value:value]
+
+        updateBlock: [:m :a :p | true]
+
+    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Created: / 29.10.1997 / 15:49:26 / cg"
+!
+
 numberToText
     "setup the converter to convert from a string to a number
      and vice versa."
@@ -319,9 +365,9 @@
         getBlock:[:model |
                 |numericValue|
 
-                (numericValue := model value) isNil ifTrue:[
+                (numericValue := model value) isNumber ifFalse:[
                     String new
-                ] ifFalse:[
+                ] ifTrue:[
                     numericValue printString
                 ]]
 
@@ -339,8 +385,8 @@
 
         updateBlock: [:m :a :p | true]
 
-    "Created: 21.2.1997 / 18:57:05 / cg"
-    "Modified: 4.3.1997 / 11:50:29 / cg"
+    "Created: / 21.2.1997 / 18:57:05 / cg"
+    "Modified: / 29.10.1997 / 15:49:21 / cg"
 !
 
 numberToTextFormattedBy:formatString
@@ -376,6 +422,33 @@
     "Modified: 21.2.1997 / 18:59:44 / cg"
 !
 
+smalltalkObject
+    "setup the converter to convert from a string to any smalltalk object
+     and vice versa. The string used is the objects storeString.
+     Invalid strings (i.e. empty) are converted to nil.
+     This is a very special converter (for the GUI builder) 
+     - probably not belonging to here"
+
+    self
+        getBlock:[:model |
+                     model value storeString , ' "' , model value class name , '" '
+                 ]
+
+        putBlock:
+                [:model :string |
+
+                    |value|
+
+                    value := Object readFrom:string onError:nil.
+                    model value:value
+                ]
+
+        updateBlock: [:m :a :p | true]
+
+    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Created: / 29.10.1997 / 15:50:16 / cg"
+!
+
 symbolOrNil
     "setup the converter to convert from a string to a symbol
      and vice versa. Invalid symbols (i.e. empty) are converted to nil;
@@ -385,10 +458,10 @@
         getBlock:[:model |
                 |symbolValue|
 
-                (symbolValue := model value) isNil ifTrue:[
+                (symbolValue := model value) isSymbol ifFalse:[
                     String new
-                ] ifFalse:[
-                    '#' , symbolValue asString
+                ] ifTrue:[
+                    symbolValue storeString
                 ]]
 
         putBlock:
@@ -401,7 +474,10 @@
                 ] ifFalse:[
                     s := string withoutSeparators.
                     (s startsWith:'#') ifTrue:[
-                        s := s copyFrom:2
+                        s := s copyFrom:2.
+                        (s startsWith:$') ifTrue:[
+                            s := s copyFrom:2 to:(s size - 1)
+                        ]
                     ].
                     value := s asSymbol
                 ].
@@ -410,7 +486,7 @@
         updateBlock: [:m :a :p | true]
 
     "Created: / 21.2.1997 / 18:58:38 / cg"
-    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Modified: / 29.10.1997 / 15:49:25 / cg"
 !
 
 timeOrNil
@@ -480,5 +556,5 @@
 !TypeConverter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/Attic/TypeConv.st,v 1.7 1997-10-28 19:32:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/Attic/TypeConv.st,v 1.8 1997-10-29 16:10:44 cg Exp $'
 ! !
--- a/TypeConverter.st	Tue Oct 28 21:00:40 1997 +0100
+++ b/TypeConverter.st	Wed Oct 29 17:10:44 1997 +0100
@@ -155,7 +155,7 @@
     "Created: 21.2.1997 / 18:45:39 / cg"
 ! !
 
-!TypeConverter methodsFor:'initialize-release'!
+!TypeConverter methodsFor:'standard converters'!
 
 arrayLiteralOrSymbolOrNil
     "setup the converter to convert from a string to either a literal
@@ -311,6 +311,52 @@
     "Created: 21.2.1997 / 18:58:38 / cg"
 !
 
+numberOrSymbolOrNil
+    "setup the converter to convert from a string to either a numeric literal
+     or a symbol and vice versa. 
+     Invalid strings (i.e. empty) are converted to nil;
+     nil values are converted to an empty string.
+     This is a very special converter (for the GUI builder) 
+     - probably not belonging to here"
+
+    self
+        getBlock:[:model |
+                |litValue|
+
+                (litValue := model value) isNil ifTrue:[
+                    String new
+                ] ifFalse:[
+                    litValue storeString
+                ]]
+
+        putBlock:
+                [:model :string |
+
+                |value s|
+
+                string isEmpty ifTrue:[
+                    value := nil
+                ] ifFalse:[
+                    value := Number readFrom:string onError:nil.
+                    value isNil ifTrue:[
+                        s := string withoutSeparators.
+                        (s startsWith:'#') ifTrue:[
+                            s := s copyFrom:2.
+                            (s startsWith:$') ifTrue:[
+                                s := s copyFrom:2 to:(s size - 1)
+                            ].
+                        ].
+                        value := s asSymbol
+                    ]
+                ].
+                model value:value]
+
+        updateBlock: [:m :a :p | true]
+
+    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Created: / 29.10.1997 / 15:49:26 / cg"
+!
+
 numberToText
     "setup the converter to convert from a string to a number
      and vice versa."
@@ -319,9 +365,9 @@
         getBlock:[:model |
                 |numericValue|
 
-                (numericValue := model value) isNil ifTrue:[
+                (numericValue := model value) isNumber ifFalse:[
                     String new
-                ] ifFalse:[
+                ] ifTrue:[
                     numericValue printString
                 ]]
 
@@ -339,8 +385,8 @@
 
         updateBlock: [:m :a :p | true]
 
-    "Created: 21.2.1997 / 18:57:05 / cg"
-    "Modified: 4.3.1997 / 11:50:29 / cg"
+    "Created: / 21.2.1997 / 18:57:05 / cg"
+    "Modified: / 29.10.1997 / 15:49:21 / cg"
 !
 
 numberToTextFormattedBy:formatString
@@ -376,6 +422,33 @@
     "Modified: 21.2.1997 / 18:59:44 / cg"
 !
 
+smalltalkObject
+    "setup the converter to convert from a string to any smalltalk object
+     and vice versa. The string used is the objects storeString.
+     Invalid strings (i.e. empty) are converted to nil.
+     This is a very special converter (for the GUI builder) 
+     - probably not belonging to here"
+
+    self
+        getBlock:[:model |
+                     model value storeString , ' "' , model value class name , '" '
+                 ]
+
+        putBlock:
+                [:model :string |
+
+                    |value|
+
+                    value := Object readFrom:string onError:nil.
+                    model value:value
+                ]
+
+        updateBlock: [:m :a :p | true]
+
+    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Created: / 29.10.1997 / 15:50:16 / cg"
+!
+
 symbolOrNil
     "setup the converter to convert from a string to a symbol
      and vice versa. Invalid symbols (i.e. empty) are converted to nil;
@@ -385,10 +458,10 @@
         getBlock:[:model |
                 |symbolValue|
 
-                (symbolValue := model value) isNil ifTrue:[
+                (symbolValue := model value) isSymbol ifFalse:[
                     String new
-                ] ifFalse:[
-                    '#' , symbolValue asString
+                ] ifTrue:[
+                    symbolValue storeString
                 ]]
 
         putBlock:
@@ -401,7 +474,10 @@
                 ] ifFalse:[
                     s := string withoutSeparators.
                     (s startsWith:'#') ifTrue:[
-                        s := s copyFrom:2
+                        s := s copyFrom:2.
+                        (s startsWith:$') ifTrue:[
+                            s := s copyFrom:2 to:(s size - 1)
+                        ]
                     ].
                     value := s asSymbol
                 ].
@@ -410,7 +486,7 @@
         updateBlock: [:m :a :p | true]
 
     "Created: / 21.2.1997 / 18:58:38 / cg"
-    "Modified: / 26.10.1997 / 13:50:32 / cg"
+    "Modified: / 29.10.1997 / 15:49:25 / cg"
 !
 
 timeOrNil
@@ -480,5 +556,5 @@
 !TypeConverter class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/TypeConverter.st,v 1.7 1997-10-28 19:32:28 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/TypeConverter.st,v 1.8 1997-10-29 16:10:44 cg Exp $'
 ! !