[squeak-dev] The Trunk: Morphic-ul.582.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Oct 5 08:46:02 UTC 2011
Levente Uzonyi uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ul.582.mcz
==================== Summary ====================
Name: Morphic-ul.582
Author: ul
Time: 4 October 2011, 8:20:24.92 pm
UUID: 96276fc0-dc10-1f44-8908-dcb9b0673e38
Ancestors: Morphic-bf.581
- use #becomeForward: instead of #become:
- fix for Mantis #7674 http://bugs.squeak.org/view.php?id=7674
=============== Diff against Morphic-bf.581 ===============
Item was changed:
----- Method: Morph>>subclassMorph (in category 'meta-actions') -----
subclassMorph
"Create a new subclass of this morph's class and make this morph be an instance of it."
+ | oldClass newClassName newClass |
- | oldClass newClassName newClass newMorph |
oldClass := self class.
newClassName := UIManager default
request: 'Please give this new class a name'
initialAnswer: oldClass name.
newClassName = '' ifTrue: [^ self].
(Smalltalk includesKey: newClassName)
ifTrue: [^ self inform: 'Sorry, there is already a class of that name'].
newClass := oldClass subclass: newClassName asSymbol
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: oldClass category asString.
+ self becomeForward: (self as: newClass)!
- newMorph := self as: newClass.
- self become: newMorph.
- !
Item was changed:
----- Method: PluggableListMorph>>basicKeyPressed: (in category 'model access') -----
basicKeyPressed: aChar
| milliseconds slowKeyStroke listSize newSelectionIndex oldSelectionIndex startIndex |
oldSelectionIndex := newSelectionIndex := self getCurrentSelectionIndex.
listSize := self getListSize.
milliseconds := Time millisecondClockValue.
slowKeyStroke := (Time milliseconds: milliseconds since: lastKeystrokeTime) > 300.
lastKeystrokeTime := milliseconds.
slowKeyStroke
ifTrue: ["forget previous keystrokes and search in following elements"
lastKeystrokes := aChar asLowercase asString.
newSelectionIndex := newSelectionIndex \\ listSize + 1 ]
ifFalse: ["append quick keystrokes but don't move selection if it still matches"
+ lastKeystrokes := lastKeystrokes , aChar asLowercase asString.
+ newSelectionIndex := newSelectionIndex max: 1 ].
- lastKeystrokes := lastKeystrokes , aChar asLowercase asString ].
"No change if model is locked"
model okToChange ifFalse: [ ^self ].
"Get rid of blanks and style used in some lists"
startIndex := newSelectionIndex.
[
(self getListItem: newSelectionIndex) asString
withBlanksTrimmed asLowercase beginsWith: lastKeystrokes ]
whileFalse: [
(newSelectionIndex := newSelectionIndex \\ listSize + 1) = startIndex ifTrue: [
^self flash. "Not in list." ] ].
newSelectionIndex = oldSelectionIndex ifTrue: [ ^self flash ]. "Same selection."
^self changeModelSelection: newSelectionIndex!
More information about the Squeak-dev
mailing list
|