OSDN Git Service

add Text Layer
[eliscolors/main.git] / ElisMovieSizeWindowController.m
1 //
2 //  ElisMovieSizeWindowController.m
3 //  Elis Colors
4 //
5 //  Created by 柳 on 09/09/26.
6 //  Copyright 2009 __MyCompanyName__. All rights reserved.
7 //
8
9 #import "ElisMovieSizeWindowController.h"
10
11
12 @implementation ElisMovieSizeWindowController
13
14 - (id)init
15 {
16     [NSBundle loadNibNamed:@"movieSizeWindow" owner:self];
17     return self;
18 }
19
20 - (void)run
21 {
22     [_widthField setIntValue:(int)ProjectMovieSize.size.width];
23     [_heightField setIntValue:(int)ProjectMovieSize.size.height];
24     
25     [NSApp beginSheet:_window modalForWindow:_mainWindow 
26         modalDelegate:self didEndSelector:nil contextInfo:nil];
27 }
28
29 - (IBAction)pushedOK:(id)sender
30 {
31     int x, y;
32     x = [_widthField intValue];
33     y = [_heightField intValue];
34     
35     if(x > 0 && y > 0){
36         ProjectMovieSize.size.width = x;
37         ProjectMovieSize.size.height = y;
38     }
39     
40     [_window close];
41     [NSApp endSheet:_window returnCode:NSCancelButton];
42     
43     [_mainView reshape];
44 }
45
46 - (IBAction)pushedCancel:(id)sender
47 {
48     [_window close];
49     [NSApp endSheet:_window];
50 }
51
52 - (void)setMainWindow:(NSWindow *)w
53 {
54     _mainWindow = w;
55 }
56
57 - (void)setMainView:(id)v
58 {
59     _mainView = v;
60 }
61
62 @end