/AppDelegate.m
http://mac-prop-terminal.googlecode.com/ · Objective C · 62 lines · 28 code · 9 blank · 25 comment · 3 complexity · d4dbb9aea968fb8c5b2c0abad44e03c5 MD5 · raw file
- //
- // AppDelegate.m
- // MacPropTerminal
- //
- // Created by Steve Nicholson on 6/5/11.
- // Copyright 2011 Harmony Ridge Software. All rights reserved.
- // Licensed under MIT License. See end of file for terms of use
- //
- #import "AppDelegate.h"
- #import "PreferenceController.h"
- @implementation AppDelegate
- @synthesize fontMenu;
- - (void)awakeFromNib {
- fontMenu = [[NSMenu alloc] initWithTitle:@"fonts"];
- NSFontManager *fontManager = [NSFontManager sharedFontManager];
- NSArray *fontNames = [fontManager availableFontFamilies];
- NSMutableArray *fixedPointFontNames = [[NSMutableArray alloc] initWithCapacity:[fontNames count]];
- for (NSString *fontName in fontNames) {
- if ([fontManager fontNamed:fontName hasTraits:NSFixedPitchFontMask]) {
- [fixedPointFontNames addObject:fontName];
- [fontMenu addItemWithTitle:fontName action:@selector(changeSelectedFont:) keyEquivalent:@""];
- }
- }
- }
- #pragma mark Accessors
- - (PreferenceController *)preferenceController {
- if (!preferenceController) {
- preferenceController = [[PreferenceController alloc] init];
- }
- return preferenceController;
- }
- #pragma mark IBAction methods
- - (IBAction)showPreferencePanel:(id)sender {
- [[self preferenceController] showWindow:self];
- }
- @end
- /*
- ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- ? TERMS OF USE: MIT License ?
- ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- ?Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ?
- ?files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ?
- ?modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software?
- ?is furnished to do so, subject to the following conditions: ?
- ? ?
- ?The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.?
- ? ?
- ?THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ?
- ?WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR ?
- ?COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ?
- ?ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ?
- ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- */