'From etoys4.0 of 9 October 2008 [latest update: #2192] on 5 November 2008 at 2:45:59 pm'! "Change Set: wrap-swyo Date: 5 November 2008 Author: Scott Wallace and Yoshiki Ohshima A workaround for wrap issues in UserText and PreferencesPanel."! !PreferencesPanel methodsFor: 'find' stamp: 'yo 11/5/2008 14:45'! addHelpItemsTo: panelPage "Add the items appropriate the the ? page of the receiver" | aButton aTextMorph aMorph firstTextMorph | panelPage hResizing: #shrinkWrap; vResizing: #shrinkWrap. firstTextMorph _ TextMorph new contents: 'Search Preferences for:' translated. "firstTextMorph beAllFont: ((TextStyle default fontOfSize: 13) emphasized: 1)." panelPage addMorphBack: firstTextMorph lock. panelPage addTransparentSpacerOfSize: 0@10. aMorph _ RectangleMorph new clipSubmorphs: true; beTransparent; borderWidth: 2; borderColor: Color black; extent: 250 @ 36. aMorph vResizing: #rigid; hResizing: #rigid. aTextMorph _ PluggableTextMorph new on: self text: #searchString accept: #setSearchStringTo: readSelection: nil menu: nil. " aTextMorph hResizing: #rigid." aTextMorph borderWidth: 0. aTextMorph font: ((TextStyle default fontOfSize: 21) emphasized: 1); setTextColor: Color red. aMorph addMorphBack: aTextMorph. aTextMorph acceptOnCR: true. aTextMorph position: (aTextMorph position + (6@5)). aMorph clipLayoutCells: true. aTextMorph extent: 240 @ 25. panelPage addMorphBack: aMorph. aTextMorph setBalloonText: 'Type what you want to search for here, then hit the "Search" button, or else hit RETURN or ENTER' translated. aTextMorph setTextMorphToSelectAllOnMouseEnter. aTextMorph hideScrollBarsIndefinitely. panelPage addTransparentSpacerOfSize: 0@10. aButton _ SimpleButtonMorph new target: self; color: Color transparent; actionSelector: #initiateSearch:; arguments: {aTextMorph}; label: 'Search' translated. panelPage addMorphBack: aButton. aButton setBalloonText: 'Type what you want to search for in the box above, then click here (or hit RETURN or ENTER) to start the search; results will appear in the "search results" category.' translated. panelPage addTransparentSpacerOfSize: 0@30. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Restore all Default Preference Settings' translated; target: Preferences; actionSelector: #chooseInitialSettings; setBalloonText: 'Click here to reset all the preferences to their standard default values.' translated ; yourself). panelPage addTransparentSpacerOfSize: 0@14. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Save Current Settings as my Personal Preferences' translated; target: Preferences; actionSelector: #savePersonalPreferences; setBalloonText: 'Click here to save the current constellation of Preferences settings as your personal defaults; you can get them all reinstalled with a single gesture by clicking the "Restore my Personal Preferences".' translated; yourself). panelPage addTransparentSpacerOfSize: 0@14. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Restore my Personal Preferences' translated; target: Preferences; actionSelector: #restorePersonalPreferences; setBalloonText: 'Click here to reset all the preferences to their values in your Personal Preferences.' translated; yourself). panelPage addTransparentSpacerOfSize: 0@30. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Save Current Settings to Disk' translated; target: Preferences; actionSelector: #storePreferencesToDisk; setBalloonText: 'Click here to save the current constellation of Preferences settings to a file; you can get them all reinstalled with a single gesture by clicking "Restore Settings From Disk".' translated; yourself). panelPage addTransparentSpacerOfSize: 0@14. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Restore Settings from Disk' translated; target: Preferences; actionSelector: #restorePreferencesFromDisk; setBalloonText: 'Click here to load all the preferences from their saved values on disk.' translated; yourself). panelPage addTransparentSpacerOfSize: 0@30. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Inspect Parameters' translated; target: Preferences; actionSelector: #inspectParameters; setBalloonText: 'Click here to view all the values stored in the system Parameters dictionary' translated; yourself). panelPage addTransparentSpacerOfSize: 0@10. panelPage addMorphBack: (Preferences themeChoiceButtonOfColor: Color transparent font: TextStyle defaultFont). panelPage addTransparentSpacerOfSize: 0@10. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Help!!' translated; target: Preferences; actionSelector: #giveHelpWithPreferences; setBalloonText: 'Click here to get some hints on use of this Preferences Panel' translated; yourself). panelPage wrapCentering: #center. ! ! !TextMorph class methodsFor: '*connectorstext-parts bin' stamp: 'yo 11/5/2008 14:33'! boldAuthoringPrototype "TextMorph boldAuthoringPrototype openInHand" | text style index baseFont textMorph | text := Text fromString: 'Text' translated. baseFont _ Preferences standardEToysFont. style _ baseFont textStyle. index _ style fontIndexOfPointSize: 24. text addAttribute: (TextFontChange fontNumber: index). textMorph := self new contentsWrapped: text; setTextStyle: style; margins: 0@0; yourself. "Too ugly dirty hack" textMorph wrapFlag: false. textMorph fit. textMorph usePango ifTrue: [textMorph wrapFlag: true]. ^ textMorph ! ! !TextMorph class methodsFor: '*connectorstext-parts bin' stamp: 'yo 11/5/2008 14:31'! nonwrappingPrototype "Answer the default-text-object de jour; at this time, it's actually an instance of UserText." | text style index baseFont textMorph | text := Text fromString: 'Text' translated. baseFont _ Preferences standardEToysFont. style _ baseFont textStyle. index _ style fontIndexOfPointSize: 24. style defaultFontIndex: index. text addAttribute: (TextFontChange fontNumber: index). textMorph := UserText new. textMorph contentsWrapped: text; setTextStyle: style; margins: 0@0. "Too ugly dirty hack from boldAuthoringPrototype." textMorph wrapFlag: false. textMorph fit. textMorph usePango ifTrue: [textMorph wrapFlag: true]. ^ textMorph " TextMorph nonwrappingPrototype openInHand " ! !