1//
2//  PXImageSizePrompter.m
3//  Pixel Editor
4//
5//  Created by Open Sword Group on Thu May 01 2003.
6//  Copyright (c) 2003 Open Sword Group. All rights reserved.
7//
8
9#import "PXImageSizePrompter.h"
10#import "PXCanvasView.h"
11
12@implementation PXImageSizePrompter
13
14- init
15{
16    return [super initWithWindowNibName:@"PXImageSizePrompt"];
17}
18
19- (void)setDelegate:newDelegate
20{
21    delegate = newDelegate;
22}
23
24- (void)promptInWindow:window
25{
26    if([[[NSProcessInfo processInfo] arguments] containsObject:@"-SenTest"]) { return; }
27    [NSApp beginSheet:[self window] modalForWindow:window modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
28}
29
30- (IBAction)useEnteredSize:sender
31{
32    [delegate prompter:self didFinishWithSize:NSMakeSize([[sizeForm cellAtIndex:0] intValue], [[sizeForm cellAtIndex:1] intValue])];
33    [NSApp endSheet:[self window]];
34    [self close];
35}
36
37- (void)setDefaultSize:(NSSize)size
38{
39    [[sizeForm cellAtIndex:0] setIntValue:size.width];
40    [[sizeForm cellAtIndex:1] setIntValue:size.height];
41}
42
43@end
44