Added dual window classes.

CQTexperiment
vspader 2009-02-22 11:22:35 -08:00
parent cff2ef5178
commit c107c67ba7
2 changed files with 76 additions and 0 deletions

21
Application/DualWindow.h Normal file
View File

@ -0,0 +1,21 @@
//
// InvertedToolbarWindow.h
// Cog
//
// Created by Vincent Spader on 10/31/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface DualWindow : NSWindow {
IBOutlet DualWindow *otherWindow;
}
- (void)showWindow;
- (BOOL)isHidden;
- (void)setHidden:(BOOL)h;
@end

55
Application/DualWindow.m Normal file
View File

@ -0,0 +1,55 @@
//
// InvertedToolbarWindow.m
// Cog
//
// Created by Vincent Spader on 10/31/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import "DualWindow.h"
@implementation DualWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
if (self)
{
}
return self;
}
- (NSString *)hiddenDefaultsKey
{
if ([self frameAutosaveName])
{
return [[self frameAutosaveName] stringByAppendingString:@" Window Content Height"];
}
return nil;
}
- (BOOL)isHidden
{
return [[NSUserDefaults standardUserDefaults] boolForKey:[self hiddenDefaultsKey]];
}
- (void)setHidden:(BOOL)h
{
[[NSUserDefaults standardUserDefaults] setBool:h forKey:[self hiddenDefaultsKey]];
}
- (void)toggleToolbarShown:(id)sender
{
[otherWindow showWindow];
}
- (void)showWindow
{
[otherWindow close];
[self makeKeyAndOrderFront:self];
}
@end