mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 12:30:47 +00:00
NSAnimation, NSApplication and NSArrayController merges
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38705 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9bc4dda8ff
commit
0ccefadb47
3 changed files with 65 additions and 17 deletions
|
@ -48,6 +48,8 @@
|
|||
if (self == [NSArrayController class])
|
||||
{
|
||||
[self exposeBinding: NSContentArrayBinding];
|
||||
[self setKeys: [NSArray arrayWithObjects: NSContentBinding, NSContentObjectBinding, nil]
|
||||
triggerChangeNotificationsForDependentKey: @"arrangedObjects"];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,42 +84,76 @@
|
|||
|
||||
- (void) addObject: (id)obj
|
||||
{
|
||||
[self willChangeValueForKey: NSContentBinding];
|
||||
[_content addObject: obj];
|
||||
if ([self automaticallyRearrangesObjects])
|
||||
{
|
||||
[self rearrangeObjects];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Should check whether _arranged_objects is mutable
|
||||
ASSIGN(_arranged_objects, [_arranged_objects arrayByAddingObject: obj]);
|
||||
}
|
||||
if ([self selectsInsertedObjects])
|
||||
{
|
||||
[self addSelectedObjects: [NSArray arrayWithObject: obj]];
|
||||
}
|
||||
[self didChangeValueForKey: NSContentBinding];
|
||||
}
|
||||
|
||||
- (void) addObjects: (NSArray*)obj
|
||||
{
|
||||
[self willChangeValueForKey: NSContentBinding];
|
||||
[_content addObjectsFromArray: obj];
|
||||
if ([self automaticallyRearrangesObjects])
|
||||
{
|
||||
[self rearrangeObjects];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Should check whether _arranged_objects is mutable
|
||||
ASSIGN(_arranged_objects, [_arranged_objects arrayByAddingObjectsFromArray: obj]);
|
||||
}
|
||||
if ([self selectsInsertedObjects])
|
||||
{
|
||||
[self addSelectedObjects: obj];
|
||||
}
|
||||
[self didChangeValueForKey: NSContentBinding];
|
||||
}
|
||||
|
||||
- (void) removeObject: (id)obj
|
||||
{
|
||||
[self willChangeValueForKey: NSContentBinding];
|
||||
[_content removeObject: obj];
|
||||
[self removeSelectedObjects: [NSArray arrayWithObject: obj]];
|
||||
if ([self automaticallyRearrangesObjects])
|
||||
{
|
||||
[self rearrangeObjects];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME
|
||||
//[_arranged_objects removeObject: obj];
|
||||
}
|
||||
[self didChangeValueForKey: NSContentBinding];
|
||||
}
|
||||
|
||||
- (void) removeObjects: (NSArray*)obj
|
||||
{
|
||||
[self willChangeValueForKey: NSContentBinding];
|
||||
[_content removeObjectsInArray: obj];
|
||||
[self removeSelectedObjects: obj];
|
||||
if ([self automaticallyRearrangesObjects])
|
||||
{
|
||||
[self rearrangeObjects];
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME
|
||||
//[_arranged_objects removeObjectsInArray: obj];
|
||||
}
|
||||
[self didChangeValueForKey: NSContentBinding];
|
||||
}
|
||||
|
||||
- (BOOL) canInsert
|
||||
|
@ -135,7 +171,7 @@
|
|||
{
|
||||
id new = [self newObject];
|
||||
|
||||
[_content addObject: new];
|
||||
[self addObject: new];
|
||||
RELEASE(new);
|
||||
}
|
||||
|
||||
|
@ -440,6 +476,7 @@ atArrangedObjectIndexes: (NSIndexSet*)idx
|
|||
[coder encodeBool: [self selectsInsertedObjects] forKey: @"NSSelectsInsertedObjects"];
|
||||
[coder encodeBool: [self clearsFilterPredicateOnInsertion] forKey:
|
||||
@"NSClearsFilterPredicateOnInsertion"];
|
||||
[coder encodeBool: [self automaticallyRearrangesObjects] forKey: @"NSAutomaticallyRearrangesObjects"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -475,6 +512,11 @@ atArrangedObjectIndexes: (NSIndexSet*)idx
|
|||
[self setClearsFilterPredicateOnInsertion:
|
||||
[coder decodeBoolForKey: @"NSClearsFilterPredicateOnInsertion"]];
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSAutomaticallyRearrangesObjects"])
|
||||
{
|
||||
[self setAutomaticallyRearrangesObjects:
|
||||
[coder decodeBoolForKey: @"NSAutomaticallyRearrangesObjects"]];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue