Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.51.mcz ==================== Summary ==================== Name: MorphicExtras-nice.51 Author: nice Time: 20 October 2009, 12:40:17 pm UUID: 1ffb1582-3512-d049-a7b4-f598f98f23e5 Ancestors: MorphicExtras-ar.50 use #fasterKeys =============== Diff against MorphicExtras-ar.50 =============== Item was changed: ----- Method: ZoomAndScrollControllerMorph>>runAScript (in category 'as yet unclassified') ----- runAScript | d names reply | d := self targetScriptDictionary. + names := d fasterKeys sort. - names := d keys asSortedCollection. reply := UIManager default chooseFrom: names values: names title: 'Script to run?'. reply ifNil: [^ self]. programmedMoves := (d at: reply) veryDeepCopy.! Item was changed: ----- Method: ZoomAndScrollControllerMorph>>editAScript (in category 'as yet unclassified') ----- editAScript | d names reply s | d := self targetScriptDictionary. + names := d fasterKeys sort. - names := d keys asSortedCollection. reply := UIManager default chooseFrom: names values: names title: 'Script to edit?'. reply ifNil: [^ self]. (s := ZASMScriptMorph new) decompileScript: (d at: reply) named: reply for: self; fullBounds; align: s center with: self center; openInWorld ! Item was changed: ----- Method: PostscriptCanvas class>>postscriptFontInfoForFont: (in category 'font mapping') ----- postscriptFontInfoForFont: font | fontName decoded desired mask decodedName keys match | fontName := font textStyleName asString. decoded := TextStyle decodeStyleName: fontName. decodedName := decoded second. + keys := self fontMap fasterKeys sort: [ :a :b | a size > b size ]. - keys := self fontMap keys asArray sort: [ :a :b | a size > b size ]. match := keys select: [ :k | decoded first = k or: [ fontName = k ] ]. match do: [ :key | | subD | subD := self fontMap at: key. desired := font emphasis. mask := 31. [ desired := desired bitAnd: mask. subD at: desired ifPresent: [ :answer | ^answer]. mask := mask bitShift: -1. desired > 0 ] whileTrue. ]. "No explicit lookup found; try to convert the style name into the canonical Postscript name. This name will probably still be wrong." fontName := String streamContents: [ :s | s nextPutAll: decodedName. decoded third do: [ :nm | s nextPut: $-; nextPutAll: nm ]. (font emphasis == 0 and: [ (decoded last includes: 0) not ]) ifTrue: [ s nextPutAll: '-Regular' ]. (font emphasis == 1 and: [ (decoded first anyMask: 1) not ]) ifTrue: [ s nextPutAll: '-Bold' ]. (font emphasis == 2 and: [ (decoded first anyMask: 2) not ]) ifTrue: [ s nextPutAll: '-Italic' ]. (font emphasis == 3 and: [ (decoded first anyMask: 3) not ]) ifTrue: [ s nextPutAll: '-BoldItalic' ]. ]. ^ {fontName. 1.0} ! Item was changed: ----- Method: GraphicalDictionaryMenu>>baseDictionary: (in category 'initialization') ----- baseDictionary: aDictionary baseDictionary := aDictionary. + entryNames := aDictionary fasterKeys sort. - entryNames := aDictionary keys asSortedArray. formChoices := entryNames collect: [:n | aDictionary at: n]. currentIndex := 1! Item was changed: ----- Method: InternalThreadNavigationMorph>>moreCommands (in category 'navigation') ----- moreCommands "Put up a menu of options" | allThreads aMenu others target | allThreads := self class knownThreads. aMenu := MenuMorph new defaultTarget: self. aMenu addTitle: 'navigation' translated. Preferences noviceMode ifFalse:[ self flag: #deferred. "Probably don't want that stay-up item, not least because the navigation-keystroke stuff is not dynamically handled" aMenu addStayUpItem ]. + others := (allThreads fasterKeys reject: [ :each | each = threadName]) sort. - others := (allThreads keys reject: [ :each | each = threadName]) asSortedCollection. others do: [ :each | aMenu add: ('switch to <{1}>' translated format:{each}) selector: #switchToThread: argument: each ]. aMenu addList: { {'switch to recent projects' translated. #getRecentThread}. #-. {'create a new thread' translated. #threadOfNoProjects}. {'edit this thread' translated. #editThisThread}. {'create thread of all projects' translated. #threadOfAllProjects}. #-. {'First project in thread' translated. #firstPage}. {'Last project in thread' translated. #lastPage} }. (target := self currentIndex + 2) > listOfPages size ifFalse: [ aMenu add: ('skip over next project ({1})' translated format:{(listOfPages at: target - 1) first}) action: #skipOverNext ]. aMenu addList: { {'jump within this thread' translated. #jumpWithinThread}. {'insert new project' translated. #insertNewProject}. #-. {'simply close this navigator' translated. #delete}. {'destroy this thread' translated. #destroyThread}. #- }. (ActiveWorld keyboardNavigationHandler == self) ifFalse:[ aMenu add: 'start keyboard navigation with this thread' translated action: #startKeyboardNavigation ] ifTrue: [ aMenu add: 'stop keyboard navigation with this thread' translated action: #stopKeyboardNavigation ]. aMenu popUpInWorld. ! |
Free forum by Nabble | Edit this page |