mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-05-31 09:21:02 +00:00
* EOInterface/EOGenericControlAssociation.m (-endEditing):
Fix copy/paste error. * GDL2Palette/Palette.[hm]: Load bundles from GDL2PaletteBundles key. * GDL2Palette/ConnectInspector.m: Replace static map table with walking the list of connectors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23579 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1e04e271bc
commit
1cec573e61
5 changed files with 35 additions and 12 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2006-09-20 Matt Rice <ratmice@yahoo.com>
|
||||||
|
|
||||||
|
* EOInterface/EOGenericControlAssociation.m (-endEditing):
|
||||||
|
Fix copy/paste error.
|
||||||
|
* GDL2Palette/Palette.[hm]: Load bundles from GDL2PaletteBundles key.
|
||||||
|
* GDL2Palette/ConnectInspector.m: Replace static map table with
|
||||||
|
walking the list of connectors.
|
||||||
|
|
||||||
2006-09-19 Matt Rice <ratmice@yahoo.com>
|
2006-09-19 Matt Rice <ratmice@yahoo.com>
|
||||||
|
|
||||||
* GDL2Palette/KeyWrapper.h: Add LocalType.
|
* GDL2Palette/KeyWrapper.h: Add LocalType.
|
||||||
|
|
|
@ -189,7 +189,7 @@ textShouldBeginEditing: (NSText *)fieldEditor
|
||||||
EODisplayGroup *dg2 = [self displayGroupForAspect:@"enabled"];
|
EODisplayGroup *dg2 = [self displayGroupForAspect:@"enabled"];
|
||||||
if (dg2 != dg || flag == NO)
|
if (dg2 != dg || flag == NO)
|
||||||
{
|
{
|
||||||
flag = [dg endEditing];
|
flag = [dg2 endEditing];
|
||||||
if (flag == YES)
|
if (flag == YES)
|
||||||
{
|
{
|
||||||
[dg2 associationDidBeginEditing:self];
|
[dg2 associationDidBeginEditing:self];
|
||||||
|
|
|
@ -35,18 +35,12 @@
|
||||||
/* TODO get notifications for IB{Will,Did}RemoveConnectorNotification
|
/* TODO get notifications for IB{Will,Did}RemoveConnectorNotification
|
||||||
* and remove the object from the _objectToAssociation map table if
|
* and remove the object from the _objectToAssociation map table if
|
||||||
* there are no more connectors for it */
|
* there are no more connectors for it */
|
||||||
static NSMapTable *_objectToAssociation;
|
|
||||||
@interface NSApplication(missingStuff)
|
@interface NSApplication(missingStuff)
|
||||||
- (GormClassManager *)classManager;
|
- (GormClassManager *)classManager;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GDL2ConnectionInspector
|
@implementation GDL2ConnectionInspector
|
||||||
+ (void) initialize
|
|
||||||
{
|
|
||||||
_objectToAssociation = NSCreateMapTableWithZone(NSObjectMapKeyCallBacks,
|
|
||||||
NSObjectMapValueCallBacks,
|
|
||||||
0, [self zone]);
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSButton *)okButton
|
- (NSButton *)okButton
|
||||||
{
|
{
|
||||||
|
@ -413,10 +407,23 @@ static NSMapTable *_objectToAssociation;
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
ASSIGN(_association,NSMapGet(_objectToAssociation, object));
|
NSArray *aConns = [[(id<IB>)NSApp activeDocument] connectorsForSource:object ofClass:[EOAspectConnector class]];
|
||||||
|
Class assocClass = [[popUp selectedItem] representedObject];
|
||||||
|
|
||||||
|
_association = nil;
|
||||||
|
|
||||||
|
for (i = 0; i < c; i++)
|
||||||
|
{
|
||||||
|
EOAspectConnector *aConn = [aConns objectAtIndex:i];
|
||||||
|
EOAssociation *assoc = [aConn association];
|
||||||
|
if ([[assoc class] isEqual: assocClass])
|
||||||
|
{
|
||||||
|
ASSIGN(_association, assoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!_association)
|
if (!_association)
|
||||||
{
|
{
|
||||||
Class assocClass = [[popUp selectedItem] representedObject];
|
|
||||||
_association = [[assocClass alloc] initWithObject:object];
|
_association = [[assocClass alloc] initWithObject:object];
|
||||||
/* this shouldn't happen until ok:. */
|
/* this shouldn't happen until ok:. */
|
||||||
}
|
}
|
||||||
|
@ -770,7 +777,6 @@ willDisplayCell:(id)cell atRow:(int)row column:(int)column
|
||||||
else if ([_currentConnector isKindOfClass:[EOAspectConnector class]])
|
else if ([_currentConnector isKindOfClass:[EOAspectConnector class]])
|
||||||
{
|
{
|
||||||
[_connectors addObject:_currentConnector];
|
[_connectors addObject:_currentConnector];
|
||||||
NSMapInsert(_objectToAssociation, object, _association);
|
|
||||||
[[(id<IB>)NSApp activeDocument]
|
[[(id<IB>)NSApp activeDocument]
|
||||||
attachObject:_association toParent:object];
|
attachObject:_association toParent:object];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include <InterfaceBuilder/IBPalette.h>
|
#include <InterfaceBuilder/IBPalette.h>
|
||||||
|
static NSConstantString *GDL2PaletteBundles;
|
||||||
|
|
||||||
@interface GDL2Palette : IBPalette
|
@interface GDL2Palette : IBPalette
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
#include "Palette.h"
|
#include "Palette.h"
|
||||||
#include "ResourceManager.h"
|
#include "ResourceManager.h"
|
||||||
|
#include <Foundation/NSUserDefaults.h>
|
||||||
|
#include <Foundation/NSBundle.h>
|
||||||
|
|
||||||
|
static NSConstantString *GDL2PaletteBundles = @"GDL2PaletteBundles";
|
||||||
@implementation GDL2Palette
|
@implementation GDL2Palette
|
||||||
|
|
||||||
+(void) initialize
|
+(void) initialize
|
||||||
{
|
{
|
||||||
// NSLog(@"GDL2Palette initialize");
|
// NSLog(@"GDL2Palette initialize");
|
||||||
|
NSArray *bundles;
|
||||||
|
int i, c;
|
||||||
|
|
||||||
[IBResourceManager registerResourceManagerClass:[GDL2ResourceManager class]];
|
[IBResourceManager registerResourceManagerClass:[GDL2ResourceManager class]];
|
||||||
|
bundles = [[NSUserDefaults standardUserDefaults] arrayForKey:GDL2PaletteBundles];
|
||||||
|
for (i = 0, c = [bundles count]; i < c; i++)
|
||||||
|
[[NSBundle bundleWithPath:[bundles objectAtIndex:i]] load];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue