forked from anthonyc-r/Gem
-
Notifications
You must be signed in to change notification settings - Fork 1
/
EditorWindow.m
52 lines (39 loc) · 1.63 KB
/
EditorWindow.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
Copyright (C) 2013 German A. Arias <[email protected]>
This file is part of Gemas application
Gemas is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This application is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#import "EditorWindow.h"
@implementation EditorWindow
- (id) initWithContentRect: (NSRect)contentRect styleMask: (unsigned int)aStyle backing: (NSBackingStoreType)bufferingType defer: (BOOL)flag
{
NSInteger width = 680, height = 510;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
//Set the Window size
if ([defaults integerForKey: @"EditorWidth"] != 0)
{
width = [defaults integerForKey: @"EditorWidth"];
}
if ([defaults integerForKey: @"EditorHeight"] != 0)
{
height = [defaults integerForKey: @"EditorHeight"];
}
if ( (height != 510) || (width != 680) )
{
contentRect.size.width = width;
contentRect.size.height = height;
}
self = [super initWithContentRect: contentRect styleMask: aStyle backing: bufferingType defer: flag];
return self;
}
@end