'From etoys4.0 of 9 October 2008 [latest update: #2280] on 10 September 2009 at 11:12:39 am'! "Change Set: projInfoRearrange-sw Date: 10 September 2009 Author: Scott Wallace Rearrange items in project-info dialog, and restore (none) as the default wording for pop-up items for which no value has been specified."! !EToyProjectDetailsMorph methodsFor: 'project details' stamp: 'sw 9/10/2009 11:00'! fieldToDetailsMappings "Answer an array describing, top to bottom, the details of each element. Each element is a tuple consisting of: 1. field name (internal) 2. key in the project-details dictionary 3. text (english version) to be shown in the entry's label at left. 4. vertical space to allow 5. entry type: (if missing, text is implied) #text --> editable text field #popUp --> pop-up of choices" ^{ {#description. 'projectdescription'. 'Description' translatedNoop. 100}. {#author. 'projectauthor'. 'Author' translatedNoop. 20}. {#keywords. 'projectkeywords'. 'Tags' translatedNoop. 20}. {#subject. 'projectcategory'. 'Subject' translatedNoop. 20. #popUp}. {#age. 'projectage'. 'Target Age' translatedNoop. 20. #popUp}. {#region. 'projectregion'. 'Region' translatedNoop. 20. #popUp}. } ! ! !EToyProjectDetailsMorph methodsFor: 'utilities' stamp: 'sw 9/10/2009 10:59'! doPopUp: aSymbol event: anEvent for: aTextMorph "The user clicked on a pop-up field in the project-info dialog. Put up the pop-up of choices." | aMenu aTitle | aMenu := MenuMorph new defaultTarget: self. aTitle := aTextMorph valueOfProperty: #menuTitle. aTitle ifNotNil: [aMenu addTitle: aTitle translated]. aMenu add: '(none)' translated target: self selector: #setInfoField:to: argumentList: {aSymbol asString. '(none)'}. aMenu addLine. (self choicesFor: aSymbol) do: [:aChoice | aMenu add: aChoice third translated target: self selector: #setInfoField:to: argumentList: {aSymbol. aChoice first}]. aMenu popUpInWorld! ! !EToyProjectDetailsMorph methodsFor: 'utilities' stamp: 'sw 9/10/2009 10:59'! popUpEntryNamed: aString "Answer a text morph that will serve as a pop-up" | newField | newField := StaticTextMorph new beAllFont: self myFont; extent: 400 @ 20; contentsWrapped: '(none)' translated. namedFields at: aString put: newField. newField on: #click send: #doPopUp:event:for: to: self withValue: aString. ^ newField! ! !EToyProjectDetailsMorph methodsFor: 'utilities' stamp: 'sw 9/10/2009 11:00'! popUpEntryNamed: aString menuTitle: titleInEnglish "Answer a text morph that will serve as a pop-up. The first parameter is the key in the named-fields dictionary, the second is the title (in english) to give to the menu." | newField | newField := StaticTextMorph new beAllFont: self myFont; extent: 400 @ 20; contentsWrapped: '(none)' translated. newField setProperty: #menuTitle toValue: titleInEnglish. namedFields at: aString put: newField. newField on: #click send: #doPopUp:event:for: to: self withValue: aString. ^ newField! !