'From Squeak3.1alpha of 28 February 2001 [latest update: #4217] on 27 July 2001 at 11:13:34 pm'! "Change Set: selectAllInPref-sw Date: 27 July 2001 Author: Scott Wallace Do a select-all when the mouse enters the search pane of a Preferences panel -- a modest improvement to this this still-clunky user interface. Also, the initial contents of the search pane of a new Preferences panel are more helpful. And the type-in for the search pane is better centered"! !PluggableTextMorph methodsFor: 'drawing' stamp: 'sw 7/27/2001 22:17'! wantsFrameAdornments "Answer whether the receiver wishes to have red borders, etc., used to show editing state" "A 'long-term temporary workaround': a nonmodular, unsavory, but expedient way to get the desired effect, sorry. Clean up someday." ^ (#(annotation searchString) includes: getTextSelector) not! ! !PluggableTextMorph methodsFor: 'editor access' stamp: 'sw 7/24/2001 02:21'! selectAll "Tell my textMorph's editor to select all" textMorph editor selectAll! ! !PluggableTextMorph methodsFor: 'editor access' stamp: 'sw 7/24/2001 02:24'! setTextMorphToSelectAllOnMouseEnter "Tell my textMorph's editor to select all when the mouse enters" textMorph on: #mouseEnter send: #selectAll to: textMorph! ! !PreferencesPanel methodsFor: 'initialization' stamp: 'sw 7/27/2001 16:41'! findPreferencesMatching: incomingTextOrString "find all preferences matching incomingTextOrString" | result aList aPalette controlPage | result _ incomingTextOrString asString asLowercase. result _ result asLowercase withBlanksTrimmed. result isEmptyOrNil ifTrue: [^ self]. aList _ Preferences allPreferenceObjects select: [:aPreference | (aPreference name includesSubstring: result caseSensitive: false) or: [aPreference helpString includesSubstring: result caseSensitive: false]]. aPalette _ (self containingWindow ifNil: [^ self]) findDeeplyA: TabbedPalette. aPalette ifNil: [^ self]. aPalette selectTabNamed: 'search results'. aPalette currentPage ifNil: [^ self]. "bkwd compat" controlPage _ aPalette currentPage. controlPage removeAllMorphs. controlPage addMorph: (StringMorph contents: ('Preferences matching "', self searchString, '"') font: Preferences standardButtonFont). aList do: [:aPreference | controlPage addMorphBack: (aPreference representativeButtonWithColor: nil inPanel: self)]. aPalette world startSteppingSubmorphsOf: aPalette! ! !PreferencesPanel methodsFor: 'find' stamp: 'sw 7/27/2001 21:56'! 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:'. 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'. aTextMorph setTextMorphToSelectAllOnMouseEnter. aTextMorph hideScrollBarIndefinitely. panelPage addTransparentSpacerOfSize: 0@10. aButton _ SimpleButtonMorph new target: self; color: Color transparent; actionSelector: #initiateSearch:; arguments: {aTextMorph}; label: 'Search'. 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.'. panelPage addTransparentSpacerOfSize: 0@40. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Restore all Default Preference Settings'; target: Preferences; actionSelector: #chooseInitialSettings; setBalloonText: 'Click here to reset all the preferences to their standard default values.'; yourself). panelPage addTransparentSpacerOfSize: 0@14. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Save Current Settings as my Personal Preferences'; 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".'; yourself). panelPage addTransparentSpacerOfSize: 0@14. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Restore my Personal Preferences'; target: Preferences; actionSelector: #restorePersonalPreferences; setBalloonText: 'Click here to reset all the preferences to their values in your Personal Preferences.'; yourself). panelPage addTransparentSpacerOfSize: 0@30. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Inspect Parameters'; target: Preferences; actionSelector: #inspectParameters; setBalloonText: 'Click here to view all the values stored in the system Parameters dictionary'; yourself). panelPage addTransparentSpacerOfSize: 0@10. panelPage addMorphBack: (SimpleButtonMorph new color: Color transparent; label: 'Help!!'; target: Preferences; actionSelector: #giveHelpWithPreferences; setBalloonText: 'Click here to get some hints on use of this Preferences Panel'; yourself). panelPage wrapCentering: #center. ! ! !PreferencesPanel methodsFor: 'find' stamp: 'sw 7/27/2001 16:39'! initiateSearch: morphHoldingSearchString "Carry out the action of the Search button in the Preferences panel" searchString _ morphHoldingSearchString text. self setSearchStringTo: self searchString. self findPreferencesMatchingSearchString! ! !PreferencesPanel methodsFor: 'find' stamp: 'sw 7/27/2001 23:11'! searchString "Answer the current searchString, initializing it if need be" | win aMorph | searchString isEmptyOrNil ifTrue: [searchString _ 'Type here, hit Search'. (win _ self containingWindow) ifNotNil: [aMorph _ win findDeepSubmorphThat: [:m | m isKindOf: PluggableTextMorph] ifAbsent: [^ searchString]. aMorph setText: searchString. aMorph setTextMorphToSelectAllOnMouseEnter. aMorph selectAll]]. ^ searchString! ! !TextMorphForEditView methodsFor: 'miscellaneous' stamp: 'sw 7/27/2001 13:35'! selectAll "Tell my editor to select all the text" self editor selectAll! ! !TextMorphForEditView reorganize! ('initialization' initialize) ('accept/cancel' acceptContents acceptOnCR: cancelEdits) ('miscellaneous' drawNullTextOn: flash handleInteraction:fromEvent: hasUnacceptedEdits: selectAll wouldAcceptKeyboardFocusUponTab) ('edit view' editView setEditView:) ('event handling' autoScrollView: handlesKeyboard: keyStroke: mouseDown: mouseMove: mouseUp:) ('object fileIn' convertToCurrentVersion:refStream:) ('debugging' tempCommand) ('private' updateFromParagraph) !