From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:49:32 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>ExamplesBrowser</name> <environment>Examples</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Tools-Help</category> <attributes> <package>Examples Browser</package> </attributes> </class> <comment> Examples.ExamplesBrowser
NOTE: This class is obsolete, and included only because a number of examples in the Application Developer's Guide invoke: ExamplesBrowser prepareScratchWindow Once that function is replaced with a real ScratchWindow, this class will be eliminated. Shared Variables: ScratchWindow <ApplicationWindow> The window in which graphic examples display their output.
</comment> <name>ScratchWindow</name> <environment>Examples.ExamplesBrowser</environment> <private>false</private> <constant>false</constant> <category>As yet unclassified</category> <attributes> <package>Examples Browser</package> </attributes> <methods> Examples.ExamplesBrowser class <category>class initialization</category>
initialize "ExamplesBrowser initialize" ScratchWindow := ApplicationWindow new label: 'Scratch Window'. ScratchWindow component: ComposingComposite new
</methods> <methods> Examples.ExamplesBrowser class <category>accessing</category>
prepareScratchWindow "Make sure the scratch window is open, expanded and has the default size, in preparation for example code to display on it." ^self prepareScratchWindowOfSize: 400@400.
prepareScratchWindowOfSize: windowExtent "Make sure the scratch window is open, expanded and has the specified size, in preparation for example code to display on it." ScratchWindow isOpen ifTrue: ["Resize if necessary." ScratchWindow extent ~= windowExtent ifTrue: [|newDisplayBox screenBox| ScratchWindow sensor skipNextDamage. newDisplayBox := ScratchWindow displayBox origin extent: windowExtent. screenBox := Screen default preferredRectangleToConstrain: newDisplayBox. newDisplayBox insetOriginBy: ScratchWindow class windowTopLeftHeadroom cornerBy: 0@0. newDisplayBox := newDisplayBox translatedBy: (newDisplayBox amountToTranslateWithin: screenBox). ScratchWindow displayBox: newDisplayBox]. "Expand if necessary." ScratchWindow isCollapsed ifTrue: [ScratchWindow sensor skipNextDamage. ScratchWindow expand]. "Erase." ScratchWindow display] ifFalse: [ScratchWindow sensor skipNextDamage. ScratchWindow openIn: (ScratchWindow class windowTopLeftHeadroom extent: windowExtent)]. ^ScratchWindow
scratchWindow ^ScratchWindow
</methods> <initialize> Examples.ExamplesBrowser </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class>