On 14 Nov 2007, at 1:54 AM, Adam R. Maxwell wrote:
>
> On Tuesday, November 13, 2007, at 04:09PM,
> <[EMAIL PROTECTED]> wrote:
>
>> -- (void)fileView:(FileView *)aFileView willDisplayContextMenu:
>> (NSMenu *)menu forIconAtIndex:(NSUInteger)anIndex {
>> +// shouldn't this method return a menu rather than modifying one?
>> +- (NSMenu *)fileView:(FileView *)aFileView contextMenu:(NSMenu *)
>> menu forIconAtIndex:(NSUInteger)anIndex {
>
> I debated this with myself, but ended up thinking of it more as -
> menuNeedsUpdate: than -menuForEvent: (I couldn't recall the method
> signature so the name didn't reflect that). Either way works, but
> I think returning and passing as a parameter is redundant; if
> returning a menu and adding its contents to the original is easier,
> that's fine with me.
>
Most views have a delegate methods that returns a menu. Also the
delegate now has more choices, it can modify the menu or replace it.
In this particular case it doesn't matter anymore as we also copy the
menu.
> Not sure what menu stuff you wanted to include in FileView? The
> Open With... menu would be nice to have in FileView directly, but I
> didn't want to include stuff that's already in BD.
I was thinking of the Open With menu, yea. But it needs more stuff
than I thought, that's a pity.
Is it actually necessary to keep it in a separate framework?
> The safari/preview/skim menu stuff is too specialized. OTOH,
> putting that into a BibEditor-specific FileView subclass would be
> fine. BibEditor has a huge amount of URL-related code.
>
Much of it could be removed. I think only the methods I now included
in the context menu are to be kept.
> I can sort of see what this does, but a comment would be
> helpful...it's removing items that don't validate?
>
> while (i--) {
> if ([[menu itemAtIndex:i] isSeparatorItem]) {
> if (wasSeparator)
> [menu removeItemAtIndex:i];
> } else if ([self validateMenuItem:[menu itemAtIndex:i]]) {
> wasSeparator = NO;
> } else {
> [menu removeItemAtIndex:i];
> }
> }
Yes it's a bit complicated. It's the same loop we use in other
contextual menu item stuff though.
Christiaan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop