The Inbox: Morphic-ct.1677.mcz

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

The Inbox: Morphic-ct.1677.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1677.mcz

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

Name: Morphic-ct.1677
Author: ct
Time: 22 August 2020, 7:34:52.856555 pm
UUID: 094ccc97-c3f6-364c-a10d-7418b3482703
Ancestors: Morphic-mt.1674

Nuke backward compatibility for Squeak 2.x menus. This should really not be relevant any longer I think. ;-)

Also minor refactoring to MenuItemMorph >> #invokeWithEvent:.

=============== Diff against Morphic-mt.1674 ===============

Item was changed:
  ----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
  invokeWithEvent: evt
  "Perform the action associated with the given menu item."
 
- | w |
  self isEnabled ifFalse: [^ self].
+
+ (owner notNil and: [self isStayUpItem not]) ifTrue: [
- target class == HandMorph ifTrue: [(self notObsolete) ifFalse: [^ self]].
- owner ifNotNil:[self isStayUpItem ifFalse:[
  self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
+ self world ifNotNil: [:world |
- (w := self world) ifNotNil:[
  owner deleteIfPopUp: evt.
  "Repair damage before invoking the action for better feedback"
+ world displayWorldSafely]].
+
+ selector ifNil: [^ self].
+
+ Cursor normal showWhile: [
+ "show cursor in case item opens a new MVC window"
+ selector numArgs isZero
+ ifTrue: [target perform: selector]
+ ifFalse: [target perform: selector withArguments: (
+ selector numArgs = arguments size
+ ifTrue: [arguments]
+ ifFalse: [arguments copyWith: evt] )] ].!
- w displayWorldSafely]]].
- selector ifNil:[^self].
- Cursor normal showWhile: [ | selArgCount |  "show cursor in case item opens a new MVC window"
- (selArgCount := selector numArgs) = 0
- ifTrue:
- [target perform: selector]
- ifFalse:
- [selArgCount = arguments size
- ifTrue: [target perform: selector withArguments: arguments]
- ifFalse: [target perform: selector withArguments: (arguments copyWith: evt)]]].!

Item was removed:
- ----- Method: MenuItemMorph>>notObsolete (in category 'private') -----
- notObsolete
- "Provide backward compatibility with messages being sent to the Hand.  Remove this when no projects made prior to 2.9 are likely to be used.  If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu."
-
- (HandMorph canUnderstand: (selector)) ifTrue: [^ true]. "a modern one"
-
- self inform: 'This world menu is obsolete.
- Please dismiss the menu and open a new one.'.
- ^ false
- !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1677.mcz

Eliot Miranda-2
Hi Christoph,

    I haven't copied this to trunk. not because it looks bad (it doesn't), but because I'm not qualified. Better someone who knows menus better than I does the integration.

On Sat, Aug 22, 2020 at 10:35 AM <[hidden email]> wrote:
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1677.mcz

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

Name: Morphic-ct.1677
Author: ct
Time: 22 August 2020, 7:34:52.856555 pm
UUID: 094ccc97-c3f6-364c-a10d-7418b3482703
Ancestors: Morphic-mt.1674

Nuke backward compatibility for Squeak 2.x menus. This should really not be relevant any longer I think. ;-)

Also minor refactoring to MenuItemMorph >> #invokeWithEvent:.

=============== Diff against Morphic-mt.1674 ===============

Item was changed:
  ----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
  invokeWithEvent: evt
        "Perform the action associated with the given menu item."

-       | w |
        self isEnabled ifFalse: [^ self].
+       
+       (owner notNil and: [self isStayUpItem not]) ifTrue: [
-       target class == HandMorph ifTrue: [(self notObsolete) ifFalse: [^ self]].
-       owner ifNotNil:[self isStayUpItem ifFalse:[
                self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
+               self world ifNotNil: [:world |
-               (w := self world) ifNotNil:[
                        owner deleteIfPopUp: evt.
                        "Repair damage before invoking the action for better feedback"
+                       world displayWorldSafely]].
+       
+       selector ifNil: [^ self].
+       
+       Cursor normal showWhile: [
+               "show cursor in case item opens a new MVC window"
+               selector numArgs isZero
+                               ifTrue: [target perform: selector]
+                               ifFalse: [target perform: selector withArguments: (
+                                       selector numArgs = arguments size
+                                               ifTrue: [arguments]
+                                               ifFalse: [arguments copyWith: evt] )] ].!
-                       w displayWorldSafely]]].
-       selector ifNil:[^self].
-       Cursor normal showWhile: [ | selArgCount |  "show cursor in case item opens a new MVC window"
-               (selArgCount := selector numArgs) = 0
-                       ifTrue:
-                               [target perform: selector]
-                       ifFalse:
-                               [selArgCount = arguments size
-                                       ifTrue: [target perform: selector withArguments: arguments]
-                                       ifFalse: [target perform: selector withArguments: (arguments copyWith: evt)]]].!

Item was removed:
- ----- Method: MenuItemMorph>>notObsolete (in category 'private') -----
- notObsolete
-       "Provide backward compatibility with messages being sent to the Hand.  Remove this when no projects made prior to 2.9 are likely to be used.  If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu."
-
-       (HandMorph canUnderstand: (selector)) ifTrue: [^ true].         "a modern one"
-
-       self inform: 'This world menu is obsolete.
- Please dismiss the menu and open a new one.'.
-       ^ false
- !




--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1677.mcz

Christoph Thiede

No problem. Thank you for reviewing the other commits!


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Sonntag, 23. August 2020 04:14:16
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Morphic-ct.1677.mcz
 
Hi Christoph,

    I haven't copied this to trunk. not because it looks bad (it doesn't), but because I'm not qualified. Better someone who knows menus better than I does the integration.

On Sat, Aug 22, 2020 at 10:35 AM <[hidden email]> wrote:
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1677.mcz

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

Name: Morphic-ct.1677
Author: ct
Time: 22 August 2020, 7:34:52.856555 pm
UUID: 094ccc97-c3f6-364c-a10d-7418b3482703
Ancestors: Morphic-mt.1674

Nuke backward compatibility for Squeak 2.x menus. This should really not be relevant any longer I think. ;-)

Also minor refactoring to MenuItemMorph >> #invokeWithEvent:.

=============== Diff against Morphic-mt.1674 ===============

Item was changed:
  ----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
  invokeWithEvent: evt
        "Perform the action associated with the given menu item."

-       | w |
        self isEnabled ifFalse: [^ self].
+       
+       (owner notNil and: [self isStayUpItem not]) ifTrue: [
-       target class == HandMorph ifTrue: [(self notObsolete) ifFalse: [^ self]].
-       owner ifNotNil:[self isStayUpItem ifFalse:[
                self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
+               self world ifNotNil: [:world |
-               (w := self world) ifNotNil:[
                        owner deleteIfPopUp: evt.
                        "Repair damage before invoking the action for better feedback"
+                       world displayWorldSafely]].
+       
+       selector ifNil: [^ self].
+       
+       Cursor normal showWhile: [
+               "show cursor in case item opens a new MVC window"
+               selector numArgs isZero
+                               ifTrue: [target perform: selector]
+                               ifFalse: [target perform: selector withArguments: (
+                                       selector numArgs = arguments size
+                                               ifTrue: [arguments]
+                                               ifFalse: [arguments copyWith: evt] )] ].!
-                       w displayWorldSafely]]].
-       selector ifNil:[^self].
-       Cursor normal showWhile: [ | selArgCount |  "show cursor in case item opens a new MVC window"
-               (selArgCount := selector numArgs) = 0
-                       ifTrue:
-                               [target perform: selector]
-                       ifFalse:
-                               [selArgCount = arguments size
-                                       ifTrue: [target perform: selector withArguments: arguments]
-                                       ifFalse: [target perform: selector withArguments: (arguments copyWith: evt)]]].!

Item was removed:
- ----- Method: MenuItemMorph>>notObsolete (in category 'private') -----
- notObsolete
-       "Provide backward compatibility with messages being sent to the Hand.  Remove this when no projects made prior to 2.9 are likely to be used.  If this method is removed early, the worst that can happen is a notifier when invoking an item in an obsolete menu."
-
-       (HandMorph canUnderstand: (selector)) ifTrue: [^ true].         "a modern one"
-
-       self inform: 'This world menu is obsolete.
- Please dismiss the menu and open a new one.'.
-       ^ false
- !




--
_,,,^..^,,,_
best, Eliot


Carpe Squeak!