Re: Undo in a Sheet -- no takers?
Re: Undo in a Sheet -- no takers?
- Subject: Re: Undo in a Sheet -- no takers?
- From: Mason Mark <email@hidden>
- Date: Sun, 07 Oct 2001 11:55:45 -0700
[Snipped original problem description: undo not available in sheets).
--On Sunday, October 7, 2001 10:38 AM -0400 Bill Cheeseman
<email@hidden> wrote:
But is this relevant? -- The release notes for something-or-other,
probably the AppKit, state that one of the "fixes" in Mac OS X 10.1 is
that Cocoa now more strictly enforces the rule that a sheet is
document-modal. It does this, at least in part, by disabling certain menu
items while a sheet is present in the frontmost document window.
Well, I don't know--I was already on 10.1 when I ran into this issue. If
true, it would be a misguided decision requiring a workaround.
I wonder if they thought undo and redo should not be available while a
sheet is present, since they have no way of knowing whether items in the
undo and redo stacks could be used to alter the document, in violation of
the document modality sheet rule. Something to think about, anyway.
Yes, this is something to think about as a developer (at the app level),
but I don't think it is even something to think about at the API level.
Certainly, undo should be available (as in, available for the application
developer to use if necessary); undo should be possible (and encouraged)
anywhere that the user ever enters text, for one thing.
Thinking along the same lines, if you do succeed in finding a way to
enable the undo menu item, how will you prevent the user from undoing and
redoing actions that should not be changeable while a document-modal
sheet is present? I suppose you might use a completely separate undo
manager that allows undo and redo only of items in the sheet, and only
while the sheet is up. Interesting problem.
In my case (and, I suspect, in most cases), I want to return a separate
undo manager. All I really want to do is allow the user to undo typing in a
text field. The undoable actions while the sheet is displayed should
pertain only to the sheet.
However, if an app allows the user to edit some property via a sheet, it
would make sense to commit the action to the model/document object when the
sheet returns (presumably as a result of the user pressing OK). Then the
document could register its own undo actions at that time, with the sheet
being already dismissed.
It is questions like this that have made me wonder whether it is ever
appropriate to have text fields and other user controls in a sheet if they
can change document settings. It's ok in a save panel, I suppose, because
the file name under which to save a document isn't in the nature of a
document setting that should be undoable.
I think that this is sometimes appropriate. But that's another issue; even
if nothing related to a document is occurring, there are still many cases
where undo might be required in a sheet.
My app is one such case. Another case where this functionality is clearly
desirable (but lacking) is in Project Builder, when you commit a file using
the SCM menu. You commit, make a few text edits to the log message,
accidentally delete a sentence or two more than you intended...and you have
to type it again, because Undo is not available.
That is one of those clear flaws in the UI, which is all con and no pro.
That's why I doubt this is some intentional thing Apple did; probably it is
a side-effect of something else, or a design oversight.
--
Mason Mark