[squeak-dev] The Trunk: MorphicExtras-nice.53.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Oct 20 22:47:45 UTC 2009
Nicolas Cellier uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-nice.53.mcz
==================== Summary ====================
Name: MorphicExtras-nice.53
Author: nice
Time: 21 October 2009, 12:45:14 pm
UUID: 10a61fe2-1806-47b2-84ea-91ba7d347145
Ancestors: MorphicExtras-nice.52
Use #keys rather than #fasterKeys
Note that pattern (x keys asArray sort) could as well be written (x keys sort) now that keys returns an Array...
This #asArray is here solely for cross-dialect/fork compatibility.
=============== Diff against MorphicExtras-nice.52 ===============
Item was changed:
----- Method: ZoomAndScrollControllerMorph>>runAScript (in category 'as yet unclassified') -----
runAScript
| d names reply |
d := self targetScriptDictionary.
+ names := d keys asArray sort.
- names := d fasterKeys sort.
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 keys asArray sort.
- names := d fasterKeys sort.
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 keys asArray sort: [ :a :b | a size > b size ].
- keys := self fontMap fasterKeys 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 keys asArray sort.
- entryNames := aDictionary fasterKeys sort.
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 keys reject: [ :each | each = threadName]) asArray sort.
- others := (allThreads fasterKeys reject: [ :each | each = threadName]) sort.
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.
!
More information about the Squeak-dev
mailing list
|