From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:48:15 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>Size3Example</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none <imports></imports> <category>Examples-Help</category> <attributes> <package>Size3-Example</package> </attributes> </class> <comment> Examples.Size3Example
Size3Example demonstrates modifying the size and position of a widget while the application is running.
</comment> <methods> Examples.Size3Example <category>actions</category>
expandBox | wrapper oldSize newSize | wrapper := self builder componentAt: #box. oldSize := wrapper bounds. "If the box is bigger than the window already, do nothing." oldSize origin x < 0 ifTrue: [^nil]. "Expand the bounding rectangle by 10 pixels on each side." newSize := Rectangle origin: oldSize origin - 10 corner: oldSize corner + 10. "Assign the new bounding rectangle to the widget wrapper." wrapper newBounds: newSize.
shrinkBox | wrapper oldSize newSize | wrapper := self builder componentAt: #box. oldSize := wrapper bounds. "If the box is invisible already, do nothing." oldSize extent x < 0 ifTrue: [^nil]. "Shrink the bounding rectangle by 10 pixels on each side." newSize := Rectangle origin: oldSize origin + 10 corner: oldSize corner - 10. "Assign the new bounding rectangle to the widget wrapper." wrapper newBounds: newSize.
</methods> <methods> Examples.Size3Example class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#FullSpec #window: #(#WindowSpec #label: 'Size3Example' #min: #(#Point 300 300 ) #max: #(#Point 300 300 ) #bounds: #(#Rectangle 335 336 635 636 ) ) #component: #(#SpecCollection #collection: #( #(#RegionSpec #layout: #(#LayoutFrame -50 0.5 -50 0.5 50 0.5 50 0.5 ) #name: #box #isOpaque: true #colors: #(#LookPreferences #setForegroundColor: #(#ColorValue #black ) #setBackgroundColor: #(#ColorValue #magenta ) ) #lineWidth: 1 ) #(#ActionButtonSpec #layout: #(#AlignmentOrigin 0 0.5 0 0.25 0.5 0.5 ) #isOpaque: true #model: #expandBox #label: 'Expand' #defaultable: true ) #(#ActionButtonSpec #layout: #(#AlignmentOrigin 0 0.5 0 0.75 0.5 0.5 ) #isOpaque: true #model: #shrinkBox #label: 'Shrink' #defaultable: true ) ) ) )
</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>