[squeak-dev] The Trunk: Morphic-mt.1852.mcz
marcel.taeumel at hpi.de
Sat Jan 22 08:48:45 UTC 2022
Hi Chris, hi all --
Maybe we need a better interface to communicate "cancel" in the face of models using #textEdited:? Hmm... maybe we should directly ask the model and let it decide to retrieve the cancelled contents... the widget cannot do much in this situation...
Am 22.01.2022 09:40:04 schrieb Marcel Taeumel <marcel.taeumel at hpi.de>:
Hi Chris --
I don't understand what you are talking about. Both "accept" and "cancel" have still consistent and predictable behaviors. The only "new thing", which was already there in 5.3, is maybe #textEdited: where models can directly intercept typed contents and use them. This is unrelated to the still functional "accept" and "cancel" operations.
> What is the benefit of tossing the user's input which they explicitly accepted?
We don't do that. What are you referring to?
Am 22.01.2022 07:23:45 schrieb Chris Muller <asqueaker at gmail.com>:
"Accept" and "Cancel" had consistent and predictable behaviors until
5.3, when they suddenly became exceptional. What is the benefit of
tossing the user's input which they explicitly accepted?
If the user explicitly "accepted" certain contents before, isn't that
their instruction of what they want? And if they wanted blank, they
could just as easily accept blank contents. This would at least be a
consistent behavior, _and_ a useful function. And the user endures no
extra keystrokes to "Delete everything" because Cmd+a prepare that
upon their next keystroke.
The old behavior seems better from multiple points.
On Thu, Jan 20, 2022 at 5:46 AM wrote:
> Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
> ==================== Summary ====================
> Name: Morphic-mt.1852
> Author: mt
> Time: 20 January 2022, 12:46:23.025835 pm
> UUID: 1984ed82-28fe-4b43-a07c-157bdf07398a
> Ancestors: Morphic-mt.1851
> In text fields, fixes #cancelSafely (i.e. CMD+L) for models that directly derive their textual contents user input (i.e. #textEdited:) without an extra #accept step. Examples include all uses of PluggableTextSpec >> #editText: such as Inspector, ObjectExplorer, and SearchBar. And the Debugger, which uses Inspector.
> =============== Diff against Morphic-mt.1851 ===============
> Item was changed:
> ----- Method: PluggableTextMorph>>cancelSafely (in category 'menu commands') -----
> + "Cancel all edits by replacing the content with the original contents. Retain the undo history. If a model is listening to #textEdited and maybe also directly derives #getText from it, clear the edit buffer first, so that a cancel means deleting everything."
> - "Cancel all edits by replacing the content with the original contents. Retain the undo history."
> self handleEdit: [
> + self textEdited: ''.
> textMorph editor replaceAllWith: self getText.
> + self textEdited: textMorph contents.
> self selectInterval: self getSelection.
> self hasUnacceptedEdits: false].!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev