From: <ho...@us...> - 2009-12-07 12:30:08
|
Revision: 16282 http://bibdesk.svn.sourceforge.net/bibdesk/?rev=16282&view=rev Author: hofman Date: 2009-12-07 12:29:58 +0000 (Mon, 07 Dec 2009) Log Message: ----------- update columns menu in main table cornerview separately from menu to avoid a loop Modified Paths: -------------- trunk/bibdesk/BDSKMainTableView.m Modified: trunk/bibdesk/BDSKMainTableView.m =================================================================== --- trunk/bibdesk/BDSKMainTableView.m 2009-12-07 12:06:38 UTC (rev 16281) +++ trunk/bibdesk/BDSKMainTableView.m 2009-12-07 12:29:58 UTC (rev 16282) @@ -90,6 +90,7 @@ - (void)columnsMenuAddTableColumn:(id)sender; - (void)addColumnSheetDidEnd:(BDSKAddFieldSheetController *)addFieldController returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo; - (void)updateColumnsMenu; +- (void)updateColumnsButton; - (IBAction)importItem:(id)sender; - (IBAction)openParentItem:(id)sender; - (void)autosizeColumn:(id)sender; @@ -435,6 +436,7 @@ [self setHighlightedTableColumn:highlightedColumn]; [self tableViewFontChanged]; [self updateColumnsMenu]; + [self updateColumnsButton]; } - (void)insertTableColumnWithIdentifier:(NSString *)identifier atIndex:(NSUInteger)idx { @@ -672,10 +674,12 @@ [item setTarget:self]; [item setState:NSOnState]; } - - if ([[self cornerView] isKindOfClass:[NSPopUpButton class]] && menu != nil) { - menu = [self columnsMenu]; // this is already a copy - item = [menu insertItemWithTitle:@"" action:NULL keyEquivalent:@"" atIndex:0]; +} + +- (void)updateColumnsButton { + if ([[self cornerView] isKindOfClass:[NSPopUpButton class]]) { + NSMenu *menu = [self columnsMenu]; // this is already a copy + NSMenuItem *item = [menu insertItemWithTitle:@"" action:NULL keyEquivalent:@"" atIndex:0]; [item setImage:[[self class] cornerColumnsImage]]; [(NSPopUpButton *)[self cornerView] setMenu:menu]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |