mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
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:
parent
49032a0328
commit
fc12745708
10 changed files with 128 additions and 1 deletions
11
ChangeLog
11
ChangeLog
|
@ -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
|
||||
|
|
11
English.lproj/GormHelpInspector.gorm/data.classes
Normal file
11
English.lproj/GormHelpInspector.gorm/data.classes
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
GormHelpInspector = {
|
||||
Actions = (
|
||||
);
|
||||
Outlets = (
|
||||
toolTip
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
}
|
BIN
English.lproj/GormHelpInspector.gorm/data.info
Normal file
BIN
English.lproj/GormHelpInspector.gorm/data.info
Normal file
Binary file not shown.
BIN
English.lproj/GormHelpInspector.gorm/objects.gorm
Normal file
BIN
English.lproj/GormHelpInspector.gorm/objects.gorm
Normal file
Binary file not shown.
|
@ -141,6 +141,7 @@ Gorm_LOCALIZED_RESOURCE_FILES = \
|
|||
GormDocument.gorm \
|
||||
GormDummyInspector.gorm \
|
||||
GormFontView.gorm \
|
||||
GormHelpInspector.gorm \
|
||||
Gorm.gorm \
|
||||
GormImageInspector.gorm \
|
||||
GormInspectorPanel.gorm \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
10
GormCore/GormHelpInspector.h
Normal file
10
GormCore/GormHelpInspector.h
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* All Rights reserved */
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <InterfaceBuilder/InterfaceBuilder.h>
|
||||
|
||||
@interface GormHelpInspector : IBInspector
|
||||
{
|
||||
id toolTip;
|
||||
}
|
||||
@end
|
83
GormCore/GormHelpInspector.m
Normal file
83
GormCore/GormHelpInspector.m
Normal 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
|
|
@ -83,6 +83,13 @@
|
|||
}
|
||||
@end
|
||||
|
||||
@implementation NSView (GormObjectAdditions)
|
||||
- (NSString*) helpInspectorClassName
|
||||
{
|
||||
return @"GormHelpInspector";
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GormObjectEditor
|
||||
|
||||
static NSMapTable *docMap = 0;
|
||||
|
|
Loading…
Reference in a new issue