UIPainterView.st
changeset 149 e652608690b1
parent 146 ae84facd80be
child 154 34d5602e13d7
--- a/UIPainterView.st	Mon Jun 16 11:34:16 1997 +0200
+++ b/UIPainterView.st	Mon Jun 16 11:36:46 1997 +0200
@@ -24,13 +24,6 @@
 	privateIn:UIPainterView
 !
 
-UIPainterView::ViewProperty subclass:#GroupProperties
-	instanceVariableNames:'controlledObjects group name'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:UIPainterView
-!
-
 MultiSelectionInList subclass:#ListHolder
 	instanceVariableNames:'painter propertyList masterElement disabledChanged'
 	classVariableNames:''
@@ -528,25 +521,29 @@
 !UIPainterView methodsFor:'generating output'!
 
 generateActionMethodFor:aspect spec:protoSpec inClass:targetClass
-    |args|
-
+    |args showIt|
 
-    (aspect last) == $: ifFalse:[args := '\']
-                         ifTrue:[args := 'anArgument\'].
+    (aspect asSymbol numArgs) == 1 ifFalse:[
+        args := '\'.
+        showIt := ' ...''.\'.
+    ] ifTrue:[
+        args := 'anArgument\'.
+        showIt := ''' , anArgument printString , '' ...''.\'.
+    ].
 
     ^ ('!!' , targetClass name , ' methodsFor:''actions''!!\\' ,
       aspect , args ,
       '    "automatically generated by UIPainter ..."\' ,
       '\' ,
       '    "action to be added ..."\' ,
-      '    Transcript showCR:''action for ' , aspect , ' ...''.\' ,
+      '    Transcript showCR:self class name , '': action for ' , aspect , showIt ,
       '!! !!\\') withCRs
 !
 
 generateAspectMethodFor:aspect spec:protoSpec inClass:targetClass
     |modelClass|
 
-    modelClass := protoSpec defaultModelClass.
+    modelClass := protoSpec defaultModelClassFor:aspect.
 
     ^ ('!!' , targetClass name , ' methodsFor:''aspects''!!\\' ,
       aspect , '\' ,
@@ -660,54 +657,6 @@
     "Modified: 5.9.1995 / 20:57:53 / claus"
 !
 
-generateInitCodeForGroup:aGroup
-    |code c name p objects outlets moreCode sym typ val|
-
-    " <name> := <GroupClass> in:<name-of-superview>"
-
-    code := ''.
-
-    p := self propertyOfGroup:aGroup.
-    name := p at:#variableName.
-    c := '  ' , name , ' := ' , (aGroup class name) , ' new.\'.
-
-    code := code , c withCRs.
-
-    " <name> <symbol>:<value>"
-
-    objects := p at:#controlledObjects ifAbsent:[nil].
-    objects notNil ifTrue:[
-        objects do:[:controlledObject |
-            c := c , name , ' add:' , (self uniqueNameOf:controlledObject) , '.\'
-        ]
-    ].
-
-    code := code , c withCRs
-
-
-
-
-
-!
-
-generateInitCodeForOtherStuff
-    |code g c name p outlets moreCode sym typ val|
-
-    code := ''.
-
-    "generate code for groups"
-
-    listHolder propertiesDo:[:props|
-        g := props at:#group ifAbsent:[nil].
-        g notNil ifTrue:[
-            code := code , (self generateInitCodeForGroup:g)
-        ]
-    ].
-    ^ code
-
-
-!
-
 generateInitCodeForView:aView
     |code c name p outlets moreCode sym typ val|
 
@@ -795,9 +744,6 @@
     self subviewsOf:self do:[:v |
         code := code , (self generateInitCodeForView:v)
     ].
-
-    code := code , (self generateInitCodeForOtherStuff).
-
     code := code , '    ^ self\' withCRs.
 
     defCode := Character excla asString , '\\'.
@@ -814,10 +760,6 @@
 
 !
 
-generateOutlets
-    ^ self
-!
-
 generateWindowSpecMethodSource
     |t s spec specArray str code|
 
@@ -867,32 +809,6 @@
     "Modified: 5.9.1995 / 21:01:35 / claus"
 !
 
-nameOfClass
-    ^ 'NewView'
-!
-
-outletValueOf:aSymbol for:aView
-"/    |c name p outlets moreCode sym typ val|
-"/
-"/    p := self propertyOfView:aView.
-"/    outlets := p at:#outlets ifAbsent:[^ nil].
-"/    outlets notNil ifTrue:[
-"/        outlets do:[:selectorOutlet |
-"/            sym := selectorOutlet at:#selector.
-"/            (sym == aSymbol) ifTrue:[
-"/                typ := selectorOutlet at:#type.
-"/                val := selectorOutlet at:#value.
-"/                ^ val
-"/            ]
-"/        ]
-"/    ].
-    ^ nil
-
-
-
-
-!
-
 storeContentsOn:aStream
     listHolder propertiesDo:[:p| p storeOn:aStream]
 !
@@ -914,73 +830,6 @@
 
 ! !
 
-!UIPainterView methodsFor:'group manipulations'!
-
-groupEnterFields
-    |props group objects|
-
-    self hasSelection ifFalse:[
-        ^ self
-    ].
-    self selectionDo:[:aView |
-        (aView isKindOf:EditField) ifFalse:[
-            self warn:'select EditFields only !!'.
-            ^ self
-        ]
-    ].
-    self withSelectionHiddenDo:[
-        group := EnterFieldGroup new.
-        props := GroupProperties new.
-        name  := self uniqueNameFor:(EnterFieldGroup className).
-        props group:group.
-        props name:name.
-        group groupID:name asSymbol.
-        objects := OrderedCollection new.
-        props controlledObjects:objects.
-        listHolder add:props.
-
-        self selectionDo:[:aView |
-            objects add:aView.
-            group add:aView
-        ].
-    ]
-
-
-!
-
-groupRadioButtons
-    |props name group objects|
-
-    self hasSelection ifFalse:[
-        ^ self
-    ].
-    self selectionDo:[:aView |
-        (aView isKindOf:RadioButton) ifFalse:[
-            self warn:'select RadioButtons only !!'.
-            ^ self
-        ]
-    ].
-    self withSelectionHiddenDo:[
-        group := RadioButtonGroup new.
-        props := GroupProperties new.
-        name  := self uniqueNameFor:(RadioButtonGroup className).
-        props group:group.
-        props name:name.
-        group groupID:name asSymbol.
-        objects := OrderedCollection new.
-        props controlledObjects:objects.
-        listHolder add:props.
-
-        self selectionDo:[:aView |
-            aView turnOff.
-            objects add:aView.
-            group add:aView
-        ].
-    ]
-
-    "Modified: 5.9.1995 / 16:06:15 / claus"
-! !
-
 !UIPainterView methodsFor:'initialization'!
 
 destroy
@@ -1071,50 +920,6 @@
 
 ! !
 
-!UIPainterView methodsFor:'misc'!
-
-changeFont:aFontDescription
-    |f|
-
-    f := aFontDescription onDevice:device.
-"/    f := Font family:family
-"/                face:face
-"/               style:style
-"/                size:size.
-
-    f notNil ifTrue:[
-        self withSelectionHiddenDo:[
-            self selectionDo:[:aView |
-                aView font:f.
-                self elementChangedSize:aView.
-            ]
-        ].
-    ]
-
-    "Modified: 5.9.1995 / 12:13:27 / claus"
-    "Created: 10.4.1997 / 09:56:16 / cg"
-!
-
-changeFontFamily:family face:face style:style size:size
-    |f|
-
-    f := Font family:family
-                face:face
-               style:style
-                size:size.
-
-    f notNil ifTrue:[
-        self withSelectionHiddenDo:[
-            self selectionDo:[:aView |
-                aView font:f.
-                self elementChangedSize:aView.
-            ]
-        ]
-    ]
-
-    "Modified: 5.9.1995 / 12:13:27 / claus"
-! !
-
 !UIPainterView methodsFor:'removing components'!
 
 remove:anObject
@@ -1183,12 +988,6 @@
                ifFalse:[^ nil]
 !
 
-propertyOfGroup:aGroup
-    "returns property assigned to group
-    "
-    ^ listHolder detectProperty:[:p| p group == aGroup ]
-!
-
 propertyOfIdentifier:anId
     "returns property assigned to unique identifier
     "
@@ -1665,10 +1464,6 @@
 
 !UIPainterView::ViewProperty methodsFor:'accessing'!
 
-group
-    ^ nil
-!
-
 identifier
     "return the unique identifier assigned to property
     "
@@ -1751,42 +1546,6 @@
     spec name:aName
 ! !
 
-!UIPainterView::GroupProperties methodsFor:'accessing'!
-
-controlledObjects
-    "return the value of the instance variable 'controlledObjects' (automatically generated)"
-
-    ^ controlledObjects!
-
-controlledObjects:something
-    "set the value of the instance variable 'controlledObjects' (automatically generated)"
-
-    controlledObjects := something.!
-
-group
-    "return the value of the instance variable 'group'
-    "
-    ^ group
-!
-
-group:something
-    "set the value of the instance variable 'group'
-    "
-    group := something.
-!
-
-name
-    "return the value of the group name
-    "
-    ^ name
-!
-
-name:aName
-    "set the value of the group name
-    "
-    name := aName
-! !
-
 !UIPainterView::ListHolder class methodsFor:'instance creation'!
 
 for:aPainter