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 04:57:13 -0700
Mark asked this question below a month ago...but I don't find any replies
or similar posts on any of the OS X dev lists.
I also now have a couple sheets that need to support undo (they have a text
editing fields in the sheet). My window controller returns an undo manager
for the sheet panel, but Undo is never available.
In the debugger, I have confirmed:
a) my window controller is returning a usable undo manager
b) the undo manager is getting actions registered with it--that is, the
undo stack contains "Undo Typing" actions when you examine it in gdb
However, the Undo menu item remains titled "Undo" and disabled.
Also, there is a growing collection of apps I use that disappoint me as a
user because they require me to perform editing in sheets, but then I blow
away some text, change my mind, and find out Undo is not supported in the
sheet.
So it looks like an solution is needed by quite a few people other than
Mark and me. Does anybody know the score on this one?
Thanks for any tips,
--
Mason
--On Tuesday, September 4, 2001 1:55 AM -0700 Mark Slater
<email@hidden> wrote:
I'm having a trouble enabling undo/redo for a sheet. In my app, when you
create a new document, it immediately drops down a configuration sheet
with five or six settings. The undo events are being registered as I
change values (I can see the menu name changing), but the Undo and Redo
menu items are never enabled. I've tried using validateMenuItem: in the
application delegate, the window controller for the overall document,
and the delegate for the sheet panel, but none of them get called. I've
checked the target of the undo: action, and it's the sheet panel when
the sheet is first dropped down, and when it ends. I've also tried
setting the initial first responder to the same object as the panel
delegate, with no luck.
Maybe I'm doing something wrong, but I haven't been able to find
anything that says Undo/Redo are always disabled when a sheet is active.
Do I need to make a sub-class of NSPanel to explicitly enable this? The
NSMenuValidation protocol says the target (which is the panel) is the
first object to get to validate the menu item and that it stops there
even if it doesn't validate it. Subclassing NSPanel to add the
validateMenuItem: wouldn't be a big deal... I think... but I want to
make sure nobody knows an easier way.
Thanks for any suggestions!
Mark
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev