From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:47:16 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>FieldConnectionExample</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none a b aSquared bSquared <imports></imports> <category>Examples-Help</category> <attributes> <package>FieldConnection-Example</package> </attributes> </class> <comment> Examples.FieldConnectionExample
FieldConnectionExample demonstrates how to connect input fields using one-way and two-way dependencies.
</comment> <methods> Examples.FieldConnectionExample <category>aspects</category>
a "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^a isNil ifTrue: [a := 0 asValue] ifFalse: [a]
aSquared "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^aSquared isNil ifTrue: [aSquared := 0 asValue] ifFalse: [aSquared]
b "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^b isNil ifTrue: [b := 0 asValue] ifFalse: [b]
bSquared "This method was generated by UIDefiner. The initialization provided below may have been preempted by an initialize method." ^bSquared isNil ifTrue: [bSquared := 0 asValue] ifFalse: [bSquared]
</methods> <methods> Examples.FieldConnectionExample <category>change messages</category>
changedA self aSquared value: (self a value raisedTo: 2).
changedB "Use setValue: to bypass dependents, thus avoiding circularity." self bSquared setValue: (self b value raisedTo: 2). "Since dependents were bypassed when the model was updated, update the view manually." (self builder componentAt: #b2) widget update: #value.
changedBSquared "Use setValue: to bypass dependents, thus avoiding circularity." self b setValue: (self bSquared value raisedTo: (1/2)). "Since dependents were bypassed when the model was updated, update the view manually." (self builder componentAt: #b) widget update: #value.
</methods> <methods> Examples.FieldConnectionExample <category>interface opening</category>
postBuildWith: aBuilder "Register an interest for a one-way dependency." self a onChangeSend: #changedA to: self. "Register interests for a two-way dependency." self b onChangeSend: #changedB to: self. self bSquared onChangeSend: #changedBSquared to: self.
</methods> <methods> Examples.FieldConnectionExample class <category>resources</category>
arrow270Degrees "UIMaskEditor new openOnClass: self andSelector: #arrow270Degrees" <resource: #image> ^Image extent: 10@24 depth: 1 palette: CoveragePalette monoMaskPalette bits: #[12 0 0 0 30 0 0 0 63 0 0 0 127 128 0 0 255 192 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 12 0 0 0 ] pad: 32
arrow90Degrees <resource: #image> ^self arrow270Degrees rotatedByQuadrants: 2
</methods> <methods> Examples.FieldConnectionExample class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: 'FieldConnectionExample' #min: #(#Point 363 219 ) #max: #(#Point 363 219 ) #bounds: #(#Rectangle 318 353 681 572 ) ) #component: #(#SpecCollection #collection: #( #(#InputFieldSpec #layout: #(#Rectangle 71 78 171 103 ) #name: #a #model: #a #tabable: false #alignment: #right #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 71 151 171 176 ) #name: #a2 #model: #aSquared #tabable: false #alignment: #right #type: #number ) #(#LabelSpec #layout: #(#Point 51 84 ) #label: 'a' ) #(#LabelSpec #layout: #(#Point 33 156 ) #label: 'a**2' ) #(#GroupBoxSpec #layout: #(#Rectangle 29 33 176 202 ) #label: 'One-way connection' #style: #small ) #(#InputFieldSpec #layout: #(#Rectangle 231 78 331 103 ) #name: #b #model: #b #tabable: false #alignment: #right #type: #number ) #(#InputFieldSpec #layout: #(#Rectangle 231 151 331 176 ) #name: #b2 #model: #bSquared #tabable: false #alignment: #right #type: #number ) #(#LabelSpec #layout: #(#Point 211 84 ) #label: 'b' ) #(#LabelSpec #layout: #(#Point 193 156 ) #label: 'b**2' ) #(#GroupBoxSpec #layout: #(#Rectangle 189 33 336 202 ) #label: 'Two-way connection' #style: #small ) #(#LabelSpec #layout: #(#Point 273 117 ) #label: #arrow270Degrees #hasCharacterOrientedLabel: false ) #(#LabelSpec #layout: #(#Point 263 117 ) #label: #arrow90Degrees #hasCharacterOrientedLabel: false ) #(#LabelSpec #layout: #(#Point 109 117 ) #label: #arrow90Degrees #hasCharacterOrientedLabel: false ) ) ) )
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class>