mirror of
https://github.com/nickshanks/ResKnife.git
synced 2025-01-21 15:33:02 +00:00
Added more buttons to the toolbar.
This commit is contained in:
parent
734fad59e5
commit
a935b7c0d4
@ -7,9 +7,6 @@
|
||||
- (IBAction)showAbout:(id)sender;
|
||||
- (IBAction)showInfo:(id)sender;
|
||||
- (IBAction)showPrefs:(id)sender;
|
||||
- (IBAction)showCreateResourceSheet:(id)sender;
|
||||
- (IBAction)openResource:(id)sender;
|
||||
- (IBAction)playSound:(id)sender;
|
||||
- (void)initUserDefaults;
|
||||
|
||||
@end
|
||||
|
@ -40,32 +40,14 @@
|
||||
{
|
||||
[[PrefsWindowController sharedPrefsWindowController] showWindow:sender];
|
||||
}
|
||||
|
||||
/*
|
||||
- (IBAction)showCreateResourceSheet:(id)sender
|
||||
{
|
||||
// requires ALL main windows' controllers (even plugs) to have their document set correctly
|
||||
NSDocument *document = [[[NSApp mainWindow] windowController] document];
|
||||
return [[[(ResourceDocument *)document dataSource] createResourceSheetController] showCreateResourceSheet:document];
|
||||
}
|
||||
|
||||
- (IBAction)openResource:(id)sender
|
||||
{
|
||||
// bug: only opens the hex editor!
|
||||
// NSBundle *hexEditor = [NSBundle bundleWithIdentifier:@"com.nickshanks.resknife.hexadecimal"];
|
||||
// NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
|
||||
NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Hexadecimal Editor.bundle"]];
|
||||
// [hexEditor load];
|
||||
|
||||
// bug: possible lack of necessary retains here, esp. resource - should the plug retain it?
|
||||
ResourceDocument *resDocument = (ResourceDocument *) [[[NSApp mainWindow] windowController] document];
|
||||
Resource *resource = [[resDocument outlineView] itemAtRow:[[resDocument outlineView] selectedRow]];
|
||||
// bug: I alloc a plug instance here, but have no idea where it gets dealloc'd
|
||||
id hexWindow = [[[hexEditor principalClass] alloc] initWithResource:resource];
|
||||
}
|
||||
|
||||
- (IBAction)playSound:(id)sender
|
||||
{
|
||||
return [[[(ResourceDocument *)document showCreateResourceSheet:sender];
|
||||
}
|
||||
*/
|
||||
|
||||
- (void)initUserDefaults
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
#import "OutlineViewDelegate.h"
|
||||
#import "ResourceNameCell.h"
|
||||
|
||||
@implementation OutlineViewDelegate
|
||||
|
||||
@ -7,9 +8,17 @@
|
||||
NSTableColumn *nameColumn = [outlineView tableColumnWithIdentifier:@"name"];
|
||||
NSTableColumn *sizeColumn = [outlineView tableColumnWithIdentifier:@"size"];
|
||||
NSTableColumn *attributesColumn = [outlineView tableColumnWithIdentifier:@"attributes"];
|
||||
|
||||
// set text formatters
|
||||
if( [tableColumn isEqual:nameColumn] ) [cell setFormatter:nameFormatter];
|
||||
else if( [tableColumn isEqual:sizeColumn] ) [cell setFormatter:sizeFormatter];
|
||||
else if( [tableColumn isEqual:attributesColumn] ) [cell setFormatter:attributesFormatter];
|
||||
|
||||
// set resource icon
|
||||
if( [tableColumn isEqual:nameColumn] )
|
||||
{
|
||||
[(ResourceNameCell *)cell setImage:[NSImage imageNamed:@"Resource file"]];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
|
||||
|
@ -14,6 +14,11 @@
|
||||
|
||||
- (void)setupToolbar:(NSWindowController *)controller;
|
||||
|
||||
- (IBAction)showCreateResourceSheet:(id)sender;
|
||||
- (IBAction)openResource:(id)sender;
|
||||
- (IBAction)openResourceAsHex:(id)sender;
|
||||
- (IBAction)playSound:(id)sender;
|
||||
|
||||
- (BOOL)readResourceMap:(SInt16)fileRefNum;
|
||||
- (BOOL)writeResourceMap:(SInt16)fileRefNum;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#import "ResourceDocument.h"
|
||||
#import "Resource.h"
|
||||
#import "ResourceNameCell.h"
|
||||
#import "CreateResourceSheetController.h"
|
||||
|
||||
@implementation ResourceDocument
|
||||
|
||||
@ -20,6 +22,7 @@
|
||||
}
|
||||
|
||||
/* WINDOW DELEGATION */
|
||||
#pragma mark -
|
||||
|
||||
- (NSString *)windowNibName
|
||||
{
|
||||
@ -30,16 +33,22 @@
|
||||
|
||||
- (void)windowControllerDidLoadNib:(NSWindowController *)controller
|
||||
{
|
||||
[super windowControllerDidLoadNib:controller];
|
||||
// Add any code here that need to be executed once the windowController has loaded the document's window.
|
||||
[super windowControllerDidLoadNib:controller];
|
||||
[self setupToolbar:controller];
|
||||
|
||||
{ // set up first column in outline view to display images as well as text
|
||||
ResourceNameCell *resourceNameCell = [[[ResourceNameCell alloc] init] autorelease];
|
||||
[resourceNameCell setEditable:YES];
|
||||
[[outlineView tableColumnWithIdentifier:@"name"] setDataCell:resourceNameCell];
|
||||
}
|
||||
|
||||
// [controller setDocumet:self];
|
||||
[dataSource setResources:resources];
|
||||
}
|
||||
|
||||
- (BOOL)keepBackupFile
|
||||
{
|
||||
return NO; // return whatever the user preference is for this! (NSDefaults)
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"PreserveBackups"];
|
||||
}
|
||||
|
||||
- (BOOL)windowShouldClose:(NSWindow *)sender
|
||||
@ -69,9 +78,15 @@
|
||||
}
|
||||
|
||||
/* TOOLBAR MANAGMENT */
|
||||
#pragma mark -
|
||||
|
||||
static NSString *RKToolbarIdentifier = @"com.nickshanks.resknife.toolbar";
|
||||
static NSString *RKCreateItemIdentifier = @"com.nickshanks.resknife.toolbar.create";
|
||||
static NSString *RKDeleteItemIdentifier = @"com.nickshanks.resknife.toolbar.delete";
|
||||
static NSString *RKEditItemIdentifier = @"com.nickshanks.resknife.toolbar.edit";
|
||||
static NSString *RKEditHexItemIdentifier = @"com.nickshanks.resknife.toolbar.edithex";
|
||||
static NSString *RKSaveItemIdentifier = @"com.nickshanks.resknife.toolbar.save";
|
||||
static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.showinfo";
|
||||
|
||||
- (void)setupToolbar:(NSWindowController *)controller
|
||||
{
|
||||
@ -92,35 +107,71 @@ static NSString *RKSaveItemIdentifier = @"com.nickshanks.resknife.toolbar.save";
|
||||
|
||||
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
|
||||
{
|
||||
if( [itemIdentifier isEqual:RKSaveItemIdentifier] )
|
||||
NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
|
||||
|
||||
if( [itemIdentifier isEqual:RKCreateItemIdentifier] )
|
||||
{
|
||||
[item setLabel:@"Create"];
|
||||
[item setPaletteLabel:@"Create"];
|
||||
[item setToolTip:@"Create New Resource"];
|
||||
[item setImage:[NSImage imageNamed:@"Create"]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(showCreateResourceSheet:)];
|
||||
return item;
|
||||
}
|
||||
else if( [itemIdentifier isEqual:RKDeleteItemIdentifier] )
|
||||
{
|
||||
[item setLabel:@"Delete"];
|
||||
[item setPaletteLabel:@"Delete"];
|
||||
[item setToolTip:@"Delete Selected Resource"];
|
||||
[item setImage:[NSImage imageNamed:@"Delete"]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(clear:)];
|
||||
return item;
|
||||
}
|
||||
else if( [itemIdentifier isEqual:RKEditItemIdentifier] )
|
||||
{
|
||||
[item setLabel:@"Edit"];
|
||||
[item setPaletteLabel:@"Edit"];
|
||||
[item setToolTip:@"Edit Resource In Default Editor"];
|
||||
[item setImage:[NSImage imageNamed:@"Edit"]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(openResource:)];
|
||||
return item;
|
||||
}
|
||||
else if( [itemIdentifier isEqual:RKEditHexItemIdentifier] )
|
||||
{
|
||||
[item setLabel:@"Edit Hex"];
|
||||
[item setPaletteLabel:@"Edit Hex"];
|
||||
[item setToolTip:@"Edit Resource As Hexadecimal"];
|
||||
[item setImage:[NSImage imageNamed:@"Edit Hex"]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(openResourceAsHex:)];
|
||||
return item;
|
||||
}
|
||||
else if( [itemIdentifier isEqual:RKSaveItemIdentifier] )
|
||||
{
|
||||
NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
|
||||
[item setLabel:@"Save"];
|
||||
[item setPaletteLabel:@"Save"];
|
||||
[item setToolTip:[NSString stringWithFormat:@"Save To %@ Fork", saveToDataFork? @"Data":@"Resource"]];
|
||||
[item setToolTip:[NSString stringWithFormat:@"Save To %@ Fork", !otherFork? @"Data":@"Resource"]];
|
||||
[item setImage:[NSImage imageNamed:@"Save"]];
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(saveDocument:)];
|
||||
return item;
|
||||
}
|
||||
else if( [itemIdentifier isEqual:RKShowInfoItemIdentifier] )
|
||||
{
|
||||
[item setLabel:@"Show Info"];
|
||||
[item setPaletteLabel:@"Show Info"];
|
||||
[item setToolTip:@"Show Resource Information Window"];
|
||||
[item setImage:[NSImage imageNamed:@"Show Info"]];
|
||||
[item setTarget:[NSApp delegate]];
|
||||
[item setAction:@selector(showInfo:)];
|
||||
return item;
|
||||
}
|
||||
else return nil;
|
||||
/* // Required delegate method Given an item identifier, self method returns an item
|
||||
// The toolbar will use self method to obtain toolbar items that can be displayed in the customization sheet, or in the toolbar itself
|
||||
NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease];
|
||||
|
||||
if ([itemIdent isEqual: SaveDocToolbarItemIdentifier]) {
|
||||
// Set the text label to be displayed in the toolbar and customization palette
|
||||
[toolbarItem setLabel: @"Save"];
|
||||
[toolbarItem setPaletteLabel: @"Save"];
|
||||
|
||||
// Set up a reasonable tooltip, and image Note, these aren't localized, but you will likely want to localize many of the item's properties
|
||||
[toolbarItem setToolTip: @"Save Your Document"];
|
||||
[toolbarItem setImage: [NSImage imageNamed: @"SaveDocumentItemImage"]];
|
||||
|
||||
// Tell the item what message to send when it is clicked
|
||||
[toolbarItem setTarget: self];
|
||||
[toolbarItem setAction: @selector(saveDocument:)];
|
||||
} else if([itemIdent isEqual: SearchDocToolbarItemIdentifier]) {
|
||||
|
||||
/* if([itemIdent isEqual: SearchDocToolbarItemIdentifier]) {
|
||||
NSMenu *submenu = nil;
|
||||
NSMenuItem *submenuItem = nil, *menuFormRep = nil;
|
||||
|
||||
@ -150,18 +201,34 @@ static NSString *RKSaveItemIdentifier = @"com.nickshanks.resknife.toolbar.save";
|
||||
// Returning nil will inform the toolbar self kind of item is not supported
|
||||
toolbarItem = nil;
|
||||
}
|
||||
return toolbarItem;*/
|
||||
return toolbarItem; */
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
|
||||
{
|
||||
return [NSArray arrayWithObjects:RKSaveItemIdentifier, NSToolbarPrintItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, nil];
|
||||
return [NSArray arrayWithObjects:RKCreateItemIdentifier, RKEditItemIdentifier, RKEditHexItemIdentifier, NSToolbarSeparatorItemIdentifier, RKSaveItemIdentifier, NSToolbarPrintItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, nil];
|
||||
}
|
||||
|
||||
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
|
||||
{
|
||||
return [NSArray arrayWithObjects:RKSaveItemIdentifier, NSToolbarPrintItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, NSToolbarSeparatorItemIdentifier, nil];
|
||||
return [NSArray arrayWithObjects:RKCreateItemIdentifier, RKDeleteItemIdentifier, RKEditItemIdentifier, RKEditHexItemIdentifier, RKSaveItemIdentifier, RKShowInfoItemIdentifier, NSToolbarPrintItemIdentifier, NSToolbarCustomizeToolbarItemIdentifier, NSToolbarFlexibleSpaceItemIdentifier, NSToolbarSpaceItemIdentifier, NSToolbarSeparatorItemIdentifier, nil];
|
||||
}
|
||||
|
||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)item
|
||||
{
|
||||
BOOL valid = NO;
|
||||
NSString *identifier = [item itemIdentifier];
|
||||
|
||||
if( [identifier isEqual:RKCreateItemIdentifier] ) valid = YES;
|
||||
else if( [identifier isEqual:RKDeleteItemIdentifier] ) valid = [outlineView numberOfSelectedRows]? YES:NO;
|
||||
else if( [identifier isEqual:RKEditItemIdentifier] ) valid = NO;
|
||||
else if( [identifier isEqual:RKEditHexItemIdentifier] ) valid = [outlineView numberOfSelectedRows]? YES:NO;
|
||||
else if( [identifier isEqual:RKSaveItemIdentifier] ) valid = [self isDocumentEdited];
|
||||
else if( [identifier isEqual:NSToolbarPrintItemIdentifier] ) valid = YES;
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
/*
|
||||
- (void) toolbarWillAddItem: (NSNotification *) notif {
|
||||
// Optional delegate method Before an new item is added to the toolbar, self notification is posted
|
||||
@ -191,21 +258,41 @@ static NSString *RKSaveItemIdentifier = @"com.nickshanks.resknife.toolbar.save";
|
||||
activeSearchItem = nil;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
- (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem {
|
||||
// Optional method self message is sent to us since we are the target of some toolbar item actions
|
||||
// (for example: of the save items action)
|
||||
BOOL enable = NO;
|
||||
if ([[toolbarItem itemIdentifier] isEqual: SaveDocToolbarItemIdentifier]) {
|
||||
// We will return YES (ie the button is enabled) only when the document is dirty and needs saving
|
||||
enable = [self isDocumentEdited];
|
||||
} else if ([[toolbarItem itemIdentifier] isEqual: NSToolbarPrintItemIdentifier]) {
|
||||
enable = YES;
|
||||
}
|
||||
return enable;
|
||||
}*/
|
||||
/* DOCUMENT MANAGEMENT */
|
||||
#pragma mark -
|
||||
|
||||
- (IBAction)showCreateResourceSheet:(id)sender
|
||||
{
|
||||
[[dataSource createResourceSheetController] showCreateResourceSheet:self];
|
||||
}
|
||||
|
||||
- (IBAction)openResource:(id)sender
|
||||
{
|
||||
if( NO );
|
||||
else [self openResourceAsHex:sender];
|
||||
}
|
||||
|
||||
- (IBAction)openResourceAsHex:(id)sender
|
||||
{
|
||||
// bug: only opens the hex editor!
|
||||
// NSBundle *hexEditor = [NSBundle bundleWithIdentifier:@"com.nickshanks.resknife.hexadecimal"];
|
||||
// NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
|
||||
NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Hexadecimal Editor.bundle"]];
|
||||
// [hexEditor load];
|
||||
|
||||
Resource *resource = [outlineView itemAtRow:[outlineView selectedRow]];
|
||||
// bug: I alloc a plug instance here, but have no idea where it gets dealloc'd
|
||||
[[[hexEditor principalClass] alloc] initWithResource:resource];
|
||||
}
|
||||
|
||||
- (IBAction)playSound:(id)sender
|
||||
{
|
||||
}
|
||||
|
||||
/* FILE HANDLING */
|
||||
#pragma mark -
|
||||
|
||||
- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type
|
||||
{
|
||||
@ -377,6 +464,7 @@ static NSString *RKSaveItemIdentifier = @"com.nickshanks.resknife.toolbar.save";
|
||||
}
|
||||
|
||||
/* ACCESSORS */
|
||||
#pragma mark -
|
||||
|
||||
- (NSOutlineView *)outlineView
|
||||
{
|
||||
|
14
Cocoa/Classes/ResourceNameCell.h
Normal file
14
Cocoa/Classes/ResourceNameCell.h
Normal file
@ -0,0 +1,14 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ResourceNameCell : NSTextFieldCell
|
||||
{
|
||||
NSImage *image;
|
||||
}
|
||||
|
||||
- (void)setImage:(NSImage *)anImage;
|
||||
- (NSImage *)image;
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView;
|
||||
- (NSSize)cellSize;
|
||||
|
||||
@end
|
91
Cocoa/Classes/ResourceNameCell.m
Normal file
91
Cocoa/Classes/ResourceNameCell.m
Normal file
@ -0,0 +1,91 @@
|
||||
#import "ResourceNameCell.h"
|
||||
|
||||
@implementation ResourceNameCell
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[image release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- copyWithZone:(NSZone *)zone
|
||||
{
|
||||
ResourceNameCell *cell = (ResourceNameCell *)[super copyWithZone:zone];
|
||||
(* cell).image = [image retain];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)setImage:(NSImage *)newImage
|
||||
{
|
||||
[image release];
|
||||
image = [newImage retain];
|
||||
}
|
||||
|
||||
- (NSImage *)image
|
||||
{
|
||||
return image;
|
||||
}
|
||||
|
||||
- (NSRect)imageFrameForCellFrame:(NSRect)cellFrame
|
||||
{
|
||||
if( image != nil )
|
||||
{
|
||||
NSRect imageFrame;
|
||||
imageFrame.size = NSMakeSize( 16.0, 16.0 ); // [image size];
|
||||
imageFrame.origin = cellFrame.origin;
|
||||
imageFrame.origin.x += 3;
|
||||
imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
|
||||
return imageFrame;
|
||||
}
|
||||
else return NSZeroRect;
|
||||
}
|
||||
|
||||
- (void)editWithFrame:(NSRect)cellFrame inView:(NSView *)controlView editor:(NSText *)textObject delegate:(id)delegateObject event:(NSEvent *)theEvent
|
||||
{
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect( cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge );
|
||||
[super editWithFrame:textFrame inView:controlView editor:textObject delegate:delegateObject event:theEvent];
|
||||
}
|
||||
|
||||
- (void)selectWithFrame:(NSRect)cellFrame inView:(NSView *)controlView editor:(NSText *)textObject delegate:(id)delegateObject start:(int)selStart length:(int)selLength
|
||||
{
|
||||
NSRect textFrame, imageFrame;
|
||||
NSDivideRect( cellFrame, &imageFrame, &textFrame, 3 + [image size].width, NSMinXEdge);
|
||||
[super selectWithFrame:textFrame inView:controlView editor:textObject delegate:delegateObject start:selStart length:selLength];
|
||||
}
|
||||
|
||||
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
|
||||
{
|
||||
if( image != nil )
|
||||
{
|
||||
NSRect imageFrame;
|
||||
NSSize imageSize = [image size];
|
||||
|
||||
NSDivideRect( cellFrame, &imageFrame, &cellFrame, 3 + imageSize.width, NSMinXEdge );
|
||||
if( [self drawsBackground] )
|
||||
{
|
||||
[[self backgroundColor] set];
|
||||
NSRectFill(imageFrame);
|
||||
}
|
||||
imageFrame.origin.x += 3;
|
||||
imageFrame.size = imageSize;
|
||||
|
||||
if( [controlView isFlipped] )
|
||||
imageFrame.origin.y += ceil((cellFrame.size.height + imageFrame.size.height) / 2);
|
||||
else imageFrame.origin.y += ceil((cellFrame.size.height - imageFrame.size.height) / 2);
|
||||
|
||||
// [image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver];
|
||||
[image drawInRect:imageFrame fromRect:NSMakeRect( 0, 0, imageSize.width, imageSize.height ) operation:NSCompositeSourceOver fraction:1.0];
|
||||
}
|
||||
|
||||
[super drawWithFrame:cellFrame inView:controlView];
|
||||
}
|
||||
|
||||
- (NSSize)cellSize
|
||||
{
|
||||
NSSize cellSize = [super cellSize];
|
||||
cellSize.width += (image? [image size].width:0) + 3;
|
||||
return cellSize;
|
||||
}
|
||||
|
||||
@end
|
9
Cocoa/English.lproj/Application.nib/classes.nib
generated
9
Cocoa/English.lproj/Application.nib/classes.nib
generated
@ -1,13 +1,7 @@
|
||||
{
|
||||
IBClasses = (
|
||||
{
|
||||
ACTIONS = {
|
||||
openResource = id;
|
||||
playSound = id;
|
||||
showCreateResourceSheet = id;
|
||||
showInfo = id;
|
||||
showPrefs = id;
|
||||
};
|
||||
ACTIONS = {showInfo = id; showPrefs = id; };
|
||||
CLASS = ApplicationDelegate;
|
||||
LANGUAGE = ObjC;
|
||||
SUPERCLASS = NSObject;
|
||||
@ -15,6 +9,7 @@
|
||||
{
|
||||
ACTIONS = {
|
||||
openResource = id;
|
||||
openResourceAsHex = id;
|
||||
playSound = id;
|
||||
showAbout = id;
|
||||
showCreateResourceSheet = id;
|
||||
|
4
Cocoa/English.lproj/Application.nib/info.nib
generated
4
Cocoa/English.lproj/Application.nib/info.nib
generated
@ -3,11 +3,11 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>260 559 432 426 0 0 1280 1002 </string>
|
||||
<string>249 101 432 426 0 0 1024 746 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>156 558 347 44 0 0 1280 1002 </string>
|
||||
<string>56 391 347 44 0 0 1024 746 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
|
BIN
Cocoa/English.lproj/Application.nib/objects.nib
generated
BIN
Cocoa/English.lproj/Application.nib/objects.nib
generated
Binary file not shown.
@ -42,9 +42,10 @@
|
||||
SUPERCLASS = NSObject;
|
||||
},
|
||||
{
|
||||
ACTIONS = {showCreateResourceSheet = id; };
|
||||
CLASS = ResourceDocument;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {dataSource = id; outlineView = id; };
|
||||
OUTLETS = {dataSource = ResourceDataSource; outlineView = NSOutlineView; };
|
||||
SUPERCLASS = NSDocument;
|
||||
},
|
||||
{CLASS = SizeFormatter; LANGUAGE = ObjC; SUPERCLASS = NSNumberFormatter; }
|
||||
|
@ -3,9 +3,13 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>14 132 480 547 0 74 1280 928 </string>
|
||||
<string>104 127 480 547 0 0 1024 746 </string>
|
||||
<key>IBFramework Version</key>
|
||||
<string>248.0</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>5</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>5P48</string>
|
||||
<key>IBUserGuides</key>
|
||||
|
BIN
Cocoa/English.lproj/ResourceDocument.nib/objects.nib
generated
BIN
Cocoa/English.lproj/ResourceDocument.nib/objects.nib
generated
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
#import "HexEditorDelegate.h"
|
||||
|
||||
/* Ideas, method names, and occasionally code stolen from HexEditor by Raphael Sebbe http://raphaelsebbe.multimania.com/ */
|
||||
|
||||
@implementation HexEditorDelegate
|
||||
|
||||
/* data re-representation methods */
|
||||
|
@ -19,7 +19,7 @@ NSString *ResourceChangedNotification = @"ResourceChangedNotification";
|
||||
if( self ) [self setWindowFrameAutosaveName:@"Hexadecimal Editor"];
|
||||
|
||||
// one instance of your principal class will be created for every resource the user wants to edit (similar to Windows apps)
|
||||
resource = newResource;
|
||||
resource = [newResource retain];
|
||||
|
||||
// load the window
|
||||
// [self setShouldCascadeWindows:YES];
|
||||
@ -30,6 +30,7 @@ NSString *ResourceChangedNotification = @"ResourceChangedNotification";
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[resource autorelease];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
BIN
Cocoa/Resources/Create.tiff
Normal file
BIN
Cocoa/Resources/Create.tiff
Normal file
Binary file not shown.
BIN
Cocoa/Resources/Delete.tiff
Normal file
BIN
Cocoa/Resources/Delete.tiff
Normal file
Binary file not shown.
BIN
Cocoa/Resources/Edit Hex.tiff
Normal file
BIN
Cocoa/Resources/Edit Hex.tiff
Normal file
Binary file not shown.
BIN
Cocoa/Resources/Edit.tiff
Normal file
BIN
Cocoa/Resources/Edit.tiff
Normal file
Binary file not shown.
Binary file not shown.
BIN
Cocoa/Resources/Show Info.tiff
Normal file
BIN
Cocoa/Resources/Show Info.tiff
Normal file
Binary file not shown.
@ -63,12 +63,89 @@
|
||||
path = Save.tiff;
|
||||
refType = 4;
|
||||
};
|
||||
F577A8F40211CFA801A80001 = {
|
||||
F577A8F50211D05E01A80001 = {
|
||||
fileRef = F577A8F30211CFA701A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A8F80211DC1E01A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = "Show Info.tiff";
|
||||
refType = 4;
|
||||
};
|
||||
F577A8F90211DC1E01A80001 = {
|
||||
fileRef = F577A8F80211DC1E01A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A8FA0211E4D401A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = Create.tiff;
|
||||
refType = 4;
|
||||
};
|
||||
F577A8FB0211E4D401A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = Edit.tiff;
|
||||
refType = 4;
|
||||
};
|
||||
F577A8FC0211E4D401A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = "Edit Hex.tiff";
|
||||
refType = 4;
|
||||
};
|
||||
F577A8FD0211E4D401A80001 = {
|
||||
fileRef = F577A8FA0211E4D401A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A8FE0211E4D401A80001 = {
|
||||
fileRef = F577A8FB0211E4D401A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A8FF0211E4D401A80001 = {
|
||||
fileRef = F577A8FC0211E4D401A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A900021215C801A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = ResourceNameCell.h;
|
||||
refType = 4;
|
||||
};
|
||||
F577A901021215C801A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = ResourceNameCell.m;
|
||||
refType = 4;
|
||||
};
|
||||
F577A902021215C901A80001 = {
|
||||
fileRef = F577A900021215C801A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A903021215C901A80001 = {
|
||||
fileRef = F577A901021215C801A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F577A904021220D601A80001 = {
|
||||
isa = PBXFileReference;
|
||||
path = Delete.tiff;
|
||||
refType = 4;
|
||||
};
|
||||
F577A905021220D601A80001 = {
|
||||
fileRef = F577A904021220D601A80001;
|
||||
isa = PBXBuildFile;
|
||||
settings = {
|
||||
};
|
||||
};
|
||||
F57CEE0B0189C95101A8010B = {
|
||||
children = (
|
||||
F5502C4001C579FF01C57124,
|
||||
@ -161,7 +238,6 @@
|
||||
files = (
|
||||
F5EF83AF020C08E601A80001,
|
||||
F5EF83C9020C20D801A80001,
|
||||
F577A8F40211CFA801A80001,
|
||||
);
|
||||
isa = PBXResourcesBuildPhase;
|
||||
name = "Bundle Resources";
|
||||
@ -357,6 +433,7 @@
|
||||
F53B5F3001C97EFB01A8010C,
|
||||
F53B5F3101C97EFB01A8010C,
|
||||
F5CDEBAC01FC893201A80001,
|
||||
F577A902021215C901A80001,
|
||||
);
|
||||
isa = PBXHeadersBuildPhase;
|
||||
name = Headers;
|
||||
@ -377,6 +454,12 @@
|
||||
F5B588640156D40B01000001,
|
||||
F5730B940159528A01000001,
|
||||
F5502C3401C5588601C57124,
|
||||
F577A8F50211D05E01A80001,
|
||||
F577A8F90211DC1E01A80001,
|
||||
F577A8FD0211E4D401A80001,
|
||||
F577A8FE0211E4D401A80001,
|
||||
F577A8FF0211E4D401A80001,
|
||||
F577A905021220D601A80001,
|
||||
);
|
||||
isa = PBXResourcesBuildPhase;
|
||||
name = "Bundle Resources";
|
||||
@ -397,6 +480,7 @@
|
||||
F5B5886F0156D40B01000001,
|
||||
F5B588700156D40B01000001,
|
||||
F5B588710156D40B01000001,
|
||||
F577A903021215C901A80001,
|
||||
);
|
||||
isa = PBXSourcesBuildPhase;
|
||||
name = Sources;
|
||||
@ -453,6 +537,8 @@
|
||||
F5B5882C0156D40B01000001,
|
||||
F5B5882D0156D40B01000001,
|
||||
F5B5882E0156D40B01000001,
|
||||
F577A900021215C801A80001,
|
||||
F577A901021215C801A80001,
|
||||
F5B5882F0156D40B01000001,
|
||||
F5B588300156D40B01000001,
|
||||
F5B588310156D40B01000001,
|
||||
@ -598,7 +684,12 @@
|
||||
F5B588460156D40B01000001,
|
||||
F5B588470156D40B01000001,
|
||||
F5B588480156D40B01000001,
|
||||
F577A8FA0211E4D401A80001,
|
||||
F577A904021220D601A80001,
|
||||
F577A8FB0211E4D401A80001,
|
||||
F577A8FC0211E4D401A80001,
|
||||
F577A8F30211CFA701A80001,
|
||||
F577A8F80211DC1E01A80001,
|
||||
);
|
||||
isa = PBXGroup;
|
||||
path = Resources;
|
||||
|
Loading…
x
Reference in New Issue
Block a user