apps-gorm/GormCore/GormHelpInspector.m
Gregory John Casamento c1baf0ea52 * GormCore/GormCustomView.m
* GormCore/GormDocument.m
	* GormCore/GormFilePrefsManager.m
	* GormCore/GormHelpInspector.m
	* GormCore/GormPrivate.h
	* GormCore/GormPrivate.m
	* Palettes/1Windows/GormNSPanel.m
	* Palettes/1Windows/GormNSWindow.m
	* Palettes/1Windows/GormWindowSizeInspector.m
	* Palettes/1Windows/WindowsPalette.m
	* Plugins/Gorm/GormGormWrapperBuilder.m
	* Plugins/Nib/GormNibWrapperBuilder.m
	* Plugins/Nib/GormNibWrapperLoader.h: Use new header files for 
	nib/gorm loading.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@27190 72102866-910b-0410-8b05-ffd578937521
2008-12-02 07:54:31 +00:00

88 lines
1.8 KiB
Objective-C

/* All Rights reserved */
#include <AppKit/AppKit.h>
#include "GormHelpInspector.h"
#include <GNUstepGUI/GSNibLoading.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];
}
else
{
[toolTip setStringValue: @""];
}
[super revert: sender];
}
-(void) controlTextDidChange:(NSNotification *)aNotification
{
[self ok: [aNotification object]];
}
@end