Implemented simple help inspector to set tool tips on objects in Gorm.

* English.lproj/GormHelpInspector.gorm: Help inspector .gorm file.
	* GNUmakefile: Add .gorm file.
	* GormCore/GNUmakefile: Add new class.
	* GormCore/GormConnectionInspector.m: Call [super ok:] from ok: method.
	* GormCore/GormHelpInspector.[hm]: Implemented the beginnings of
	the help inspector.
	* GormCore/GormObjectEditor.m: Add helpInspectorClassName 
	implementation to NSView category.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23947 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-10-23 05:16:42 +00:00
parent 49032a0328
commit fc12745708
10 changed files with 128 additions and 1 deletions

View file

@ -1,3 +1,14 @@
2006-10-23 01:14-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* English.lproj/GormHelpInspector.gorm: Help inspector .gorm file.
* GNUmakefile: Add .gorm file.
* GormCore/GNUmakefile: Add new class.
* GormCore/GormConnectionInspector.m: Call [super ok:] from ok: method.
* GormCore/GormHelpInspector.[hm]: Implemented the beginnings of
the help inspector.
* GormCore/GormObjectEditor.m: Add helpInspectorClassName
implementation to NSView category.
2006-10-21 23:51-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/3Containers/GormNSTableViewInspector.gorm: Added

View file

@ -0,0 +1,11 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
GormHelpInspector = {
Actions = (
);
Outlets = (
toolTip
);
Super = IBInspector;
};
}

Binary file not shown.

Binary file not shown.

View file

@ -141,6 +141,7 @@ Gorm_LOCALIZED_RESOURCE_FILES = \
GormDocument.gorm \
GormDummyInspector.gorm \
GormFontView.gorm \
GormHelpInspector.gorm \
Gorm.gorm \
GormImageInspector.gorm \
GormInspectorPanel.gorm \

View file

@ -53,6 +53,7 @@ GormCore_HEADER_FILES = \
GormFontViewController.h \
GormFunctions.h \
GormGenericEditor.h \
GormHelpInspector.h \
GormImage.h \
GormImageEditor.h \
GormImageInspector.h \
@ -109,6 +110,7 @@ GormCore_OBJC_FILES = \
GormFontViewController.m \
GormFunctions.m \
GormGenericEditor.m \
GormHelpInspector.m \
GormGormWrapperBuilder.m \
GormGormWrapperLoader.m \
GormGModelWrapperLoader.m \

View file

@ -481,7 +481,9 @@ selectCellWithString: (NSString*)title
[oldBrowser loadColumnZero];
[oldBrowser setPath: path];
}
[[(id<IB>)NSApp activeDocument] touch]; /* mark as edited. */
// mark as edited.
[super ok: sender];
[self updateButtons];
}

View file

@ -0,0 +1,10 @@
/* All Rights reserved */
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/InterfaceBuilder.h>
@interface GormHelpInspector : IBInspector
{
id toolTip;
}
@end

View file

@ -0,0 +1,83 @@
/* All Rights reserved */
#include <AppKit/AppKit.h>
#include "GormHelpInspector.h"
#include <GNUstepGUI/GSNibCompatibility.h>
@implementation GormHelpInspector
- (id) init
{
if ([super init] == nil)
{
return nil;
}
if ([NSBundle loadNibNamed: @"GormHelpInspector" owner: self] == NO)
{
NSLog(@"Could not gorm GormHelpInspector");
return nil;
}
return self;
}
- (void) ok: (id)sender
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
NSArray *cons = [document connectorsForDestination: object
ofClass: [NSIBHelpConnector class]];
NSIBHelpConnector *con = nil;
if([cons count] > 0)
{
NSEnumerator *en = [cons objectEnumerator];
NSString *val = [sender stringValue];
if([val isEqualToString: @""] == NO)
{
while((con = [en nextObject]) != nil)
{
[con setMarker: [sender stringValue]];
}
}
else
{
while((con = [en nextObject]) != nil)
{
[document removeConnector: con];
}
}
}
else
{
con = [[NSIBHelpConnector alloc] init];
[con setFile: @"NSToolTipHelpKey"];
[con setMarker: [sender stringValue]];
[con setDestination: object];
[document addConnector: con];
}
[super ok: sender];
}
- (void) revert: (id)sender
{
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
NSArray *cons = [document connectorsForDestination: object
ofClass: [NSIBHelpConnector class]];
if([cons count] > 0)
{
NSIBHelpConnector *con = [cons objectAtIndex: 0];
NSString *val = [con marker];
[toolTip setStringValue: val];
}
[super revert: sender];
}
-(void) controlTextDidChange:(NSNotification *)aNotification
{
[self ok: [aNotification object]];
}
@end

View file

@ -83,6 +83,13 @@
}
@end
@implementation NSView (GormObjectAdditions)
- (NSString*) helpInspectorClassName
{
return @"GormHelpInspector";
}
@end
@implementation GormObjectEditor
static NSMapTable *docMap = 0;