mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Improvments to the palette code and a way to connect from table columns.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21110 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
33bee67221
commit
73bf25235a
4 changed files with 112 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2005-04-15 02:14 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormInspectorsManager.m: Patch from Matt Rice to
|
||||
allow connection from a table column.
|
||||
* GormCore/GormPalettesManager.m: Import action methods automatically
|
||||
from the class.
|
||||
* Palettes/3Containers/GormTableViewEditor.m: Patch from Matt Rice
|
||||
to allow connection from a table column.
|
||||
|
||||
2005-04-14 01:42 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Resources/ClassInformation.plist: Added NSPopUpButtonCell and
|
||||
|
|
|
@ -410,6 +410,9 @@
|
|||
|| [[(NSScrollView *)obj documentView] isKindOfClass: [NSTextView class]]))
|
||||
{
|
||||
obj = [(NSScrollView *)obj documentView];
|
||||
if ([obj isKindOfClass: [NSTableView class]])
|
||||
if ([obj selectedColumn] != -1)
|
||||
obj = [[obj tableColumns] objectAtIndex:[obj selectedColumn]];
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -25,12 +25,79 @@
|
|||
|
||||
#include "GormPrivate.h"
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSSet.h>
|
||||
#include <AppKit/NSImage.h>
|
||||
#include <AppKit/NSSound.h>
|
||||
#include <GNUstepBase/GSObjCRuntime.h>
|
||||
|
||||
#define BUILTIN_PALETTES @"BuiltinPalettes"
|
||||
#define USER_PALETTES @"UserPalettes"
|
||||
|
||||
/**
|
||||
* This method returns an array listing the names of all the
|
||||
* instance methods available to obj, whether they
|
||||
* belong to the class of obj or one of its superclasses.<br />
|
||||
* If obj is a class, this returns the class methods.<br />
|
||||
* Returns nil if obj is nil.
|
||||
*/
|
||||
NSArray *
|
||||
GSObjCMethodNamesForClass(Class class, BOOL collect)
|
||||
{
|
||||
NSMutableSet *set;
|
||||
NSArray *array;
|
||||
GSMethodList methods;
|
||||
|
||||
if (class == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
/*
|
||||
* Add names to a set so methods declared in superclasses
|
||||
* and then overridden do not appear more than once.
|
||||
*/
|
||||
set = [[NSMutableSet alloc] initWithCapacity: 32];
|
||||
while (class != nil)
|
||||
{
|
||||
void *iterator = 0;
|
||||
|
||||
while ((methods = class_nextMethodList(class, &iterator)))
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < methods->method_count; i++)
|
||||
{
|
||||
GSMethod method = &methods->method_list[i];
|
||||
|
||||
if (method->method_name != 0)
|
||||
{
|
||||
NSString *name;
|
||||
const char *cName;
|
||||
|
||||
cName = GSNameFromSelector(method->method_name);
|
||||
name = [[NSString alloc] initWithUTF8String: cName];
|
||||
[set addObject: name];
|
||||
RELEASE(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we should collect all of the superclass methods, then iterate
|
||||
// up the chain.
|
||||
if(collect)
|
||||
{
|
||||
class = class->super_class;
|
||||
}
|
||||
else
|
||||
{
|
||||
class = nil;
|
||||
}
|
||||
}
|
||||
|
||||
array = [set allObjects];
|
||||
RELEASE(set);
|
||||
return array;
|
||||
}
|
||||
|
||||
@interface GormPalettePanel : NSPanel
|
||||
@end
|
||||
|
||||
|
@ -616,8 +683,34 @@ static NSImage *dragImage = nil;
|
|||
|
||||
- (NSMutableArray *) actionsForClass: (Class) cls
|
||||
{
|
||||
Class superclass = [cls superclass];
|
||||
return nil;
|
||||
NSArray *methodArray = GSObjCMethodNamesForClass(cls, NO);
|
||||
NSEnumerator *en = [methodArray objectEnumerator];
|
||||
NSMethodSignature *actionSig = [NSMethodSignature signatureWithObjCTypes: "v12@0:4@8"];
|
||||
NSMutableArray *actionsArray = [NSMutableArray array];
|
||||
NSString *methodName = nil;
|
||||
|
||||
NSDebugLog(@"######## class = %@, %@", NSStringFromClass(cls), methodArray);
|
||||
|
||||
while((methodName = [en nextObject]) != nil)
|
||||
{
|
||||
SEL sel = NSSelectorFromString(methodName);
|
||||
NSMethodSignature *signature = [cls instanceMethodSignatureForSelector: sel];
|
||||
if([signature numberOfArguments] == 3)
|
||||
{
|
||||
NSDebugLog(@"methodName = %@",methodName);
|
||||
NSDebugLog(@"returnType = %s, %s",[signature methodReturnType], @encode(id));
|
||||
NSDebugLog(@"firstArgument = %s",[signature getArgumentTypeAtIndex: 2]);
|
||||
|
||||
if([actionSig isEqual: signature])
|
||||
{
|
||||
NSDebugLog(@"Matches");
|
||||
[actionsArray addObject: methodName];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NSDebugLog(@"#######");
|
||||
return actionsArray;
|
||||
}
|
||||
|
||||
- (NSMutableArray *) outletsForClass: (Class) cls
|
||||
|
|
|
@ -265,7 +265,11 @@ static NSText *_textObject;
|
|||
}
|
||||
else if (hitView == tableView)
|
||||
{
|
||||
if ([tableView selectedColumn] != -1)
|
||||
if ([theEvent modifierFlags] & NSControlKeyMask)
|
||||
{
|
||||
[super mouseDown: theEvent];
|
||||
}
|
||||
else if ([tableView selectedColumn] != -1)
|
||||
{
|
||||
[tableView deselectColumn: [tableView selectedColumn]];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue