Revision: 7646 http://skim-app.svn.sourceforge.net/skim-app/?rev=7646&view=rev Author: hofman Date: 2012-02-14 23:50:47 +0000 (Tue, 14 Feb 2012) Log Message: ----------- display anchored note rich text in full row of outlineview
Modified Paths: -------------- trunk/SKMainWindowController_UI.m trunk/SKNotesDocument.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2012-02-14 10:54:14 UTC (rev 7645) +++ trunk/SKMainWindowController_UI.m 2012-02-14 23:50:47 UTC (rev 7646) @@ -614,7 +614,9 @@ } } else if ([ov isEqual:rightSideController.noteOutlineView]) { NSString *tcID = [tableColumn identifier]; - if ([tcID isEqualToString:NOTE_COLUMNID]) + if (tableColumn == nil) + return [item text]; + else if ([tcID isEqualToString:NOTE_COLUMNID]) return [item type] ? (id)[item string] : (id)[item text]; else if([tcID isEqualToString:TYPE_COLUMNID]) return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:item == [pdfView activeAnnotation]], SKAnnotationTypeImageCellActiveKey, [item type], SKAnnotationTypeImageCellTypeKey, nil]; @@ -671,21 +673,24 @@ #pragma mark NSOutlineView delegate protocol +- (NSCell *)outlineView:(NSOutlineView *)ov dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item { + if ([ov isEqual:rightSideController.noteOutlineView] && tableColumn == nil && [item type] == nil) { + return [[ov tableColumnWithIdentifier:NOTE_COLUMNID] dataCellForRow:[ov rowForItem:item]]; + } + return [tableColumn dataCellForRow:[ov rowForItem:item]]; +} + - (BOOL)outlineView:(NSOutlineView *)ov shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item{ if ([ov isEqual:rightSideController.noteOutlineView]) { - if ([[tableColumn identifier] isEqualToString:NOTE_COLUMNID]) { - if ([item type] == nil) { - if ([pdfView hideNotes] == NO) { - PDFAnnotation *annotation = [(SKNoteText *)item note]; - [pdfView scrollAnnotationToVisible:annotation]; - [pdfView setActiveAnnotation:annotation]; - [self showNote:annotation]; - } - return NO; - } else { - return YES; + if (tableColumn == nil) { + if ([pdfView hideNotes] == NO) { + PDFAnnotation *annotation = [(SKNoteText *)item note]; + [pdfView scrollAnnotationToVisible:annotation]; + [pdfView setActiveAnnotation:annotation]; + [self showNote:annotation]; } - } else if ([[tableColumn identifier] isEqualToString:AUTHOR_COLUMNID]) { + return NO; + } else if ([[tableColumn identifier] isEqualToString:NOTE_COLUMNID] || [[tableColumn identifier] isEqualToString:AUTHOR_COLUMNID]) { return YES; } } @@ -743,7 +748,8 @@ } - (NSString *)outlineView:(NSOutlineView *)ov toolTipForCell:(NSCell *)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)tableColumn item:(id)item mouseLocation:(NSPoint)mouseLocation { - if ([ov isEqual:rightSideController.noteOutlineView] && [[tableColumn identifier] isEqualToString:NOTE_COLUMNID]) { + if ([ov isEqual:rightSideController.noteOutlineView] && + (tableColumn == nil || [[tableColumn identifier] isEqualToString:NOTE_COLUMNID])) { return [item string]; } return nil; Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2012-02-14 10:54:14 UTC (rev 7645) +++ trunk/SKNotesDocument.m 2012-02-14 23:50:47 UTC (rev 7646) @@ -624,7 +624,9 @@ - (id)outlineView:(NSOutlineView *)ov objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { NSString *tcID = [tableColumn identifier]; - if ([tcID isEqualToString:NOTE_COLUMNID]) { + if (tableColumn == nil) { + return [item text]; + } else if ([tcID isEqualToString:NOTE_COLUMNID]) { return [item type] ? (id)[item string] : (id)[item text]; } else if([tcID isEqualToString:TYPE_COLUMNID]) { return [NSDictionary dictionaryWithObjectsAndKeys:[item type], SKAnnotationTypeImageCellTypeKey, nil]; @@ -636,6 +638,14 @@ return nil; } +- (NSCell *)outlineView:(NSOutlineView *)ov dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item { + if (tableColumn == nil && [item type] == nil) { + return [[ov tableColumnWithIdentifier:NOTE_COLUMNID] dataCellForRow:[ov rowForItem:item]]; + } + return [tableColumn dataCellForRow:[ov rowForItem:item]]; +} + + - (void)outlineView:(NSOutlineView *)ov didClickTableColumn:(NSTableColumn *)tableColumn { NSTableColumn *oldTableColumn = [ov highlightedTableColumn]; NSArray *sortDescriptors = nil; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit