'From Squeak3.5 of ''11 April 2003'' [latest update: #5180] on 27 April 2003 at 6:13:05 pm'! "Change Set: ProjectViewShadow-sbw Date: 7 January 2002 Author: Stephan B. Wessels If new morphic projects are opened in a project view, check the Preferences to see if we should automatically apply a drop shadow. Also, changed the new creation of project morphs to be attached to the cursor and having the user locate the new project morph in the world. This was done because the original technique always slammed the new project in the left top most corner of the world and invariable the user had to pick it up and put it somewhere else. Date Update ------------- ----------------------------------------------------------------------- 15-apr-2003 update for Squeak 3.5 07-jan-2002 initial file release. "! !Preferences class methodsFor: 'initialization' stamp: 'sbw 7/13/2001 11:16'! addPreferenceForOptionalProjectViewShadow "Preferences addPreferenceForOptionalProjectViewShadow" self preferenceAt: #projectViewsDefaultWithShadows ifAbsent: [self addPreference: #projectViewsDefaultWithShadows category: #projects default: true balloonHelp: 'If true, the project view morphs have drop shadows by default when they are created.']! ! !Project methodsFor: 'displaying' stamp: 'sbw 4/6/2002 14:58'! createViewIfAppropriate | projectView | ProjectViewOpenNotification signal ifTrue: [Preferences projectViewsInWindows ifTrue: [(ProjectViewMorph newProjectViewInAWindowFor: self) openInWorld] ifFalse: [projectView _ ProjectViewMorph on: self. "Set the shadow if it's our preference." (Preferences valueOfFlag: #projectViewsDefaultWithShadows) ifTrue: [projectView addDropShadow]. self currentWorld primaryHand attachMorph: projectView]]! ! !TheWorldMenu methodsFor: 'action' stamp: 'sbw 4/6/2002 14:54'! projectThumbnail "Offer the user a menu of project names. Attach to the hand a thumbnail of the project the user selects." | menu projName pr projectView | menu _ CustomMenu new. menu add: CurrentProjectRefactoring currentProjectName , ' (current)' action: CurrentProjectRefactoring currentProjectName. menu addLine. Project allNames do: [:n | menu add: n action: n]. projName _ menu startUpWithCaption: 'Select a project'. projName ifNotNil: [(pr _ Project named: projName) ifNil: [self inform: 'can''t seem to find that project'] ifNotNil: [projectView _ ProjectViewMorph on: pr. "Set the shadow if it's our preference." (Preferences valueOfFlag: #projectViewsDefaultWithShadows) ifTrue: [projectView addDropShadow]. myHand attachMorph: projectView]]! ! "Postscript: Create the new Projects default shadows preference for us." Preferences addPreferenceForOptionalProjectViewShadow. !