]> Dogcows Code - chaz/thecheat/blob - AboutBoxController.m
update contact information and project URL
[chaz/thecheat] / AboutBoxController.m
1
2 /*
3 * The Cheat - The legendary universal game trainer for Mac OS X.
4 * http://www.brokenzipper.com/trac/wiki/TheCheat
5 *
6 * Copyright (c) 2003-2011, Charles McGarvey et al.
7 *
8 * Distributable under the terms and conditions of the 2-clause BSD
9 * license; see the file COPYING for the legal text of the license.
10 */
11
12 #import "AboutBoxController.h"
13
14
15 @implementation AboutBoxController
16
17
18 - (id)init
19 {
20 return [super initWithWindowNibName:@"AboutBox"];
21 }
22
23 - (void)windowDidLoad
24 {
25 NSDictionary *attributes;
26 NSAttributedString *string;
27
28 // set the version string
29 [ibNameVersionText setStringValue:[NSString stringWithFormat:@"Version %@", ChazAppVersion()]];
30 // set the built string
31 [ibDateText setStringValue:[NSString stringWithFormat:@"Built %@", [ChazAppBuildDate() description]]];
32
33 // set the attributes for the website and email links
34 attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor blueColor], NSForegroundColorAttributeName,
35 [NSNumber numberWithBool:YES], NSUnderlineStyleAttributeName,
36 [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]], NSFontAttributeName, nil];
37
38 string = [[NSAttributedString alloc] initWithString:[ibWebsiteButton title] attributes:attributes];
39 [ibWebsiteButton setAttributedTitle:string];
40 [string release];
41 string = [[NSAttributedString alloc] initWithString:[ibEmailButton title] attributes:attributes];
42 [ibEmailButton setAttributedTitle:string];
43 [string release];
44
45 attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor redColor], NSForegroundColorAttributeName,
46 [NSNumber numberWithBool:YES], NSUnderlineStyleAttributeName,
47 [NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSSmallControlSize]], NSFontAttributeName, nil];
48
49 string = [[NSAttributedString alloc] initWithString:[ibWebsiteButton title] attributes:attributes];
50 [ibWebsiteButton setAttributedAlternateTitle:string];
51 [string release];
52 string = [[NSAttributedString alloc] initWithString:[ibEmailButton title] attributes:attributes];
53 [ibEmailButton setAttributedAlternateTitle:string];
54 [string release];
55
56 [[self window] center];
57 }
58
59
60 - (IBAction)ibWebsiteButton:(id)sender
61 {
62 LaunchWebsite();
63 }
64
65 - (IBAction)ibEmailButton:(id)sender
66 {
67 LaunchEmail();
68 }
69
70
71 @end
This page took 0.032486 seconds and 4 git commands to generate.