Skip to content

Commit

Permalink
Add items to recurse down in outline view datasource
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Dec 29, 2024
1 parent faa7726 commit 294c884
Showing 1 changed file with 41 additions and 10 deletions.
51 changes: 41 additions & 10 deletions GormCore/GormDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,9 @@ - (void) setSelectionFromEditor: (id<IBEditors>)anEditor
*/
- (void) touch
{
[self deactivateEditors];
[[[objectViewController outlineView] documentView] reloadData];
[self reactivateEditors];
[self updateChangeCount: NSChangeDone];
}

Expand Down Expand Up @@ -3939,7 +3942,8 @@ - (id) outlineView: (NSOutlineView *)ov
ofItem: (id)item
{
id result = nil;


[self deactivateEditors];
NSLog(@"index = %ld, item = %@", index, item);
if (item == nil)
{
Expand All @@ -3953,7 +3957,16 @@ - (id) outlineView: (NSOutlineView *)ov
{
result = [[item subviews] objectAtIndex: index];
}
else if ([item isKindOfClass: [NSMenu class]])
{
result = [item itemAtIndex: index];
}
else if ([item isKindOfClass: [NSMenuItem class]])
{
result = [item submenu];
}
NSLog(@"result = %@", result);
[self reactivateEditors];

return result;
}
Expand All @@ -3963,6 +3976,7 @@ - (BOOL) outlineView: (NSOutlineView *)ov
{
BOOL f = NO;

[self deactivateEditors];
if (item == nil)
{
f = [topLevelObjects count] > 0;
Expand All @@ -3974,7 +3988,16 @@ - (BOOL) outlineView: (NSOutlineView *)ov
else if ([item isKindOfClass: [NSView class]])
{
f = [[item subviews] count] > 0;
}
else if ([item isKindOfClass: [NSMenu class]])
{
f = [item numberOfItems] > 0;
}
else if ([item isKindOfClass: [NSMenuItem class]])
{
f = [item hasSubmenu];
}
[self reactivateEditors];

NSLog(@"f = %d",f);
return f;
Expand All @@ -3985,6 +4008,7 @@ - (NSInteger) outlineView: (NSOutlineView *)ov
{
NSInteger c = 0;

[self deactivateEditors];
if (item == nil)
{
c = [topLevelObjects count];
Expand All @@ -3997,6 +4021,15 @@ - (NSInteger) outlineView: (NSOutlineView *)ov
{
c = [[item subviews] count];
}
else if ([item isKindOfClass: [NSMenu class]])
{
c = [item numberOfItems];
}
else if ([item isKindOfClass: [NSMenuItem class]])
{
c = 1; // one submenu...
}
[self reactivateEditors];

NSLog(@"c = %ld", c);
return c;
Expand All @@ -4008,21 +4041,19 @@ - (id) outlineView: (NSOutlineView *)ov
{
id value = nil;

[self deactivateEditors];
if ([[tableColumn identifier] isEqualToString: @"objects"])
{
if (item == nil)
{
value = @"Objects";
}
else
{
value = [self nameForObject: item];
}
NSString *className = [classManager classNameForObject: item];
NSString *name = [self nameForObject: item];

value = [NSString stringWithFormat: @"%@ - %@", (name != nil)?name:@"", className];
}
else if ([[tableColumn identifier] isEqualToString: @"connections"])
{
}

[self reactivateEditors];

return value;
}

Expand Down

0 comments on commit 294c884

Please sign in to comment.