FROM : Jonathan Grynspan
DATE : Sat Jul 22 16:32:08 2006
I implemented -undo: and -redo: in my view, and now it's all working
the way it ought to--except that the Undo and Redo menu items aren't
titled correctly. That's easy enough to fix, by sending -
undoMenuItemTitle and -redoMenuItemTitle to my undo manager. However,
the strings returned include ampersands (&), which I assume are for
the benefit of Windows (key alternate indicators.) I just strip these
out, but is there a different message I should be sending that won't
return strings with ampersands, or is it expected to be the caller's
responsibility to remove them?
Thanks,
Jonathan Grynspan
On 22-Jul-06, at 10:27 AM, Christiaan Hofman wrote:
>
> On 21 Jul 2006, at 9:30 PM, Jonathan Grynspan wrote:
>
>> I'm currently working on a small graphics application used for
>> editing the images in a game. I've implemented selection, line,
>> rect, etc. tools, but I've noticed that while the mouse button is
>> pressed, I can still activate Undo and Redo with Cmd+Z and Cmd
>> +Shift+Z. I took a look at -[NSUndoManager disableUndoRegistration/
>> enableUndoRegistration], but they only affect the creation of new
>> Undo events, rather than stopping me from firing old ones. -
>> validateMenuItem: is never sent to my view for the Undo or Redo
>> menu items, so I can't use that to disable them. Anybody have any
>> ideas?
>>
>> Thanks,
>> Jonathan Grynspan
>
> Your -validateMenuItem: is not called because the target of the
> undo actions is the window. You could either subclass the window
> and overwite its -validateMenuItem:, or you can catch the -undo:
> action in your window delegate and implement its -validateMenuItem:
> there.
>
> Christiaan
>
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
DATE : Sat Jul 22 16:32:08 2006
I implemented -undo: and -redo: in my view, and now it's all working
the way it ought to--except that the Undo and Redo menu items aren't
titled correctly. That's easy enough to fix, by sending -
undoMenuItemTitle and -redoMenuItemTitle to my undo manager. However,
the strings returned include ampersands (&), which I assume are for
the benefit of Windows (key alternate indicators.) I just strip these
out, but is there a different message I should be sending that won't
return strings with ampersands, or is it expected to be the caller's
responsibility to remove them?
Thanks,
Jonathan Grynspan
On 22-Jul-06, at 10:27 AM, Christiaan Hofman wrote:
>
> On 21 Jul 2006, at 9:30 PM, Jonathan Grynspan wrote:
>
>> I'm currently working on a small graphics application used for
>> editing the images in a game. I've implemented selection, line,
>> rect, etc. tools, but I've noticed that while the mouse button is
>> pressed, I can still activate Undo and Redo with Cmd+Z and Cmd
>> +Shift+Z. I took a look at -[NSUndoManager disableUndoRegistration/
>> enableUndoRegistration], but they only affect the creation of new
>> Undo events, rather than stopping me from firing old ones. -
>> validateMenuItem: is never sent to my view for the Undo or Redo
>> menu items, so I can't use that to disable them. Anybody have any
>> ideas?
>>
>> Thanks,
>> Jonathan Grynspan
>
> Your -validateMenuItem: is not called because the target of the
> undo actions is the window. You could either subclass the window
> and overwite its -validateMenuItem:, or you can catch the -undo:
> action in your window delegate and implement its -validateMenuItem:
> there.
>
> Christiaan
>
>
> _______________________________________________
> MacOSX-dev mailing list
> <email_removed>
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
| Related mails | Author | Date |
|---|---|---|
| Jonathan Grynspan | Jul 21, 20:30 | |
| Christiaan Hofman | Jul 22, 16:27 | |
| Jonathan Grynspan | Jul 22, 16:32 |






Cocoa mail archive

