[BUG] SimpleHierarchicalListMorph does not understand#getCurrentSelectionIndex

Ned Konz ned at bike-nomad.com
Tue Jun 29 22:01:26 UTC 2004


On Tuesday 29 June 2004 10:39 am, Andreas Raab wrote:
> Try changing the last line in ObjectExplorer>>explorerKey:from: from
>
>     ^ self arrowKey: aChar from: view
>
> to
>
>     ^ view arrowKey: aChar

Of course, this brings up the question of why the callbacks work differently 
in the PluggableListMorph, (versus the SimpleHierarchicalListMorph, and the 
PluggableListView).

In the PLM, the model is NEVER called for any un-modified arrow keys, just for 
keys with modifiers (shift, alt, command, control?). The model never hears 
about keys whose asciiValue is < 32.


Browser(Model)>>arrowKey:from:
[...]
PluggableListMorph>>modifierKeyPressed:
	model perform: keystrokeActionSelector
		with: aChar
		with: self
PluggableListMorph>>keyStroke:
	| aChar aSpecialKey |
	(self scrollByKeyboard: event) ifTrue: [^self].
	aChar _ event keyCharacter.
	aSpecialKey _ aChar asciiValue.
	aSpecialKey < 32 ifTrue: [^ self specialKeyPressed: aSpecialKey].
	(event anyModifierKeyPressed or: [self handlesBasicKeys not])
		ifTrue: [^ self modifierKeyPressed: aChar].
	^ self basicKeyPressed: aChar


So none of the code in Model>>arrowKey: is ever executed from the PLM.

It could be moved into PLV and replaced with an empty method. It should 
*really* be called something like #commandKey: instead.

In the SHLM and the PLV, the model is always called if it set a 
keystrokeSelector. Which means that if you want to get a real arrow key 
action, you have to call *back* to the SHLM...

ObjectExplorer>>explorerKey:from:
SimpleHierarchicalListMorph>>keyStroke:
	| args aCharacter |
	(self scrollByKeyboard: event) ifTrue: [^self].
	aCharacter := event keyCharacter.
	keystrokeActionSelector isNil ifTrue: [^self arrowKey: aCharacter].
	^model perform: keystrokeActionSelector with: aCharacter.


Stay tuned for a fix...
-- 
Ned Konz
http://bike-nomad.com




More information about the Squeak-dev mailing list