[squeak-dev] The Trunk: MorphicExtras-mt.257.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Aug 22 13:24:35 UTC 2019


Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.257.mcz

==================== Summary ====================

Name: MorphicExtras-mt.257
Author: mt
Time: 22 August 2019, 3:24:32.845931 pm
UUID: 5d7d8b41-7ad2-a04a-9230-d8f712f4bdb5
Ancestors: MorphicExtras-tcj.256

Complements Morphic-mt.1506 including cellInset-to-cellGap conversion.

=============== Diff against MorphicExtras-tcj.256 ===============

Item was changed:
  ----- Method: ObjectsTool>>initializeToStandAlone (in category 'initialization') -----
  initializeToStandAlone
  	"Initialize the receiver so that it can live as a stand-alone morph"
+ 
+ 	| buttonPane aBin aColor tabsPane |
- 	| buttonPane aBin aColor heights tabsPane |
  	self basicInitialize.
  	
+ 	self
+ 		layoutInset: 0;
- 	self layoutInset: 0;
- 		layoutPolicy: ProportionalLayout new;
  		useRoundedCorners;
  		hResizing: #rigid;
+ 		vResizing: #shrinkWrap;
+ 		extent: RealEstateAgent standardSize;
+ 		listDirection: #topToBottom;
+ 		wrapDirection: #none.
- 		vResizing: #rigid;
- 		extent: (self minimumWidth @ self minimumHeight).
  
  	"mode buttons"
  	buttonPane := self paneForTabs: self modeTabs.
  	buttonPane color: self baseBackgroundColor.
  	buttonPane
  		vResizing: #shrinkWrap;
  		setNameTo: 'ButtonPane';
  		addMorphFront: self dismissButton;
  		addMorphBack: self helpButton;
  		color: (aColor := buttonPane color) darker;
  		layoutInset: 5;
- 		wrapDirection: nil;
  		width: self width;
  		layoutChanged; fullBounds.
  
  	"Place holder for a tabs or text pane"
  	tabsPane := Morph new.
  	tabsPane
  		color: self baseBackgroundColor;
  		setNameTo: 'TabPane';
+ 		hResizing: #spaceFill;
+ 		vResizing: #shrinkWrap.
- 		hResizing: #spaceFill.
  
- 	heights := { buttonPane height. 40 }.
- 
- 	buttonPane vResizing: #spaceFill.
- 	self
- 		addMorph: buttonPane
- 		fullFrame: (LayoutFrame
- 				fractions: (0 @ 0 corner: 1 @ 0)
- 				offsets: (0 @ 0 corner: 0 @ heights first)).
- 
- 	self
- 		addMorph: tabsPane
- 		fullFrame: (LayoutFrame
- 				fractions: (0 @ 0 corner: 1 @ 0)
- 				offsets: (0 @ heights first corner: 0 @ (heights first + heights second))).
- 
  	aBin := (PartsBin newPartsBinWithOrientation: #leftToRight from: #())
  		changeTableLayout;
  		listDirection: #leftToRight;
  		wrapDirection: #topToBottom;
+ 		vResizing: #shrinkWrap;
  		color: aColor lighter lighter;
  		borderColor: aColor lighter lighter;
  		setNameTo: 'Parts';
  		dropEnabled: false;
- 		vResizing: #spaceFill;
  		yourself.
+ 		
+ 	self addMorphBack: buttonPane.
+ 	self addMorphBack: tabsPane.
+ 	self addMorphBack: aBin.
+ 	
- 
  	self
- 		addMorph: aBin
- 		fullFrame: (LayoutFrame
- 				fractions: (0 @ 0 corner: 1 @ 1)
- 				offsets: (0 @ (heights first + heights second) corner: 0 @ 0)).
- 
- 	self
  		borderWidth: 1;
  		borderColor: self baseBorderColor;
  		color: self baseBackgroundColor;
  		setNameTo: 'Objects' translated;
+ 		showCategories.!
- 		showCategories.
- !

Item was changed:
  ----- Method: ObjectsTool>>initializeWithTabs: (in category 'tabs') -----
  initializeWithTabs: tabList
  	"Initialize the receiver to have the given tabs"
+ 
  	| oldPane newPane |
  	oldPane := self tabsPane ifNil: [ self searchPane ].
  	newPane := (self paneForTabs: tabList)
  		setNameTo: 'TabPane';
  		yourself.
- 	newPane layoutFrame: oldPane layoutFrame.
  	self replaceSubmorph: oldPane by: newPane.
- 	newPane layoutChanged; fullBounds.
- 	self fixLayoutFrames.
  
  !

Item was changed:
  ----- Method: ObjectsTool>>installQuads:fromButton: (in category 'alphabetic') -----
  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 oldResizing |
  	aPartsBin := self partsBin.
  	oldResizing := aPartsBin vResizing.
  	aPartsBin removeAllMorphs.
  	sortedQuads := ((PartsBin translatedQuads: quads)
  		select: [ :each | Smalltalk hasClassNamed: each first ])
  		sort: [ :a :b | a third < b third ].
  	aPartsBin listDirection: #leftToRight quadList: sortedQuads.
  	aButton ifNotNil: [self highlightOnlySubmorph: aButton in: self tabsPane].
  	aPartsBin vResizing: oldResizing.
+ 	aPartsBin layoutChanged; fullBounds.!
- 	aPartsBin layoutChanged; fullBounds.
- 	self isFlap ifFalse: [ self minimizePartsBinSize ].!

Item was changed:
  ----- Method: ObjectsTool>>paneForTabs: (in category 'tabs') -----
  paneForTabs: tabList 
  	"Answer a pane bearing tabs for the given list"
  	| aPane |
  	tabList do: [:t |
  			t color: Color transparent.
  			t borderWidth: 1;
  				borderColor: Color black].
  
  	aPane := Morph new
  				changeTableLayout;
  				color: self baseBackgroundColor;
  				listDirection: #leftToRight;
  				wrapDirection: #topToBottom;
  				vResizing: #spaceFill;
  				hResizing: #spaceFill;
+ 				cellGap: 6;
- 				cellInset: 6;
  				layoutInset: 4;
  				listCentering: #center;
- 				listSpacing: #equal;
  				addAllMorphs: tabList;
  				yourself.
  
  	aPane width: self layoutBounds width.
  
  	^ aPane!

Item was removed:
- ----- Method: ObjectsTool>>position: (in category 'layout') -----
- position: aPoint
- 	"The user has dragged the grow box such that the receiver's extent would be anExtent.  Do what's needed"
- 	self position = aPoint ifTrue: [ ^self ].
- 	super position: aPoint.
- 	self fixLayoutFrames.!

Item was changed:
  ----- Method: ObjectsTool>>showSearchPane (in category 'search') -----
  showSearchPane
  	"Set the receiver up so that it shows the search pane"
  
+ 	| tabsPane aPane |
- 	| tabsPane aPane frame |
  	modeSymbol == #search ifTrue: [ ^self ].
  
  	self partsBin removeAllMorphs.
  
  	tabsPane := self tabsPane.
  	aPane := self newSearchPane.
- 	aPane layoutChanged; fullBounds.
- 
- 	aPane layoutFrame: (frame := tabsPane layoutFrame copy).
- 	frame bottomOffset: (frame topOffset + aPane height).
  	self replaceSubmorph: tabsPane by: aPane.
- 	self partsBin layoutFrame topOffset: frame bottomOffset.
  
  	self modeSymbol: #search.
  	self showMorphsMatchingSearchString.
  	ActiveHand newKeyboardFocus: aPane!

Item was changed:
  ----- Method: PostscriptCanvas class>>fontSampler (in category 'font mapping') -----
  fontSampler
  	"Produces a Postscript .eps file on disk, returns a Morph."
  	"PostscriptCanvas fontSampler"
  	"PostscriptCanvas fontSampler openInWorld"
  	| morph file |
  	morph := Morph new
  		layoutPolicy: TableLayout new;
  		listDirection: #topToBottom;
  		wrapDirection: #leftToRight;
  		hResizing: #shrinkWrap;
  		vResizing: #shrinkWrap;
  		color: Color white.
  	TextStyle actualTextStyles keysAndValuesDo: [ :styleName :style |
  		{ style fontArray first. style fontArray last } do: [ :baseFont | | info |
  			0 to: 2 do: [ :i | | font string string2 textMorph row |
  				font := baseFont emphasized: i.
  				(i isZero or: [ font ~~ baseFont ]) ifTrue: [
  					string := font fontNameWithPointSize.
  					row := Morph new
  						layoutPolicy: TableLayout new;
  						listDirection: #topToBottom;
  						hResizing: #shrinkWrap;
  						vResizing: #shrinkWrap;
+ 						cellGap: 20 at 0;
- 						cellSpacing: 20 at 0;
  						color: Color white.
  		
  					textMorph := TextMorph new hResizing: #spaceFill; backgroundColor: Color white; beAllFont: font; contentsAsIs: string.
  					row addMorphBack: (textMorph imageForm asMorph).
  
  					info := self postscriptFontInfoForFont: font.
  					string2 := String streamContents: [ :stream |
  						stream nextPutAll: info first; space; print: (font pixelSize * info second) rounded.
  					].
  					textMorph := TextMorph new hResizing: #spaceFill; backgroundColor: Color white; beAllFont: font; contentsAsIs: string2.
  					row addMorphBack: textMorph.
  					
  					morph addMorphBack: row.
  				]
  			]
  		]
  	].
  	morph bounds: Project current world bounds.
  	morph layoutChanged; fullBounds.
  	file := (FileDirectory default newFileNamed: 'PSFontSampler.eps').
  	Cursor wait showWhile: [ 
  		file nextPutAll: (EPSCanvas morphAsPostscript: morph) ].
  	^morph!



More information about the Squeak-dev mailing list