'From Squeak3.7beta of ''1 April 2004'' [latest update: #5905] on 1 May 2004 at 8:27:17 pm'! "Change Set: ObjectsToolResizeFix-nk Date: 1 May 2004 Author: Ned Konz This makes the Objects tool resize itself to be long enough to show all of the buttons on each page. "! !ObjectsTool methodsFor: 'alphabetic' stamp: 'nk 5/1/2004 18:15'! 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 width: self innerBounds width. aButton ifNotNil: [self tabsPane highlightOnlySubmorph: aButton]. aPartsBin vResizing: #shrinkWrap.! ! !ObjectsTool methodsFor: 'initialization' stamp: 'nk 5/1/2004 17:59'! initializeForFlap "Initialize the receiver to operate in a flap at the top of the screen. This worked in the past, but is not currently in the released UI and is not likely to work without some fixup." | aPane aBin | self borderWidth: 2; borderColor: Color darkGray. self layoutInset: 0. self hResizing: #shrinkWrap; vResizing: #rigid. self listDirection: #topToBottom. self listCentering: #topLeft. self cellPositioning: #topLeft. self wrapCentering: #center. aPane _ self paneForTabs: self modeTabs. aPane color: 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) @ 250. aBin color: Color orange muchLighter. aBin setNameTo: 'Objects' translated. aBin dropEnabled: false. self addMorphBack: aBin ! ! !ObjectsTool methodsFor: 'initialization' stamp: 'nk 5/1/2004 18:07'! 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: #spaceFill. self color: (Color r: 0.0 g: 0.839 b: 0.226). self setProperty: #initialWidth toValue: 268. self setNameTo: 'Objects' translated. self showCategories. ! ! !ObjectsTool methodsFor: 'initialization' stamp: 'nk 5/1/2004 18:18'! tweakAppearanceAfterModeShift "After the receiver has been put into a given mode, make an initial selection of category, if appropriate, and try to overcome persistent and annoying layout problems associated with initial state. This method contains a mish-mash of measures, sometimes obviously desparate, some likely overkill, some no longer required. Pax!!" | aWidth prevailingWidth | prevailingWidth _ self width. self searchPane ifNil: [self tabsPane submorphs first doButtonAction]. (aWidth _ self valueOfProperty: #initialWidth) ifNotNil: [submorphs second width: aWidth. prevailingWidth _ aWidth. self removeProperty: #initialWidth]. submorphs last minHeight: 200; vResizing: #shrinkWrap; layoutChanged. self fullBounds. self firstSubmorph firstSubmorph firstSubmorph layoutChanged. "By gum" self firstSubmorph submorphs do: [:aButton | aButton borderWidth: 0. (aButton valueOfProperty: #modeSymbol) = modeSymbol ifTrue: [aButton firstSubmorph color: Color red] ifFalse: [aButton firstSubmorph color: Color black]]. self firstSubmorph firstSubmorph layoutChanged. submorphs second width: prevailingWidth - 10! !