'From etoys3.0 of 24 February 2008 [latest update: #1926] on 20 March 2008 at 3:16:04 am'! "Change Set: collapseFixes-sw Date: 20 March 2008 Author: Scott Wallace TRAC 6715. Make the sugar-navigator-bar immune to collapsing. Also clean up a number of things relating to collapsing and expanding of windows as well as non-windows."! !Morph methodsFor: 'geometry' stamp: 'sw 3/20/2008 01:33'! collapsible "Answer whether the receiver is currently a candidate for collapsing." ^ self wantsToBeTopmost not! ! !PasteUpMorph methodsFor: 'world menu' stamp: 'sw 3/20/2008 01:00'! collapseAllWindows "Collapse all non-collapsed windows" (SystemWindow windowsIn: self satisfying: [:w | w isCollapsed not]) reverseDo: [:w | w collapseOrExpand. self displayWorld] ! ! !PasteUpMorph methodsFor: 'world menu' stamp: 'sw 3/20/2008 00:48'! collapseAllWindowsAndNonWindows "Collapse all objects for which it is appropriate into little window tabs or other icons, from whence they can be reopened when desired." self submorphs do: [:m | m collapsible ifTrue: [m collapse]]! ! !PasteUpMorph methodsFor: 'world menu' stamp: 'sw 3/20/2008 01:35'! expandAllCollapsedObjects "Expand all collapsed objects" | anImageMorph | (SystemWindow windowsIn: self satisfying: [:w | w isCollapsed]) reverseDo: [:w | w collapseOrExpand. self displayWorld]. submorphs do: [:aMorph | ((aMorph submorphs size > 0) and: [(anImageMorph := aMorph submorphs first) isKindOf: ImageMorph] and: [anImageMorph hasProperty: #uncollapsedMorph]) ifTrue: [anImageMorph uncollapseSketch]]! ! !SketchMorph methodsFor: 'menus' stamp: 'sw 3/20/2008 01:31'! collapse "Replace the receiver with a collapsed rendition of itself." | priorPosition w collapsedVersion a | (w _ self world) ifNil: [^self]. collapsedVersion _ (self imageForm scaledToSize: 50@50) asMorph. collapsedVersion setProperty: #uncollapsedMorph toValue: self. collapsedVersion on: #mouseUp send: #uncollapseSketch to: collapsedVersion. collapsedVersion setBalloonText: 'A collapsed version of ',self name. self delete. w addMorphFront: ( a _ AlignmentMorph newRow hResizing: #shrinkWrap; vResizing: #shrinkWrap; borderWidth: 4; borderColor: Color white; addMorph: collapsedVersion; yourself). a setNameTo: self externalName. collapsedVersion setProperty: #collapsedMorphCarrier toValue: a. (priorPosition _ self valueOfProperty: #collapsedPosition ifAbsent: [nil]) ifNotNil: [a position: priorPosition]. ! ! !SugarNavTab methodsFor: 'positioning' stamp: 'sw 3/20/2008 00:51'! collapsible "Answer whether the receiver can be collapsed." ^ false! ! !SystemWindow methodsFor: 'resize/collapse' stamp: 'sw 3/20/2008 00:37'! collapsible "Answer whether the receiver can be collapsed." ^ self isCollapsed not! ! !TheWorldMenu methodsFor: 'windows & flaps menu' stamp: 'sw 3/20/2008 01:30'! windowsMenu "Build the windows menu for the world." ^ self fillIn: (self menu: 'windows') from: { { 'find window' translated. { #myWorld . #findWindow: }. 'Presents a list of all windows; if you choose one from the list, it becomes the active window.' translated}. { 'find changed browsers...' translated. { #myWorld . #findDirtyBrowsers: }. 'Presents a list of browsers that have unsubmitted changes; if you choose one from the list, it becomes the active window.' translated}. { 'find changed windows...' translated. { #myWorld . #findDirtyWindows: }. 'Presents a list of all windows that have unsubmitted changes; if you choose one from the list, it becomes the active window.' translated}. nil. { 'find a transcript (t)' translated. { #myWorld . #findATranscript: }. 'Brings an open Transcript to the front, creating one if necessary, and makes it the active window' translated}. { 'find a fileList (L)' translated. { #myWorld . #findAFileList: }. 'Brings an open fileList to the front, creating one if necessary, and makes it the active window' translated}. { 'find a change sorter (C)' translated. { #myWorld . #findAChangeSorter: }. 'Brings an open change sorter to the front, creating one if necessary, and makes it the active window' translated}. { 'find message names (W)' translated. { #myWorld . #findAMessageNamesWindow: }. 'Brings an open MessageNames window to the front, creating one if necessary, and makes it the active window' translated}. nil. { #staggerPolicyString . { self . #toggleWindowPolicy }. 'stagger: new windows positioned so you can see a portion of each one. tile: new windows positioned so that they do not overlap others, if possible.' translated}. nil. { 'collapse all windows' translated. { #myWorld . #collapseAllWindows }. 'Reduce all open windows to collapsed forms that only show titles.' translated}. { 'collapse all objects' translated. { #myWorld . #collapseAllWindowsAndNonWindows }. 'Reduce all open windows and all other objects on the desktop to labeled tabs' translated}. { 'expand all' translated. { #myWorld . #expandAllCollapsedObjects }. 'Expand all collapsed windows and other collapsed objects back to their expanded forms.' translated}. { 'close top window (w)' translated. { SystemWindow . #closeTopWindow }. 'Close the topmost window if possible.' translated}. { 'send top window to back (\)' translated. { SystemWindow . #sendTopWindowToBack }. 'Make the topmost window become the backmost one, and activate the window just beneath it.' translated}. { 'move windows onscreen' translated. { #myWorld . #bringWindowsFullOnscreen }. 'Make all windows fully visible on the screen' translated}. nil. { 'delete unchanged windows' translated. { #myWorld . #closeUnchangedWindows }. 'Deletes all windows that do not have unsaved text edits.' translated}. { 'delete non-windows' translated. { #myWorld . #deleteNonWindows }. 'Deletes all non-window morphs lying on the world.' translated}. { 'delete both of the above' translated. { self . #cleanUpWorld }. 'deletes all unchanged windows and also all non-window morphs lying on the world, other than flaps.' translated}. }! !