--- a/AspectAdaptor.st Sat Apr 27 19:56:35 1996 +0200
+++ b/AspectAdaptor.st Sat Apr 27 19:59:26 1996 +0200
@@ -46,10 +46,12 @@
value/value: symbols towards the editField, and forwarding changes and
updates to/from the complex model using different aspect symbols.
- Notice: this class was implemented using protocol information
- from alpha testers and PD code - it may not be complete or compatible to
- the corresponding ST-80 class. If you encounter any incompatibilities,
- please forward a note to the ST/X team.
+ Notice:
+ this class was implemented using protocol information
+ from alpha testers - it may not be complete or compatible to
+ the corresponding ST-80 class.
+ If you encounter any incompatibilities, please forward a note
+ describing the incompatibility verbal (i.e. no code) to the ST/X team.
[author:]
Claus Gittinger
@@ -62,76 +64,77 @@
examples
"
a dialog on a points x/y coordinates:
+ [exBegin]
+ |dialog data f|
- |dialog data f|
-
- data := 0@0.
+ data := 0@0.
- dialog := DialogBox new.
- dialog addTextLabel:'x:'.
- f := dialog addInputFieldOn:(AspectAdaptor new
- subject:data;
- accessWith:#x
- assignWith:#x:).
- f converter:(PrintConverter new initForNumber).
+ dialog := DialogBox new.
+ dialog addTextLabel:'x:'.
+ f := dialog addInputFieldOn:(AspectAdaptor new
+ subject:data;
+ accessWith:#x
+ assignWith:#x:).
+ f converter:(PrintConverter new initForNumber).
- dialog addTextLabel:'y:'.
- f := dialog addInputFieldOn:(AspectAdaptor new
- subject:data;
- forAspect:#y).
- f converter:(PrintConverter new initForNumber).
+ dialog addTextLabel:'y:'.
+ f := dialog addInputFieldOn:(AspectAdaptor new
+ subject:data;
+ forAspect:#y).
+ f converter:(PrintConverter new initForNumber).
- dialog addOkButton.
- data inspect.
- dialog open.
+ dialog addOkButton.
+ data inspect.
+ dialog open.
- dialog accepted ifTrue:[
- Transcript showCr:'data now: ' , data printString
- ]
+ dialog accepted ifTrue:[
+ Transcript showCr:'data now: ' , data printString
+ ]
+ [exEnd]
a dialog on a four-field complex model:
-
-
- |dialog data dataModel|
+ [exBegin]
+ |dialog data dataModel|
- data := #('hello' 'one' 'two' 'three').
- dataModel := Plug new.
- dataModel respondTo:#field1 with:[data at:1].
- dataModel respondTo:#field2 with:[data at:2].
- dataModel respondTo:#field3 with:[data at:3].
- dataModel respondTo:#field4 with:[data at:4].
- dataModel respondTo:#field1: with:[:arg | data at:1 put:arg].
- dataModel respondTo:#field2: with:[:arg | data at:2 put:arg].
- dataModel respondTo:#field3: with:[:arg | data at:3 put:arg].
- dataModel respondTo:#field4: with:[:arg | data at:4 put:arg].
+ data := #('hello' 'one' 'two' 'three').
+ dataModel := Plug new.
+ dataModel respondTo:#field1 with:[data at:1].
+ dataModel respondTo:#field2 with:[data at:2].
+ dataModel respondTo:#field3 with:[data at:3].
+ dataModel respondTo:#field4 with:[data at:4].
+ dataModel respondTo:#field1: with:[:arg | data at:1 put:arg].
+ dataModel respondTo:#field2: with:[:arg | data at:2 put:arg].
+ dataModel respondTo:#field3: with:[:arg | data at:3 put:arg].
+ dataModel respondTo:#field4: with:[:arg | data at:4 put:arg].
- dialog := DialogBox new.
- dialog addTextLabel:'1:'.
- dialog addInputFieldOn:(AspectAdaptor new
- subject:dataModel;
- accessWith:#field1
- assignWith:#field1:).
- dialog addTextLabel:'2:'.
- dialog addInputFieldOn:(AspectAdaptor new
- subject:dataModel;
- forAspect:#field2).
- dialog addTextLabel:'3:'.
- dialog addInputFieldOn:(AspectAdaptor new
- subject:dataModel;
- accessWith:#field3
- assignWith:#field3:
- aspect:#field3).
- dialog addTextLabel:'4:'.
- dialog addInputFieldOn:(AspectAdaptor new
- subject:dataModel;
- forAspect:#field4).
- dialog addOkButton.
- dataModel inspect.
- dialog open.
- dialog accepted ifTrue:[
- Transcript showCr:'data now: ' , data printString
- ]
+ dialog := DialogBox new.
+ dialog addTextLabel:'1:'.
+ dialog addInputFieldOn:(AspectAdaptor new
+ subject:dataModel;
+ accessWith:#field1
+ assignWith:#field1:).
+ dialog addTextLabel:'2:'.
+ dialog addInputFieldOn:(AspectAdaptor new
+ subject:dataModel;
+ forAspect:#field2).
+ dialog addTextLabel:'3:'.
+ dialog addInputFieldOn:(AspectAdaptor new
+ subject:dataModel;
+ accessWith:#field3
+ assignWith:#field3:
+ aspect:#field3).
+ dialog addTextLabel:'4:'.
+ dialog addInputFieldOn:(AspectAdaptor new
+ subject:dataModel;
+ forAspect:#field4).
+ dialog addOkButton.
+ dataModel inspect.
+ dialog open.
+ dialog accepted ifTrue:[
+ Transcript showCr:'data now: ' , data printString
+ ]
+ [exEnd]
"
! !
@@ -233,5 +236,5 @@
!AspectAdaptor class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview2/AspectAdaptor.st,v 1.11 1996-04-25 16:42:55 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview2/AspectAdaptor.st,v 1.12 1996-04-27 17:58:52 cg Exp $'
! !