Hi, i was looking at this issue and I have some questions :):
- There are some changes to HandMorph in a changeset hardcoded in the
ConfigurationOfAlgernon. As Mariano said here (
http://forum.world.st/Putting-Algernon-and-WorkingSet-in-a-Dev-image-td1295930.html#a1295941)
"The main change does the simples modifications to HandMorph for it to
support various focus holders". Is it safe to integrate it in Pharo? If
so, should it be integrated in the core Morph package? The changeset is
the following:
* '''From Squeak3.7gamma of ''''17 July 2004'''' [latest update: #5985] on 9
August 2004 at 7:56:10 pm''!
"Change Set: MultipleFocusHolder-hpt
Date: 9 August 2004
Author: Hernan Tylim
This changesets does the simplest modifications to HandMorph for it to
support various focus holders.
The important changes are:
* addiionalKeyboardFocuses instance variable was added with its getter and
setter methods.
* HandMorph>>sendKeyboardEvent: was changed to traverse the list of keyboard
focus holders and call HandMorph>>sendEvent:focus:clear: to each one of
them.
* HandMorph>>sendEvent:focus:clear: was changed to preserve the
''wasHandled'' status of the event, before that info were lost because the
Event instance were copied before passed to the Morph.
"!
Morph subclass: #HandMorph
instanceVariableNames: ''mouseFocus keyboardFocus eventListeners
mouseListeners keyboardListeners mouseClickState mouseOverHandler
lastMouseEvent targetOffset damageRecorder cacheCanvas cachedCanvasHasHoles
temporaryCursor temporaryCursorOffset hasChanged savedPatch userInitials
lastEventBuffer genieGestureProcessor additionalKeyboardFocuses ''
classVariableNames: ''DoubleClickTime EventStats NewEventRules
NormalCursor PasteBuffer ShowEvents ''
poolDictionaries: ''EventSensorConstants''
category: ''Morphic-Kernel''!
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/8/2004 01:52''!
addAdditionalKeyboardFocus: aMorph
(self additionalKeyboardFocuses includes: aMorph)
ifFalse: [self additionalKeyboardFocuses addFirst: aMorph]! !
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/7/2004 23:47''!
additionalKeyboardFocuses
^additionalKeyboardFocuses ifNil: [additionalKeyboardFocuses _
OrderedCollection new].! !
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/8/2004 00:12''!
clearFocusHolder: aMorph
self keyboardFocus == aMorph
ifTrue: [^self keyboardFocus: nil].
(self additionalKeyboardFocuses includes: aMorph)
ifTrue: [self removeAdditionalKeyboardFocus: aMorph].! !
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/7/2004 23:48''!
fullKeyboardFocuses
^self additionalKeyboardFocuses copyWith: self keyboardFocus.! !
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/7/2004 23:43''!
keyboardFocuses
keyboardFocuses ifNil: [keyboardFocuses := OrderedCollection new].
^keyboardFocuses! !
!HandMorph methodsFor: ''focus handling'' stamp: ''hpt 8/7/2004 23:49''!
removeAdditionalKeyboardFocus: aMorph
self additionalKeyboardFocuses remove: aMorph! !
!HandMorph methodsFor: ''private events'' stamp: ''hpt 8/8/2004 01:18''!
sendFocusEvent: anEvent to: focusHolder clear: aBlock
"Send the event to the morph currently holding the focus"
| result w e |
w _ focusHolder world ifNil:[^ aBlock value].
w becomeActiveDuring:[
ActiveHand _ self.
ActiveEvent _ anEvent.
e _ (anEvent transformedBy: (focusHolder transformedFrom: self)).
result _ focusHolder handleFocusEvent: e .
anEvent wasHandled: e wasHandled.
].
^result! !
!HandMorph methodsFor: ''private events'' stamp: ''hpt 8/8/2004 01:09''!
sendKeyboardEvent: anEvent
"Send the event to the morph currently holding the focus, or if none to
the owner of the hand."
self fullKeyboardFocuses do: [:focusHolder |
"(anEvent keyCharacter = $\) ifTrue: [self halt]."
anEvent wasHandled
ifFalse: [self sendEvent: anEvent focus: focusHolder clear:[self
clearFocusHolder: focusHolder]]].! !
Morph subclass: #HandMorph
instanceVariableNames: ''mouseFocus keyboardFocus eventListeners
mouseListeners keyboardListeners mouseClickState mouseOverHandler
lastMouseEvent targetOffset damageRecorder cacheCanvas cachedCanvasHasHoles
temporaryCursor temporaryCursorOffset hasChanged savedPatch userInitials
lastEventBuffer genieGestureProcessor additionalKeyboardFocuses''
classVariableNames: ''DoubleClickTime EventStats NewEventRules
NormalCursor PasteBuffer ShowEvents''
poolDictionaries: ''EventSensorConstants''
category: ''Morphic-Kernel''!
*'
It should be nice someone who knows well morphic checks it.
Cheers,
Guille
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project