* EOInterface/EODisplayGroup.m:

(-selectObjectsIdenticalTo:selectFirstOnNoMatch:): Disable some
questionable code.
(-setSelectedObjects:): Use a copy, not a mutable copy.
* DBModeler/DiagramView.m (-orderViewFront:): Move the view to
the end, not the beginning.
(sortSubviews()): Flip the ascending/descending order.
(showEntity:): floor randomly generated points.
* DBModeler/MainModelEditor.m: Rename -viewSelectedObject method
to _activateSelection. Remove calls to super viewSelectedObject.
* DBModeler/ModelerAttributeEditor.m
(-displayGroupDidChangeSelection): View the selected object when
the current selection is the attribute editors entity.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@27994 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2009-02-27 05:29:06 +00:00
parent f259e3a5ee
commit 66c54bc152
5 changed files with 39 additions and 18 deletions

View file

@ -1,3 +1,20 @@
2009-02-26 Matt Rice <ratmice@gmail.com>
* EOInterface/EODisplayGroup.m:
(-selectObjectsIdenticalTo:selectFirstOnNoMatch:): Disable some
questionable code.
(-setSelectedObjects:): Use a copy, not a mutable copy.
* DBModeler/DiagramView.m (-orderViewFront:): Move the view to
the end, not the beginning.
(sortSubviews()): Flip the ascending/descending order.
(showEntity:): floor randomly generated points.
* DBModeler/MainModelEditor.m: Rename -viewSelectedObject method
to _activateSelection. Remove calls to super viewSelectedObject.
* DBModeler/ModelerAttributeEditor.m
(-displayGroupDidChangeSelection): View the selected object when
the current selection is the attribute editors entity.
2009-02-25 David Ayers <ayers@fsfe.org>
* EOControl/EOEditingContext.m (_undoManagerCheckpoint:):

View file

@ -137,8 +137,8 @@
evFrame = [ev frame];
/* this "layout mechanism" is pure evil... */
toPoint.x = vis.origin.x + ((vis.size.width - evFrame.size.width) * rand()/(RAND_MAX + vis.origin.x));
toPoint.y = vis.origin.y + ((vis.size.height - evFrame.size.height) * rand()/(RAND_MAX + vis.origin.y));
toPoint.x = floor(vis.origin.x + ((vis.size.width - evFrame.size.width) * rand()/(RAND_MAX + vis.origin.x)));
toPoint.y = floor(vis.origin.y + ((vis.size.height - evFrame.size.height) * rand()/(RAND_MAX + vis.origin.y)));
[ev setFrameOrigin:toPoint];
[_shownEntities setObject:ev forKey:[entity name]];
@ -180,7 +180,7 @@ int sortSubviews(id view1, id view2, void *context)
idx1 = [self->_subview_order indexOfObject:view1];
idx2 = [self->_subview_order indexOfObject:view2];
return (idx1 < idx2) ? NSOrderedDescending : NSOrderedAscending;
return (idx1 < idx2) ? NSOrderedAscending : NSOrderedDescending;
}
- (void) orderViewFront:(NSView *)v
@ -188,7 +188,7 @@ int sortSubviews(id view1, id view2, void *context)
int idx = [_subview_order indexOfObject:v];
RETAIN(v);
[_subview_order removeObjectAtIndex:idx];
[_subview_order insertObject:v atIndex:0];
[_subview_order addObject:v];
RELEASE(v);
[self sortSubviewsUsingFunction:(int (*)(id, id, void *))sortSubviews context:self];
[self setNeedsDisplay:YES];

View file

@ -212,7 +212,7 @@
[super activate];
}
- (void) viewSelectedObject
- (void) _activateSelection
{
id selection;
if ([[self selectionWithinViewedObject] count] == 0)
@ -244,7 +244,6 @@
if ([friendEditor canSupportCurrentSelection])
{
[self activateEmbeddedEditor:friendEditor];
[super viewSelectedObject];
return;
}
}
@ -259,7 +258,6 @@
{
[self activateEmbeddedEditor:friend];
RELEASE(friend);
[super viewSelectedObject];
return;
}
RELEASE(friend);
@ -275,13 +273,11 @@
if ([anEditor canSupportCurrentSelection])
{
[self activateEmbeddedEditor:anEditor];
[super viewSelectedObject];
return;
}
}
}
[super viewSelectedObject];
}
/* NSOutlineView datasource stuff */
@ -428,7 +424,7 @@
}
#endif
[self setSelectionPath:AUTORELEASE(foo)];
[self viewSelectedObject];
[self _activateSelection];
}
- (BOOL) outlineView:(NSOutlineView *)view

View file

@ -291,12 +291,18 @@
- (void) displayGroupDidChangeSelection:(EODisplayGroup *)displayGroup
{
NSArray *selObj = [displayGroup selectedObjects];
NSArray *selWithin = [self selectionWithinViewedObject];
NSArray *selWithin = RETAIN([self selectionWithinViewedObject]);
if ([selObj count]
&& (![selObj isEqual:selWithin])
&& ![selWithin containsObject:_entityToObserve])
[self setSelectionWithinViewedObject: selObj];
if ([selObj count] && (![selObj isEqual:selWithin]))
{
if ([selWithin containsObject:_entityToObserve])
{
NSAssert([selWithin count] == 1, @"how on earth?");
[[self parentEditor] viewSelectedObject];
}
[self setSelectionWithinViewedObject: selObj];
}
RELEASE(selWithin);
}
@end

View file

@ -807,10 +807,13 @@ static BOOL _globalDefaultForValidatesChangesImmediately = NO;
id object = [_displayedObjects objectAtIndex: 0];
selected = [self selectObject: object];
}
else if (c)
#if 0
// this really doesn't seem like it belongs here.
else if (c)
{
[self setSelectionIndexes:_selection];
}
#endif
else
{
[self clearSelection];
@ -861,8 +864,7 @@ static BOOL _globalDefaultForValidatesChangesImmediately = NO;
- (void)setSelectedObjects: (NSArray *)objects
{
ASSIGN (_selectedObjects,
AUTORELEASE([objects mutableCopyWithZone: [self zone]]));
ASSIGNCOPY(_selectedObjects, objects);
}
- (id)selectedObject