The Trunk: Morphic-mt.1140.mcz

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

The Trunk: Morphic-mt.1140.mcz

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

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

Name: Morphic-mt.1140
Author: mt
Time: 9 May 2016, 1:37:31.427729 pm
UUID: fecf2a29-d4e3-c547-b948-21eca8fe7c5a
Ancestors: Morphic-mt.1139

Look up a morph's active hand also via the world it is in. Use this when activating a system window or deleting a morph. -- This makes much Morphic code work from within MVC or testing environments.

=============== Diff against Morphic-mt.1139 ===============

Item was changed:
  ----- Method: Morph>>activeHand (in category 'structure') -----
  activeHand
+
+ ^ ActiveHand ifNil: [
+ self isInWorld
+ ifTrue: [self world activeHand]
+ ifFalse: [nil]]!
- ^ActiveHand!

Item was changed:
  ----- Method: Morph>>delete (in category 'submorphs-add/remove') -----
  delete
  "Remove the receiver as a submorph of its owner and make its
  new owner be nil."
 
  | aWorld |
  self removeHalo.
+
+ self isInWorld ifTrue: [
+ self disableSubmorphFocusForHand: self activeHand.
+ self activeHand
+   releaseKeyboardFocus: self;
+ releaseMouseFocus: self].
+
+ "Preserve world reference for player notificaiton. See below."
  aWorld := self world ifNil: [World].
+
+ owner ifNotNil:[
+ self privateDelete.
+ self player ifNotNil: [:player |
- "Terminate genie recognition focus"
- "I encountered a case where the hand was nil, so I put in a little
- protection - raa "
- " This happens when we are in an MVC project and open
-  a morphic window. - BG "
- aWorld ifNotNil:
-  [self disableSubmorphFocusForHand: self activeHand.
-  self activeHand releaseKeyboardFocus: self;
-  releaseMouseFocus: self.].
- owner ifNotNil:[ self privateDelete.
- self player ifNotNil: [ :player |
- "Player must be notified"
  player noteDeletionOf: self fromWorld: aWorld]].!

Item was changed:
  ----- Method: SystemWindow>>activate (in category 'top window') -----
  activate
  "Bring the receiver to the top.  If I am modal, bring along my owning window as well."
  | modalOwner |
  self modalChild ifNotNil:
  [ : modalChild | modalChild owner ifNotNil:
  [ modalChild activate.
  ^ modalChild modalChild ifNil: [ modalChild flash ] ] ].
  (isCollapsed not and:
  [ self paneMorphs size > 1 and: [ self splitters isEmpty ] ]) ifTrue: [ self addPaneSplitters ].
  self activateWindow.
+ PasteUpMorph globalCommandKeysEnabled ifTrue: [self activeHand addKeyboardListener: self].
- PasteUpMorph globalCommandKeysEnabled ifTrue: [ActiveHand addKeyboardListener: self].
  modalOwner := self modalOwner.
  (modalOwner notNil and: [ modalOwner isSystemWindow ]) ifTrue: [ modalOwner bringBehind: self ]!