Bug fixes

This commit is contained in:
Nicholas Shanks 2002-05-09 23:29:22 +00:00
parent bc2c081e61
commit 7b6cbbc706
10 changed files with 21 additions and 15 deletions

View File

@ -57,7 +57,7 @@
[[attributesMatrix cellAtRow:purgableBox column:0] setState:[[selectedResource attributes] shortValue] & resPurgeable];
[[attributesMatrix cellAtRow:systemHeapBox column:0] setState:[[selectedResource attributes] shortValue] & resSysHeap];
}
else
else if( currentDocument != nil )
{
// get sizes of forks as they are on disk
UInt64 dataLogicalSize = 0, rsrcLogicalSize = 0;
@ -73,8 +73,8 @@
[[self window] setTitle:@"Document Info"];
[iconView setImage:[NSImage imageNamed:@"Resource file"]];
[nameView setStringValue:[currentDocument fileName]? [[currentDocument fileName] lastPathComponent]:[currentDocument displayName]];
[[filePropertyForm cellAtIndex:0] setStringValue:[currentDocument creator]];
[[filePropertyForm cellAtIndex:1] setStringValue:[currentDocument type]];
[[filePropertyForm cellAtIndex:0] setStringValue:@"hi:)"/*[currentDocument creator]*/];
[[filePropertyForm cellAtIndex:1] setStringValue:@"helo"/*[currentDocument type]*/];
// [[filePropertyForm cellAtIndex:2] setObjectValue:[NSNumber numberWithUnsignedLongLong:dataLogicalSize]];
// [[filePropertyForm cellAtIndex:3] setObjectValue:[NSNumber numberWithUnsignedLongLong:rsrcLogicalSize]];
[[filePropertyForm cellAtIndex:2] setStringValue:[[NSNumber numberWithUnsignedLongLong:dataLogicalSize] description]];
@ -91,7 +91,9 @@
currentDocument = [controller document];
else currentDocument = nil;
selectedResource = [[currentDocument outlineView] selectedItem];
if( currentDocument )
selectedResource = [[currentDocument outlineView] selectedItem];
else selectedResource = [controller resource];
[self updateInfoWindow];
}

View File

@ -299,8 +299,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
// opens resource in template using TMPL resource with name templateName
NSBundle *templateEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Template Editor.plugin"]];
// bug: this only checks the CURRENT DOCUMENT for template resources
// Resource *tmpl = [dataSource resourceOfType:@"TMPL" withName:[resource type]];
// bug: this checks EVERY DOCUMENT for template resources (might not be desired)
Resource *tmpl = [Resource resourceOfType:@"TMPL" withName:[resource type] inDocument:nil];
// open the resources, passing in the template to use
@ -320,7 +319,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
// bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self autorelease] when it's last window is closed?
[(id <ResKnifePluginProtocol>)[[hexEditor principalClass] alloc] initWithResource:resource];
NSWindowController *plugController = [(id <ResKnifePluginProtocol>)[[hexEditor principalClass] alloc] initWithResource:resource];
}
- (IBAction)playSound:(id)sender

View File

@ -5,12 +5,12 @@
<key>IBDocumentLocation</key>
<string>142 473 384 240 0 0 1024 746 </string>
<key>IBFramework Version</key>
<string>248.0</string>
<string>263.2</string>
<key>IBOpenObjects</key>
<array>
<integer>50</integer>
</array>
<key>IBSystem Version</key>
<string>5Q45</string>
<string>5Q125</string>
</dict>
</plist>

Binary file not shown.

View File

@ -3,13 +3,9 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>279 92 422 584 0 0 1152 848 </string>
<string>539 135 422 584 0 0 1280 1002 </string>
<key>IBFramework Version</key>
<string>263.2</string>
<key>IBOpenObjects</key>
<array>
<integer>6</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
</dict>

View File

@ -142,6 +142,7 @@
selection = [[self delegate] asciiRangeFromByteRange:byteSelection];
[self setSelectedRange:selection];
[data release];
NSLog(@"undo manager %@", [[self window] undoManager]);
}
- (IBAction)deleteBackward:(id)sender

View File

@ -13,6 +13,7 @@
IBOutlet NSTextView *offset;
IBOutlet NSTextField *message;
NSUndoManager *hexUndo;
id <ResKnifeResourceProtocol> resource;
int bytesPerRow;
}

View File

@ -12,6 +12,7 @@
// one instance of your principal class will be created for every resource the user wants to edit (similar to Windows apps)
resource = [newResource retain];
bytesPerRow = 16;
hexUndo = [[NSUndoManager alloc] init];
// load the window from the nib file and set it's title
[self window]; // implicitly loads nib
@ -178,4 +179,10 @@
return bytesPerRow;
}
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)sender
{
NSLog(@"returning undo manager %@", hexUndo);
return hexUndo;
}
@end

View File

@ -13,7 +13,7 @@ typedef struct RLEPixelData
short reserved1;
short reserved2;
short reserved3;
char tokens[]; // the RLE token data (variable size array)
char tokens[1]; // the RLE token data (variable size array)
} RLEPixelData;
#define kRLEResourceHeaderSize (sizeof(RLEPixelData) - 1)