Skip to content

Commit

Permalink
Add columns to the outline view for objects
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Dec 29, 2024
1 parent db124f0 commit ffa7cf7
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions GormCore/GormDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,16 @@ - (void) awakeFromNib
object: window];

// objects...
NSTableColumn *tb = [[NSTableColumn alloc] initWithIdentifier: @"object"];
NSScrollView *outlineScrollView = [[NSScrollView alloc] initWithFrame: scrollRect];

[tb setTitle: @"Object"];
[outlineView addTableColumn: tb];
NSTableColumn *tbo = [[NSTableColumn alloc] initWithIdentifier: @"objects"];
NSTableColumn *tbc = [[NSTableColumn alloc] initWithIdentifier: @"connections"];

[tbo setTitle: @"Objects"];
[tbc setTitle: @"Connections"];
[outlineView setDrawsGrid: NO];
[outlineView setOutlineTableColumn: tbo];
[outlineView addTableColumn: tbo];
[outlineView addTableColumn: tbc];
[outlineScrollView setHasVerticalScroller: YES];
[outlineScrollView setHasHorizontalScroller: YES];
[outlineScrollView setAutoresizingMask:
Expand Down Expand Up @@ -3811,24 +3816,6 @@ - (NSArray *) validate
}
}

/*
NSLog(@"Checking connections..."); // %@", connections);
en = [connections objectEnumerator];
o = nil;
while ((o = [en nextObject]) != nil)
{
id src = [o source];
id dst = [o destination];
NSString *label = [o label];
if ([o isKindOfClass: [NSNibControlConnector class]])
{
}
else if ([o isKindOfClass: [NSNibOutletConnector class]])
{
}
}
*/
return results;
}

Expand Down Expand Up @@ -4016,12 +4003,24 @@ - (id) outlineView: (NSOutlineView *)ov
objectValueForTableColumn: (NSTableColumn *)tableColumn
byItem: (id)item
{
if (item == nil)
id value = nil;

if ([[tableColumn identifier] isEqualToString: @"objects"])
{
if (item == nil)
{
value = @"Objects";
}
else
{
value = [self nameForObject: item];
}
}
else if ([[tableColumn identifier] isEqualToString: @"connections"])
{
return @"Objects";
}

return [self nameForObject: item];
return value;
}

// Other methods...
Expand Down

0 comments on commit ffa7cf7

Please sign in to comment.