The Trunk: Morphic-mt.1625.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.1625.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1625.mcz

==================== Summary ====================

Name: Morphic-mt.1625
Author: mt
Time: 18 February 2020, 2:48:07.01301 pm
UUID: 6c47c890-a344-414c-90b5-588d3b8514a9
Ancestors: Morphic-mt.1624

Fixes an issue with event dispatching used (only) in halo, which affects the balloon texts for those halo handles. Adds documentation of some tricky parts.

Not sure why MenuMorph is so clingy about its keyboard help. Manually delete that if the menu gets closed.

=============== Diff against Morphic-mt.1624 ===============

Item was changed:
  ----- Method: HandMorph>>balloonHelpList (in category 'balloon help') -----
  balloonHelpList
  "Return all balloon morphs associated with this hand"
 
+ self flag: #performance. "mt: Make it an instance variable because we need to access this on every keystroke in a text field. See senders of #deleteBalloon."
+
  ^ self
  valueOfProperty: #balloonHelpMorphs
  ifAbsentPut: [OrderedCollection new]!

Item was changed:
  ----- Method: HandMorph>>removePendingBalloonFor: (in category 'balloon help') -----
  removePendingBalloonFor: aMorph
+ "Get rid of pending balloon help or remove the balloon help if already shown."
+
+ self flag: #workaround. "mt: We do not track for which morph there is a pending balloon. To avoid cancelling the wrong requests, check whether the given morph wants a balloon or not. Seems to work fine."
+ aMorph wantsBalloon ifFalse: [^ self].
+
- "Get rid of pending balloon help."
  self removeAlarm: #spawnBalloonFor:.
  self deleteBalloonTarget: aMorph.!

Item was changed:
  ----- Method: MenuMorph>>delete (in category 'initialization') -----
  delete
  "Delete the receiver."
 
+ self hideKeyboardHelp.
  activeSubMenu ifNotNil: [activeSubMenu stayUp ifFalse: [activeSubMenu delete]].
  self isFlexed ifTrue: [^ owner delete].
  ^ super delete!

Item was changed:
  ----- Method: MenuMorph>>deleteIfPopUp (in category 'control') -----
  deleteIfPopUp
  "Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu."
 
  stayUp ifFalse: [self topRendererOrSelf delete].
  (popUpOwner notNil and: [popUpOwner isKindOf: MenuItemMorph]) ifTrue: [
  popUpOwner isSelected: false.
  (popUpOwner owner isKindOf: MenuMorph)
  ifTrue: [popUpOwner owner deleteIfPopUp]].
+ self hideKeyboardHelp.
  !

Item was changed:
  ----- Method: MenuMorph>>deleteIfPopUp: (in category 'control') -----
  deleteIfPopUp: evt
  "Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu."
 
  stayUp ifFalse: [self topRendererOrSelf delete].
  (popUpOwner notNil) ifTrue: [
  popUpOwner isSelected: false.
  popUpOwner deleteIfPopUp: evt].
  evt ifNotNil: [
  evt hand releaseMouseFocus: self.
  originalFocusHolder ifNotNil: [
+ self hideKeyboardHelp.
  evt hand newKeyboardFocus: originalFocusHolder.
  originalFocusHolder := nil]].!

Item was changed:
  ----- Method: MorphicEventDispatcher>>dispatchFocusEventAllOver:with: (in category 'focus events') -----
  dispatchFocusEventAllOver: evt with: focusMorph
  "Like a full event dispatch BUT adds regular dispatch if the focus morph did nothing with the event. This is useful for letting the focusMorph's siblings handle the events instead. Take halo invocation as an example. See senders of me."
 
  | result hand mouseFocus |
  result := self dispatchFocusEventFully: evt with: focusMorph.
 
+ evt isMouseOver ifTrue: [^ result].
+
  result == #rejected ifTrue: [^ result].
  result wasIgnored ifTrue: [^ result].
  result wasHandled ifTrue: [^ result].
- focusMorph world ifNil: [ ^ result ].
 
  hand := evt hand.
  mouseFocus := hand mouseFocus.
 
  [
  "Avoid re-dispatching the event to the focus morph. See Morph >> #rejectsEvent:."
  focusMorph lock.
-
- "Handle side effect for mouse-enter and mouse-leave events."
- self flag: #hacky. "mt: Maybe we find a better way to synthesize enter/leave events in the future."
  hand newMouseFocus: nil.
- hand mouseOverHandler processMouseOver: hand lastEvent.
 
+ "Give the event's hand a chance to normally dispatch it."
+ ^ hand handleEvent: evt
- "Give the morph's world a chance to normally dispatch the event."
- ^ focusMorph world ifNotNil: [ : world | world processEvent: evt using: self]
  ] ensure: [
  focusMorph unlock.
+ hand newMouseFocus: mouseFocus].!
- evt hand newMouseFocus: mouseFocus].!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.1625.mcz

Christoph Thiede

Hi Marcel,


this might be a minor regression:




The screenshot does not show it, but if I position the cursor over the red handle in front of the grip morph, the resize cursor is shown instead of Cursor normal.


Best,
Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Dienstag, 18. Februar 2020 14:48 Uhr
An: [hidden email]; [hidden email]
Betreff: [squeak-dev] The Trunk: Morphic-mt.1625.mcz
 
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1625.mcz

==================== Summary ====================

Name: Morphic-mt.1625
Author: mt
Time: 18 February 2020, 2:48:07.01301 pm
UUID: 6c47c890-a344-414c-90b5-588d3b8514a9
Ancestors: Morphic-mt.1624

Fixes an issue with event dispatching used (only) in halo, which affects the balloon texts for those halo handles. Adds documentation of some tricky parts.

Not sure why MenuMorph is so clingy about its keyboard help. Manually delete that if the menu gets closed.

=============== Diff against Morphic-mt.1624 ===============

Item was changed:
  ----- Method: HandMorph>>balloonHelpList (in category 'balloon help') -----
  balloonHelpList
         "Return all balloon morphs associated with this hand"
 
+        self flag: #performance. "mt: Make it an instance variable because we need to access this on every keystroke in a text field. See senders of #deleteBalloon."
+       
         ^ self
                 valueOfProperty: #balloonHelpMorphs
                 ifAbsentPut: [OrderedCollection new]!

Item was changed:
  ----- Method: HandMorph>>removePendingBalloonFor: (in category 'balloon help') -----
  removePendingBalloonFor: aMorph
+        "Get rid of pending balloon help or remove the balloon help if already shown."
+       
+        self flag: #workaround. "mt: We do not track for which morph there is a pending balloon. To avoid cancelling the wrong requests, check whether the given morph wants a balloon or not. Seems to work fine."
+        aMorph wantsBalloon ifFalse: [^ self].
+       
-        "Get rid of pending balloon help."
         self removeAlarm: #spawnBalloonFor:.
         self deleteBalloonTarget: aMorph.!

Item was changed:
  ----- Method: MenuMorph>>delete (in category 'initialization') -----
  delete
         "Delete the receiver."
 
+        self hideKeyboardHelp.
         activeSubMenu ifNotNil: [activeSubMenu stayUp ifFalse: [activeSubMenu delete]].
         self isFlexed ifTrue: [^ owner delete].
         ^ super delete!

Item was changed:
  ----- Method: MenuMorph>>deleteIfPopUp (in category 'control') -----
  deleteIfPopUp
         "Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu."
 
         stayUp ifFalse: [self topRendererOrSelf delete].
         (popUpOwner notNil and: [popUpOwner isKindOf: MenuItemMorph]) ifTrue: [
                 popUpOwner isSelected: false.
                 (popUpOwner owner isKindOf: MenuMorph)
                         ifTrue: [popUpOwner owner deleteIfPopUp]].
+        self hideKeyboardHelp.
  !

Item was changed:
  ----- Method: MenuMorph>>deleteIfPopUp: (in category 'control') -----
  deleteIfPopUp: evt
         "Remove this menu from the screen if stayUp is not true. If it is a submenu, also remove its owning menu."
 
         stayUp ifFalse: [self topRendererOrSelf delete].
         (popUpOwner notNil) ifTrue: [
                 popUpOwner isSelected: false.
                 popUpOwner deleteIfPopUp: evt].
         evt ifNotNil: [
                 evt hand releaseMouseFocus: self.
                 originalFocusHolder ifNotNil: [
+                        self hideKeyboardHelp.
                         evt hand newKeyboardFocus: originalFocusHolder.
                         originalFocusHolder := nil]].!

Item was changed:
  ----- Method: MorphicEventDispatcher>>dispatchFocusEventAllOver:with: (in category 'focus events') -----
  dispatchFocusEventAllOver: evt with: focusMorph
         "Like a full event dispatch BUT adds regular dispatch if the focus morph did nothing with the event. This is useful for letting the focusMorph's siblings handle the events instead. Take halo invocation as an example. See senders of me."
        
         | result hand mouseFocus |
         result := self dispatchFocusEventFully: evt with: focusMorph.
        
+        evt isMouseOver ifTrue: [^ result].
+       
         result == #rejected ifTrue: [^ result].
         result wasIgnored ifTrue: [^ result].
         result wasHandled ifTrue: [^ result].
-        focusMorph world ifNil: [ ^ result ].
 
         hand := evt hand.
         mouseFocus := hand mouseFocus.
 
         [
                 "Avoid re-dispatching the event to the focus morph. See Morph >> #rejectsEvent:."
                 focusMorph lock.
-               
-                "Handle side effect for mouse-enter and mouse-leave events."
-                self flag: #hacky. "mt: Maybe we find a better way to synthesize enter/leave events in the future."
                 hand newMouseFocus: nil.
-                hand mouseOverHandler processMouseOver: hand lastEvent.
                
+                "Give the event's hand a chance to normally dispatch it."
+                ^ hand handleEvent: evt
-                "Give the morph's world a chance to normally dispatch the event."
-                ^ focusMorph world ifNotNil: [ : world | world processEvent: evt using: self]
         ] ensure: [
                 focusMorph unlock.
+                hand newMouseFocus: mouseFocus].!
-                evt hand newMouseFocus: mouseFocus].!




Carpe Squeak!