-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathAboutBoxController.m
71 lines (53 loc) · 2.21 KB
/
AboutBoxController.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* The Cheat - The legendary universal game trainer for Mac OS X.
* http://www.brokenzipper.com/trac/wiki/TheCheat
*
* Copyright (c) 2003-2011, Charles McGarvey et al.
*
* Distributable under the terms and conditions of the 2-clause BSD
* license; see the file COPYING for the legal text of the license.
*/
#import "AboutBoxController.h"
@implementation AboutBoxController
- (id)init
{
return [super initWithWindowNibName:@"AboutBox"];
}
- (void)windowDidLoad
{
NSDictionary *attributes;
NSAttributedString *string;
// set the version string
[ibNameVersionText setStringValue:[NSString stringWithFormat:@"Version %@", ChazAppVersion()]];
// set the built string
[ibDateText setStringValue:[NSString stringWithFormat:@"Built %@", [ChazAppBuildDate() description]]];
// set the attributes for the website and email links
attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor blueColor], NSForegroundColorAttributeName,
[NSNumber numberWithBool:YES], NSUnderlineStyleAttributeName,
[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]], NSFontAttributeName, nil];
string = [[NSAttributedString alloc] initWithString:[ibWebsiteButton title] attributes:attributes];
[ibWebsiteButton setAttributedTitle:string];
[string release];
string = [[NSAttributedString alloc] initWithString:[ibEmailButton title] attributes:attributes];
[ibEmailButton setAttributedTitle:string];
[string release];
attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor redColor], NSForegroundColorAttributeName,
[NSNumber numberWithBool:YES], NSUnderlineStyleAttributeName,
[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]], NSFontAttributeName, nil];
string = [[NSAttributedString alloc] initWithString:[ibWebsiteButton title] attributes:attributes];
[ibWebsiteButton setAttributedAlternateTitle:string];
[string release];
string = [[NSAttributedString alloc] initWithString:[ibEmailButton title] attributes:attributes];
[ibEmailButton setAttributedAlternateTitle:string];
[string release];
[[self window] center];
}
- (IBAction)ibWebsiteButton:(id)sender
{
LaunchWebsite();
}
- (IBAction)ibEmailButton:(id)sender
{
LaunchEmail();
}
@end