'From Squeak3.2alpha of 3 October 2001 [latest update: #4586] on 7 December 2001 at 12:37:42 pm'! "Change Set: ShrinkWrapObjectsTool-nk Date: 7 December 2001 Author: Ned Konz This makes the Objects Tool adapt its vertical size to its contents."! !ObjectsTool methodsFor: 'initialization' stamp: 'nk 12/7/2001 12:34'! initializeToStandAlone "Initialize the receiver so that it can live as a stand-alone morph" | aPane aBin aColor | self basicInitialize. self layoutInset: 6. self listCentering: #topLeft. self cellPositioning: #topLeft. self wrapCentering: #center. self useRoundedCorners. self listDirection: #topToBottom. self hResizing: #shrinkWrap; vResizing: #shrinkWrap. aPane _ self paneForTabs: self modeTabs. aPane addMorphFront: self dismissButton. aPane addMorphBack: self helpButton. aPane color: (aColor _ aPane color) darker. aPane listSpacing: #equal. aPane cellInset: 10 @ 10. aPane listCentering: #center; height: 38. aPane wrapDirection: nil. self addMorphFront: aPane. self addMorphBack: Morph new. "Place holder for a tabs or text pane" aBin _ PartsBin newPartsBinWithOrientation: #leftToRight from: #(). aBin listDirection: #leftToRight. aBin wrapDirection: #topToBottom. aBin hResizing: #spaceFill; vResizing: #shrinkWrap. aBin extent: (self currentWorld width) @ 300. aBin color: aColor lighter lighter. aBin setNameTo: 'parts'. aBin dropEnabled: false. self addMorphBack: aBin. self submorphs last width: 350; hResizing: #rigid. self color: (Color r: 0.0 g: 0.839 b: 0.226). self setProperty: #initialWidth toValue: 268. self setNameTo: 'Objects'. self showCategories. ! ! !ObjectsTool methodsFor: 'alphabetic' stamp: 'nk 12/7/2001 12:33'! installQuads: quads fromButton: aButton "Install items in the bottom pane that correspond to the given set of quads, as triggered from the given button" | aPartsBin sortedQuads | aPartsBin _ self findDeeplyA: PartsBin. aPartsBin removeAllMorphs. sortedQuads _ quads asSortedCollection: [:a :b | a third < b third]. aPartsBin listDirection: #leftToRight quadList: sortedQuads. aPartsBin vResizing: #shrinkWrap. aPartsBin width: self innerBounds width. aButton ifNotNil: [self tabsPane highlightOnlySubmorph: aButton]! !