links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Last updated at 4:22 pm UTC on 17 August 2019
ProjectViewMorph serves as a navigation aid to go to other projects. The preference #projectViewsInWindows controls if they appear in system windows or not.

 ImageMorph subclass: #ProjectViewMorph
	instanceVariableNames: 'project lastProjectThumbnail'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Morphic-Windows'

Example 1

 | newProject exampleMorph |
 newProject := MorphicProject  new.
 newProject name: 'MyNewProject'.
 exampleMorph := Morph new extent: 100@200; color: Color red; position: 20@20.
 newProject world addMorph: exampleMorph.
 newProject showWorldMainDockingBar: false.
 newProject world color: Color white.
 ProjectViewMorph openOn: newProject.

Example 2

The same example as in example 1 but with a more complex content morph taken from A4 and A3 sheets in Morphic.

| a4 newProject |

    a4Extent := 210@ 297 "millimeter". 
    a4ExtentPrintableArea := 190 @ 277 "millimeter". 
    scaleFactorForDisplay := 2.
    a4ExtentForDisplay := a4Extent * scaleFactorForDisplay.
    a4 := Morph new extent:  a4ExtentForDisplay.
    a4 color: Color lightBlue.
    a4PrintableAreaExtentForDisplay := a4ExtentPrintableArea *scaleFactorForDisplay.
    a4PrintableArea := Morph new extent:  a4PrintableAreaExtentForDisplay.
    a4PrintableArea color: Color white.
    a4 addMorph: a4PrintableArea.
    boxHeight := (a4PrintableArea height) /4.
    boxWidth := (a4PrintableArea width) /3.
    innerBoxWidth := boxHeight / (2 sqrt).
    0 to: 3 do: [:row |
    	0 to: 2 do: [:col | 
    		box:= Morph new extent: innerBoxWidth@boxHeight; color: Color random; borderWidth: 0.
		centerPoint := ((col+0.5) * boxWidth)@((row+0.5) * boxHeight).
		box center: centerPoint.
		a4PrintableArea addMorph: box ]

    a4PrintableArea center: a4 center.
    a4 position: 20@50.

	newProject := MorphicProject  new.
	newProject name: 'Layout 12 boxes - A4 sheet'.
	newProject world addMorph: a4.
	newProject showWorldMainDockingBar: false.
	newProject world color: Color blue.
	ProjectViewMorph openOn: newProject.

See also

Use case: 'New MorphicProject'
How to resize project thumbnail windows