'From Squeak3.1alpha of 28 February 2001 [latest update: #3979] on 4 May 2001 at 6:09:40 am'! "Change Set: misc-sw Date: 4 May 2001 Author: Scott Wallace ¥ Fixes bug such that if the only category associated with a given selector was 'as yet unclassified', it was falsely thought to be unimplemented by some operations in a Lexicon. ¥ Makes the find-change-sets-with-selector command directly available in the shifted text-editing menu. ¥ Bulletproofs preexisting viewer panes against the problem fixed in update 3975"! !FullVocabulary methodsFor: 'queries' stamp: 'sw 4/23/2001 14:42'! categoryWithNameIn: categoryNames thatIncludesSelector: aSelector forInstance: targetInstance ofClass: targetClass "Answer the name of a category, from among the provided categoryNames, which defines the selector for the given class. Here, if the category designated by the implementing class is acceptable it is the one returned" | aClass catName result | (aClass _ targetClass classThatUnderstands: aSelector) ifNotNil: [(categoryNames includes: (catName _ aClass whichCategoryIncludesSelector: aSelector)) ifTrue: [(catName ~~ #'as yet unclassified') ifTrue: [^ catName]]]. result _ super categoryWithNameIn: categoryNames thatIncludesSelector: aSelector forInstance: targetInstance ofClass: aClass. ^ result ifNil: [#'as yet unclassified']! ! !ParagraphEditor methodsFor: 'menu messages' stamp: 'sw 4/24/2001 12:22'! browseChangeSetsWithSelector "Determine which, if any, change sets have at least one change for the selected selector, independent of class" | aSelector | self lineSelectAndEmptyCheck: [^ self]. (aSelector _ self selectedSelector) == nil ifTrue: [^ view flash]. self terminateAndInitializeAround: [ChangeSorter browseChangeSetsWithSelector: aSelector]! ! !ParagraphEditor methodsFor: 'editing keys' stamp: 'sw 4/24/2001 12:28'! fileItIn: characterStream "File in the selection; invoked via a keyboard shortcut, -- for now, cmd-shift-G." sensor keyboard. "flush character" self terminateAndInitializeAround: [self fileItIn]. ^ true! ! !ParagraphEditor methodsFor: 'typing/selecting keys' stamp: 'sw 4/30/2001 21:20'! cursorTopHome: characterStream "Put cursor at beginning of text -- invoked from cmd-H shortcut, useful for keyboards that have no home key." sensor keyboard. self selectAt: 1. ^ true! ! !ParagraphEditor class methodsFor: 'class initialization' stamp: 'sw 5/2/2001 15:06'! shiftedYellowButtonMenu "Answer the menu to be presented when the yellow button is pressed while the shift key is down" ^ SelectionMenu fromArray: #( ('set font... (k)' offerFontMenu) ('set style... (K)' changeStyle) ('set alignment...' chooseAlignment) - ('explain' explain) ('pretty print' prettyPrint) ('pretty print with color' prettyPrintWithColor) ('file it in (G)' fileItIn) ('tiles from it' selectionAsTiles) ('recognizer (r)' recognizeCharacters) ('spawn (o)' spawn) - ('definition of word' wordDefinition) ('verify spelling of word' verifyWordSpelling) " ('spell check it' spellCheckIt) " ('translate it' translateIt) ('choose language' languagePrefs) - ('browse it (b)' browseIt) ('senders of it (n)' sendersOfIt) ('implementors of it (m)' implementorsOfIt) ('references to it (N)' referencesToIt) - ('selectors containing it (W)' methodNamesContainingIt) ('method strings with it (E)' methodStringsContainingit) ('method source with it' methodSourceContainingIt) ('class comments with it' classCommentsContainingIt) ('change sets with it' browseChangeSetsWithSelector) - ('save contents to file...' saveContentsInFile) ('send contents to printer' sendContentsToPrinter) ('printer setup' printerSetup) - ('special menu...' presentSpecialMenu) ('more...' yellowButtonActivity))! ! !ParagraphEditor class methodsFor: 'keyboard shortcut tables' stamp: 'sw 4/30/2001 20:29'! initializeShiftCmdKeyShortcuts "Initialize the shift-command-key (or control-key) shortcut table." "NOTE: if you don't know what your keyboard generates, use Sensor kbdTest" "wod 11/3/1998: Fix setting of cmdMap for shifted keys to actually use the capitalized versions of the letters. TPR 2/18/99: add the plain ascii values back in for those VMs that don't return the shifted values." | cmdMap cmds | "shift-command and control shortcuts" cmdMap _ Array new: 256 withAll: #noop:. "use temp in case of a crash" cmdMap at: ( 1 + 1) put: #cursorHome:. "home key" cmdMap at: ( 4 + 1) put: #cursorEnd:. "end key" cmdMap at: ( 8 + 1) put: #forwardDelete:. "ctrl-H or delete key" cmdMap at: (11 + 1) put: #cursorPageUp:. "page up key" cmdMap at: (12 + 1) put: #cursorPageDown:. "page down key" cmdMap at: (13 + 1) put: #crWithIndent:. "ctrl-Return" cmdMap at: (27 + 1) put: #selectCurrentTypeIn:. "escape key" cmdMap at: (28 + 1) put: #cursorLeft:. "left arrow key" cmdMap at: (29 + 1) put: #cursorRight:. "right arrow key" cmdMap at: (30 + 1) put: #cursorUp:. "up arrow key" cmdMap at: (31 + 1) put: #cursorDown:. "down arrow key" cmdMap at: (32 + 1) put: #selectWord:. "space bar key" cmdMap at: (45 + 1) put: #changeEmphasis:. "cmd-sh-minus" cmdMap at: (61 + 1) put: #changeEmphasis:. "cmd-sh-plus" cmdMap at: (127 + 1) put: #forwardDelete:. "del key" "Note: Command key overrides shift key, so, for example, cmd-shift-9 produces $9 not $(" '9[,''' do: [ :char | cmdMap at: (char asciiValue + 1) put: #shiftEnclose: ]. "({< and double-quote" "Note: Must use cmd-9 or ctrl-9 to get '()' since cmd-shift-9 is a Mac FKey command." cmdMap at: (27 + 1) put: #shiftEnclose:. "ctrl-[" "'""''(' do: [ :char | cmdMap at: (char asciiValue + 1) put: #enclose:]." cmds _ #( $a argAdvance: $b browseItHere: $c compareToClipboard: $d duplicate: $e methodStringsContainingIt: $f displayIfFalse: $g fileItIn: $h cursorTopHome: $i exploreIt: $j doAgainMany: $k changeStyle: $l outdent: $n referencesToIt: $p makeProjectLink: $r indent: $s search: $t displayIfTrue: $u changeLfToCr: $v pasteInitials: $w methodNamesContainingIt: $x makeLowercase: $y makeUppercase: $z makeCapitalized: ). 1 to: cmds size by: 2 do: [ :i | cmdMap at: ((cmds at: i) asciiValue + 1) put: (cmds at: i + 1). "plain keys" cmdMap at: ((cmds at: i) asciiValue - 32 + 1) put: (cmds at: i + 1). "shifted keys" cmdMap at: ((cmds at: i) asciiValue - 96 + 1) put: (cmds at: i + 1). "ctrl keys" ]. ShiftCmdActions _ cmdMap! ! !Player methodsFor: 'slot getters/setters' stamp: 'sw 5/4/2001 06:06'! setColorUnder: aValue "Provide a soft landing for old readouts that may try to send this"! ! !PluggableTextMorph methodsFor: 'menu commands' stamp: 'sw 4/24/2001 12:24'! browseChangeSetsWithSelector "Help the user track down which change sets mention a particular selector" self handleEdit: [textMorph editor browseChangeSetsWithSelector]! ! "Postscript:" ParagraphEditor initialize. !