[squeak-dev] The Inbox: Morphic-cbc.1665.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sat Jun 6 12:22:33 UTC 2020

Hi Chris,

what do you think about Morphic-ct.1666? :-) It would be nice if we did not completely lose the opportunity to manually activate the message and interact with it via keyboard.



Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Chris Cunningham <cunningham.cb at gmail.com>
Gesendet: Samstag, 6. Juni 2020 04:41:50
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Morphic-cbc.1665.mcz

This fixes the mangling I accidentally did to Marcel's changes, following his suggestion (roughly).

I now get the best of both worlds in my image.  If noone objects, I'll move it to trunk in a few days.


On Fri, Jun 5, 2020 at 7:38 PM <commits at source.squeak.org<mailto:commits at source.squeak.org>> wrote:
A new version of Morphic was added to project The Inbox:

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

Name: Morphic-cbc.1665
Author: cbc
Time: 5 June 2020, 7:38:31.284262 pm
UUID: c887ffd7-40ae-3547-8240-13186db081c8
Ancestors: Morphic-cbc.1664

Add support for locking a morph so that it doesn't accept keyboard actions - but is still accessible with the mouse.  Sending #rejectKeyboardFocus will make that morph completely ignore keyboard events of any kind.  A morph can be tested with #shouldRejectKeyboardFocus to see if this should happen.
DialogWindow has been modified to reject keyboard focus, so that in (say, ConfirmDialogs) you can still use the keyboard to interact with the keys AND you can interact with the message text via the mouse.
(Also updated StringMorph similarly.)

=============== Diff against Morphic-cbc.1664 ===============

Item was changed:
  ----- Method: DialogWindow>>createMessage: (in category 'initialization') -----
  createMessage: aString

        messageMorph := aString asText asMorph.
                name: 'Message';
                readOnly: true;
                setProperty: #indicateKeyboardFocus toValue: #never;
+               rejectKeyboardFocus.
-               lock.
        self setMessageParameters.
        ^ messageMorph!

Item was added:
+ ----- Method: Morph>>rejectKeyboardFocus (in category 'accessing') -----
+ rejectKeyboardFocus
+       self rejectKeyboardFocus: true.!

Item was added:
+ ----- Method: Morph>>rejectKeyboardFocus: (in category 'accessing') -----
+ rejectKeyboardFocus: boolean
+       self setProperty: #rejectKeyboardFocus toValue: boolean!

Item was changed:
  ----- Method: Morph>>rejectsEvent: (in category 'events-processing') -----
  rejectsEvent: anEvent
        "Return true to reject the given event. Rejecting an event means neither the receiver nor any of it's submorphs will be given any chance to handle it."
+       ^self isLocked or: [self visible not or: [anEvent isKeyboard and: [self shouldRejectKeyboardFocus]]]!
-       ^self isLocked or:[self visible not]!

Item was added:
+ ----- Method: Morph>>rejectsKeyboardFocus (in category 'testing') -----
+ rejectsKeyboardFocus
+       ^self valueOfProperty: #rejectKeyboardFocus ifAbsent: [false]!

Item was added:
+ ----- Method: Morph>>shouldRejectKeyboardFocus (in category 'testing') -----
+ shouldRejectKeyboardFocus
+       ^self valueOfProperty: #rejectKeyboardFocus ifAbsent: [false]!

Item was changed:
  ----- Method: StringMorph>>wouldAcceptKeyboardFocus (in category 'event handling') -----
+       ^ self isLocked not and: [self shouldRejectKeyboardFocus not]!
-       ^ self isLocked not!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200606/0367c58f/attachment.html>

More information about the Squeak-dev mailing list