From 4f3da8543caacbaf1ce219e547e24a5490bee090 Mon Sep 17 00:00:00 2001 From: Matthew Judy Date: Mon, 24 Nov 2003 18:53:02 +0000 Subject: [PATCH] This about does it. I want to do a couple more things, especially multiple screen support. With the way I've got this set up, it should be pretty easy, but I need sleep first. If you want it in there, I'll do it after some sleep. --- Deprecated/ITChasingArrowsView.h | 4 +- ITBevelView.h | 4 +- ITButton.h | 15 ++++ ITButtonCell.h | 15 ++++ ITCategory-NSMenu.h | 2 +- ITCategory-NSView.h | 2 +- ITCoreGraphicsHacks.h | 4 +- ITCutWindowEffect.h | 4 +- ITCutWindowEffect.m | 25 ------- ITDissolveWindowEffect.h | 4 +- ITDissolveWindowEffect.m | 24 ------- ITHotKey.h | 21 ++++-- ITHotKeyCenter.h | 22 ++++-- ITImageCell.h | 6 +- ITImageView.h | 6 +- ITKeyBroadcaster.h | 21 ++++-- ITKeyCombo.h | 21 ++++-- ITKeyComboPanel.h | 22 ++++-- ITKit.h | 4 +- ITPivotWindowEffect.h | 4 +- ITPivotWindowEffect.m | 116 ++++++++++++++++-------------- ITSlideHorizontallyWindowEffect.h | 4 +- ITSlideHorizontallyWindowEffect.m | 23 ++---- ITSlideVerticallyWindowEffect.h | 4 +- ITSlideVerticallyWindowEffect.m | 25 +++---- ITStatusItem.h | 4 +- ITTSWBackgroundView.h | 4 +- ITTabView.h | 2 +- ITTableCornerView.h | 2 +- ITTableView.h | 2 +- ITTextField.h | 4 +- ITTextFieldCell.h | 6 +- ITTransientStatusWindow.h | 6 +- ITWindowEffect.h | 4 +- ITWindowPositioning.h | 5 +- 35 files changed, 229 insertions(+), 212 deletions(-) diff --git a/Deprecated/ITChasingArrowsView.h b/Deprecated/ITChasingArrowsView.h index 46ace83..6ef2844 100755 --- a/Deprecated/ITChasingArrowsView.h +++ b/Deprecated/ITChasingArrowsView.h @@ -2,10 +2,10 @@ * ITKit * ITChasingArrowsView * Animating Asynchronous Arrows Widget - * *** DEPRECATED: NSProgressIndicator now offers an async widget. MLJ - 01/14/2003 + * *** DEPRECATED: NSProgressIndicator now offers an async mode. MLJ - 01/14/2003 * * Original Author : Doug Brown <...> - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITBevelView.h b/ITBevelView.h index de07fd0..e582c2e 100755 --- a/ITBevelView.h +++ b/ITBevelView.h @@ -3,8 +3,8 @@ * ITBevelView * NSView subclass which draws a bevel. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2003 iThink Software. * All Rights Reserved diff --git a/ITButton.h b/ITButton.h index 12f5599..618437d 100755 --- a/ITButton.h +++ b/ITButton.h @@ -1,3 +1,18 @@ +/* + * ITKit + * ITButton + * Stylized button for use in Status Windows. + * + * Original Author : Matthew Judy + * Responsibility : Matthew Judy + * Responsibility : Joseph Spiros + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + #import diff --git a/ITButtonCell.h b/ITButtonCell.h index fea3247..e99ef10 100755 --- a/ITButtonCell.h +++ b/ITButtonCell.h @@ -1,3 +1,18 @@ +/* + * ITKit + * ITButtonCell + * Cell used by the ITButton control. + * + * Original Author : Matthew Judy + * Responsibility : Matthew Judy + * Responsibility : Joseph Spiros + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + + #import diff --git a/ITCategory-NSMenu.h b/ITCategory-NSMenu.h index ad058bd..6ccfb6e 100755 --- a/ITCategory-NSMenu.h +++ b/ITCategory-NSMenu.h @@ -4,7 +4,7 @@ * Category which extends NSMenu * * Original Author : Joseph Spiros - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITCategory-NSView.h b/ITCategory-NSView.h index f4894b2..de8beff 100755 --- a/ITCategory-NSView.h +++ b/ITCategory-NSView.h @@ -4,7 +4,7 @@ * Category which extends NSView * * Original Author : Joseph Spiros - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITCoreGraphicsHacks.h b/ITCoreGraphicsHacks.h index 31bc676..a07942b 100755 --- a/ITCoreGraphicsHacks.h +++ b/ITCoreGraphicsHacks.h @@ -3,8 +3,8 @@ * ITCoreGraphicsHacks * Header to import to work with private CoreGraphics API * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITCutWindowEffect.h b/ITCutWindowEffect.h index 4826001..fe53fc1 100755 --- a/ITCutWindowEffect.h +++ b/ITCutWindowEffect.h @@ -3,8 +3,8 @@ * ITCutWindowEffect * Effect subclass which performs a simple cut in or out, with no transition. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITCutWindowEffect.m b/ITCutWindowEffect.m index a33bac3..b4fa449 100755 --- a/ITCutWindowEffect.m +++ b/ITCutWindowEffect.m @@ -40,31 +40,6 @@ - (void)performAppear { - CGAffineTransform transform; - NSPoint appearPoint; - - //Set the location on the screen - if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - appearPoint.x = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - appearPoint.x = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) { - appearPoint.x = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2; - } - - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - appearPoint.y = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - appearPoint.y = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) { - appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2; - } - - transform = CGAffineTransformMakeTranslation(appearPoint.x, appearPoint.y); - CGSSetWindowTransform([NSApp contextID], - (CGSWindowID)[_window windowNumber], - transform); - [_window orderFront:self]; [self setWindowVisibility:ITWindowVisibleState]; } diff --git a/ITDissolveWindowEffect.h b/ITDissolveWindowEffect.h index 4455e73..ebc6342 100755 --- a/ITDissolveWindowEffect.h +++ b/ITDissolveWindowEffect.h @@ -3,8 +3,8 @@ * ITDissolveWindowEffect * Effect subclass which performs a dissolve fade effect on a window. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITDissolveWindowEffect.m b/ITDissolveWindowEffect.m index 6e5011a..5481832 100755 --- a/ITDissolveWindowEffect.m +++ b/ITDissolveWindowEffect.m @@ -50,32 +50,8 @@ - (void)performAppear { - CGAffineTransform transform; - NSPoint appearPoint; __idle = NO; - //Set the location on the screen - if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - appearPoint.x = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - appearPoint.x = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) { - appearPoint.x = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2; - } - - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - appearPoint.y = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - appearPoint.y = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) { - appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2; - } - - transform = CGAffineTransformMakeTranslation(appearPoint.x, appearPoint.y); - CGSSetWindowTransform([NSApp contextID], - (CGSWindowID)[_window windowNumber], - transform); - [self setWindowVisibility:ITWindowAppearingState]; [self performAppearFromProgress:0.0 effectTime:_effectTime]; } diff --git a/ITHotKey.h b/ITHotKey.h index d654bbc..7910081 100755 --- a/ITHotKey.h +++ b/ITHotKey.h @@ -1,14 +1,21 @@ -// -// ITHotKey.h -// -// Created by Quentin Carnicelli on Sat Aug 02 2003. -// Copyright (c) 2003 iThink Software. All rights reserved. -// +/* + * ITKit + * ITHotKey + * + * Original Author : Quentin Carnicelli <...> + * Responsibility : Kent Sutherland + * Responsibility : Matthew Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ -#import +#import #import "ITKeyCombo.h" + @interface ITHotKey : NSObject { NSString* mName; diff --git a/ITHotKeyCenter.h b/ITHotKeyCenter.h index e984bc5..3c8bb4c 100755 --- a/ITHotKeyCenter.h +++ b/ITHotKeyCenter.h @@ -1,14 +1,23 @@ -// -// ITHotKeyCenter.h -// -// Created by Quentin Carnicelli on Sat Aug 02 2003. -// Copyright (c) 2003 iThink Software. All rights reserved. -// +/* + * ITKit + * ITHotKeyCenter + * + * Original Author : Quentin Carnicelli <...> + * Responsibility : Kent Sutherland + * Responsibility : Matthew Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + #import + @class ITHotKey; + @interface ITHotKeyCenter : NSObject { NSMutableDictionary* mHotKeys; //Keys are NSValue of EventHotKeyRef @@ -24,4 +33,5 @@ - (void)sendEvent: (NSEvent*)event; + @end diff --git a/ITImageCell.h b/ITImageCell.h index c4bb080..4da918b 100755 --- a/ITImageCell.h +++ b/ITImageCell.h @@ -1,10 +1,10 @@ /* * ITKit * ITImageCell - * NSImageCell subclass which adds new features. + * Cell used by the ITImageView control. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2003 iThink Software. * All Rights Reserved diff --git a/ITImageView.h b/ITImageView.h index d9141c8..aafb576 100755 --- a/ITImageView.h +++ b/ITImageView.h @@ -1,10 +1,10 @@ /* * ITKit * ITImageView - * NSImageView subclass which adds new features. + * NSImageView subclass which adds new features, such as smooth scaling. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2003 iThink Software. * All Rights Reserved diff --git a/ITKeyBroadcaster.h b/ITKeyBroadcaster.h index 9e30ed4..1fed89f 100755 --- a/ITKeyBroadcaster.h +++ b/ITKeyBroadcaster.h @@ -1,9 +1,16 @@ -// -// ITKeyBroadcaster.h -// -// Created by Quentin Carnicelli on Sun Aug 03 2003. -// Copyright (c) 2003 iThink Software. All rights reserved. -// +/* + * ITKit + * ITHotKeyBroadcaster + * + * Original Author : Quentin Carnicelli <...> + * Responsibility : Kent Sutherland + * Responsibility : Matthew Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + #import @@ -14,6 +21,8 @@ + (long)cocoaModifiersAsCarbonModifiers: (long)cocoaModifiers; + @end + __private_extern__ NSString* ITKeyBroadcasterKeyEvent; //keys: keyCombo as ITKeyCombo \ No newline at end of file diff --git a/ITKeyCombo.h b/ITKeyCombo.h index 5bda4c5..d5c3d77 100755 --- a/ITKeyCombo.h +++ b/ITKeyCombo.h @@ -1,9 +1,16 @@ -// -// ITKeyCombo.h -// -// Created by Quentin Carnicelli on Sat Aug 02 2003. -// Copyright (c) 2003 iThink Software. All rights reserved. -// +/* + * ITKit + * ITKeyCombo + * + * Original Author : Quentin Carnicelli <...> + * Responsibility : Kent Sutherland + * Responsibility : Matthew Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ + #import @@ -30,8 +37,10 @@ - (BOOL)isClearCombo; - (BOOL)isValidHotKeyCombo; + @end + @interface ITKeyCombo (UserDisplayAdditions) - (NSString*)description; diff --git a/ITKeyComboPanel.h b/ITKeyComboPanel.h index fbe18aa..85806d4 100755 --- a/ITKeyComboPanel.h +++ b/ITKeyComboPanel.h @@ -1,17 +1,25 @@ -// -// ITKeyComboPanel.h +/* + * ITKit + * ITKeyComboPanel + * + * Original Author : Quentin Carnicelli <...> + * Responsibility : Kent Sutherland + * Responsibility : Matthew Judy + * + * Copyright (c) 2002 - 2003 iThink Software. + * All Rights Reserved + * + */ -// -// Created by Quentin Carnicelli on Sun Aug 03 2003. -// Copyright (c) 2003 iThink Software. All rights reserved. -// #import + @class ITKeyBroadcaster; @class ITKeyCombo; @class ITHotKey; + @interface ITKeyComboPanel : NSWindowController { IBOutlet NSTextField* mTitleField; @@ -37,4 +45,6 @@ - (IBAction)ok: (id)sender; - (IBAction)cancel: (id)sender; - (IBAction)clear: (id)sender; + + @end diff --git a/ITKit.h b/ITKit.h index ba348f0..50dacfb 100755 --- a/ITKit.h +++ b/ITKit.h @@ -2,8 +2,8 @@ * ITKit * iThink Software's custom extensions to Apple's AppKit framework * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITPivotWindowEffect.h b/ITPivotWindowEffect.h index 90be383..ae69b00 100755 --- a/ITPivotWindowEffect.h +++ b/ITPivotWindowEffect.h @@ -3,8 +3,8 @@ * ITPivotWindowEffect * Effect subclass which pivots (rotates) a window into position on the screen. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITPivotWindowEffect.m b/ITPivotWindowEffect.m index b5fe7c9..05dc3ac 100755 --- a/ITPivotWindowEffect.m +++ b/ITPivotWindowEffect.m @@ -68,7 +68,7 @@ [self setPivot:315.0]; [_window setAlphaValue:0.0]; } - + [_window orderFront:self]; _effectTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0 / EFFECT_FPS) target:self @@ -80,13 +80,17 @@ - (void)appearStep { float interPivot = 0.0; - [_window setEffectProgress:([_window effectProgress] + _effectSpeed)]; - [_window setEffectProgress:( ([_window effectProgress] < 1.0) ? [_window effectProgress] : 1.0)]; - interPivot = (( sin(([_window effectProgress] * pi) - (pi / 2)) + 1 ) / 2); - [self setPivot:((interPivot * 45) + 315)]; + float progress = ([_window effectProgress] + _effectSpeed); + + progress = ( (progress < 1.0) ? progress : 1.0 ); + + [_window setEffectProgress:progress]; + + interPivot = (( sin((progress * pi) - (pi / 2)) + 1 ) / 2); + [self setPivot:(315 + (interPivot * 45))]; [_window setAlphaValue:interPivot]; - - if ( [_window effectProgress] >= 1.0 ) { + + if ( progress >= 1.0 ) { [self appearFinish]; } } @@ -96,9 +100,9 @@ [_effectTimer invalidate]; _effectTimer = nil; [self setWindowVisibility:ITWindowVisibleState]; - + __idle = YES; - + if ( __shouldReleaseWhenIdle ) { [self release]; } @@ -107,10 +111,10 @@ - (void)cancelAppear { [self setWindowVisibility:ITWindowVanishingState]; - + [_effectTimer invalidate]; _effectTimer = nil; - + [self performVanishFromProgress:[_window effectProgress] effectTime:(_effectTime / 3.5)]; } @@ -136,7 +140,7 @@ [self setPivot:0.0]; [_window setAlphaValue:1.0]; } - + [_window orderFront:self]; _effectTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0 / EFFECT_FPS) target:self @@ -148,13 +152,17 @@ - (void)vanishStep { float interPivot = 1.0; - [_window setEffectProgress:([_window effectProgress] - _effectSpeed)]; - [_window setEffectProgress:( ([_window effectProgress] > 0.0) ? [_window effectProgress] : 0.0)]; + float progress = ([_window effectProgress] - _effectSpeed); + + progress = ( (progress > 0.0) ? progress : 0.0); + + [_window setEffectProgress:progress]; + interPivot = (( sin(([_window effectProgress] * pi) - (pi / 2)) + 1 ) / 2); - [self setPivot:((interPivot * 45) + 315)]; + [self setPivot:(315 + (interPivot * 45))]; [_window setAlphaValue:interPivot]; - - if ( [_window effectProgress] <= 0.0 ) { + + if ( progress <= 0.0 ) { [self vanishFinish]; } } @@ -167,9 +175,9 @@ [_window setAlphaValue:1.0]; [self setPivot:0.0]; [self setWindowVisibility:ITWindowHiddenState]; - + __idle = YES; - + if ( __shouldReleaseWhenIdle ) { [self release]; } @@ -178,10 +186,10 @@ - (void)cancelVanish { [self setWindowVisibility:ITWindowAppearingState]; - + [_effectTimer invalidate]; _effectTimer = nil; - + [self performAppearFromProgress:[_window effectProgress] effectTime:(_effectTime / 3.5)]; } @@ -194,51 +202,53 @@ - (void)setPivot:(float)angle { float degAngle; - NSPoint appearPoint; CGAffineTransform transform; + NSRect windowFrame = [_window frame]; + NSRect screenFrame = [[_window screen] frame]; + int hPos = [_window horizontalPosition]; + int vPos = [_window verticalPosition]; + float translateX; + float translateY; - if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - degAngle = (angle * (pi / 180)); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - degAngle = (-angle * (pi / 180)); + if ( vPos == ITWindowPositionBottom ) { + if ( hPos == ITWindowPositionLeft ) { + angle = angle; + } else if ( hPos == ITWindowPositionRight ) { + angle = ( 45 - -(315 - angle) ); } - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - degAngle = (angle * (pi / 180)); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - degAngle = (angle * (pi / 180)); + } else if ( vPos == ITWindowPositionTop ) { + if ( hPos == ITWindowPositionLeft ) { + angle = ( 45 - -(315 - angle) ); + } else if ( hPos == ITWindowPositionRight ) { + angle = angle; } } + degAngle = (angle * (pi / 180)); transform = CGAffineTransformMakeRotation(degAngle); - // Set pivot rotation point - //transform.tx = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - transform.ty = ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y ); - - if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - appearPoint.x = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - transform.tx = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - transform.tx = -( 32.0 + [[_window screen] visibleFrame].origin.x ) + [_window frame].size.width; - appearPoint.x = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 64.0); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) { - appearPoint.x = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2; + if ( vPos == ITWindowPositionBottom ) { + transform.ty = ( windowFrame.size.height + windowFrame.origin.y); + translateY = -(screenFrame.size.height); + } else if ( vPos == ITWindowPositionTop ) { + transform.ty = -( screenFrame.size.height - windowFrame.origin.y - windowFrame.size.height ); + translateY = 0; + } + + if ( hPos == ITWindowPositionLeft ) { + transform.tx = -( windowFrame.origin.x ); + translateX = 0; + } else if ( hPos == ITWindowPositionRight ) { + transform.tx = ( screenFrame.size.width - windowFrame.origin.x ); + translateX = -(screenFrame.size.width); } - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2; - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - appearPoint.y = -( [[_window screen] frame].size.height - ([_window frame].origin.y) + 32.0 + [[_window screen] visibleFrame].origin.y) ; - }/* else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) { - appearPoint.y = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2; - }*/ CGSSetWindowTransform([NSApp contextID], (CGSWindowID)[_window windowNumber], CGAffineTransformTranslate( transform, - appearPoint.x, - appearPoint.y ) ); + translateX, + translateY ) ); } + @end diff --git a/ITSlideHorizontallyWindowEffect.h b/ITSlideHorizontallyWindowEffect.h index 5b3047c..5054912 100755 --- a/ITSlideHorizontallyWindowEffect.h +++ b/ITSlideHorizontallyWindowEffect.h @@ -3,8 +3,8 @@ * ITSlideHorizontallyWindowEffect * Effect subclass which slides a window in from the right or left side of the screen. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITSlideHorizontallyWindowEffect.m b/ITSlideHorizontallyWindowEffect.m index e1b3066..f0e5d78 100755 --- a/ITSlideHorizontallyWindowEffect.m +++ b/ITSlideHorizontallyWindowEffect.m @@ -186,26 +186,17 @@ - (void)setSlide:(float)distance { CGAffineTransform transform; - float yPoint; + NSPoint translation; - if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - yPoint = ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - yPoint = -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionMiddle ) { - yPoint = ( [_window frame].size.height - [[_window screen] visibleFrame].size.height) / 2; + if ( [_window horizontalPosition] == ITWindowPositionLeft ) { + translation.x = ( -([_window frame].origin.x) + distance ) ; + } else if ( [_window horizontalPosition] == ITWindowPositionRight ) { + translation.x = ( -([_window frame].origin.x) - distance ) ; } - /*if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - transform = CGAffineTransformMakeTranslation((distance - (32.0 + [[_window screen] visibleFrame].origin.x)), - ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) ? -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ) : ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ) ); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - transform = CGAffineTransformMakeTranslation(-((([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) + distance) - 32.0 - [_window frame].size.width), - ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) ? -( [[_window screen] frame].size.height - ( [_window frame].size.height + 32.0 + [[_window screen] visibleFrame].origin.y) ) : ( 64.0 + [[_window screen] visibleFrame].origin.y - [_window frame].size.height ) ); - }*/ + translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - [_window frame].size.height ); - transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? (distance - (32.0 + [[_window screen] visibleFrame].origin.x)) : -((([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) + distance) - 32.0 - [_window frame].size.width), - yPoint); + transform = CGAffineTransformMakeTranslation( translation.x, translation.y ); CGSSetWindowTransform([NSApp contextID], (CGSWindowID)[_window windowNumber], diff --git a/ITSlideVerticallyWindowEffect.h b/ITSlideVerticallyWindowEffect.h index e267182..58a4fe9 100755 --- a/ITSlideVerticallyWindowEffect.h +++ b/ITSlideVerticallyWindowEffect.h @@ -3,8 +3,8 @@ * ITSlideVerticallyWindowEffect * Effect subclass which slides a window in from the top or bottom of the screen. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITSlideVerticallyWindowEffect.m b/ITSlideVerticallyWindowEffect.m index 6f2f47a..a8825ab 100755 --- a/ITSlideVerticallyWindowEffect.m +++ b/ITSlideVerticallyWindowEffect.m @@ -186,26 +186,17 @@ - (void)setSlide:(float)distance { CGAffineTransform transform; - float xPoint; + NSPoint translation; - if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) { - xPoint = -( 32.0 + [[_window screen] visibleFrame].origin.x ); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionRight ) { - xPoint = -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width); - } else if ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionCenter ) { - xPoint = ( [_window frame].size.width - [[_window screen] visibleFrame].size.width ) / 2; - } + translation.x = -( [_window frame].origin.x ); - /*if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionBottom ) { - transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? -( 32.0 + [[_window screen] visibleFrame].origin.x ) : -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width), - -( [[_window screen] frame].size.height - ( distance + 32.0 + [[_window screen] visibleFrame].origin.y ) ) ); - } else if ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) { - transform = CGAffineTransformMakeTranslation( ( [(ITTransientStatusWindow *)_window horizontalPosition] == ITWindowPositionLeft ) ? -( 32.0 + [[_window screen] visibleFrame].origin.x ) : -(([[_window screen] visibleFrame].size.width + [[_window screen] visibleFrame].origin.x) - 32.0 - [_window frame].size.width), - [[_window screen] visibleFrame].origin.y - distance + 64.0 ); - }*/ + if ( [_window verticalPosition] == ITWindowPositionTop ) { + translation.y = ( (([_window frame].size.height * 2) - ([[_window screen] frame].size.height - [_window frame].origin.y)) - distance); + } else if ( [_window verticalPosition] == ITWindowPositionBottom ) { + translation.y = -( [[_window screen] frame].size.height - [_window frame].origin.y - distance ); + } - transform = CGAffineTransformMakeTranslation(xPoint, - ( [(ITTransientStatusWindow *)_window verticalPosition] == ITWindowPositionTop ) ? ( [[_window screen] visibleFrame].origin.y - distance + 64.0 ) : -( [[_window screen] frame].size.height - ( distance + 32.0 + [[_window screen] visibleFrame].origin.y ) ) ); + transform = CGAffineTransformMakeTranslation( translation.x, translation.y ); CGSSetWindowTransform([NSApp contextID], (CGSWindowID)[_window windowNumber], diff --git a/ITStatusItem.h b/ITStatusItem.h index 4116107..fb381e0 100755 --- a/ITStatusItem.h +++ b/ITStatusItem.h @@ -4,8 +4,8 @@ * NSStatusItem subclass which reduces suckage * * Original Author : Joseph Spiros - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITTSWBackgroundView.h b/ITTSWBackgroundView.h index 7c80758..129eb03 100755 --- a/ITTSWBackgroundView.h +++ b/ITTSWBackgroundView.h @@ -3,8 +3,8 @@ * ITTSWBackgroundView * NSView subclass which draws a translucent background with rounded corners. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITTabView.h b/ITTabView.h index 278238a..89b5fef 100755 --- a/ITTabView.h +++ b/ITTabView.h @@ -4,7 +4,7 @@ * NSTabView subclass which includes convenience features * * Original Author : Kent Sutherland - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Kent Sutherland * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITTableCornerView.h b/ITTableCornerView.h index 43afa7e..b9a3577 100755 --- a/ITTableCornerView.h +++ b/ITTableCornerView.h @@ -4,7 +4,7 @@ * NSPopUpButton subclass for corner views in a table view. * * Original Author : Joseph Spiros - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITTableView.h b/ITTableView.h index af06287..66444e8 100755 --- a/ITTableView.h +++ b/ITTableView.h @@ -5,7 +5,7 @@ * (with optional image) to the corner view of the TableView. * * Original Author : Joseph Spiros - * Responsibility : Matt Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002-2003 iThink Software. diff --git a/ITTextField.h b/ITTextField.h index 0a100ae..d796245 100755 --- a/ITTextField.h +++ b/ITTextField.h @@ -3,8 +3,8 @@ * ITTextField * Allows shadows to be drawn under text. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. diff --git a/ITTextFieldCell.h b/ITTextFieldCell.h index 50d8cf0..5285faf 100755 --- a/ITTextFieldCell.h +++ b/ITTextFieldCell.h @@ -1,10 +1,10 @@ /* * ITKit * ITTextFieldCell - * Allows shadows to be drawn under text in cells. + * Cell used by the ITTextField control. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2003 iThink Software. diff --git a/ITTransientStatusWindow.h b/ITTransientStatusWindow.h index 39f637e..26fd426 100755 --- a/ITTransientStatusWindow.h +++ b/ITTransientStatusWindow.h @@ -4,10 +4,10 @@ * NSWindow subclass for quick display of status information. * Similar to volume/brightness/eject bezel key windows. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros - * Contributor : Kent Sutherland + * Contributor : Kent Sutherland * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITWindowEffect.h b/ITWindowEffect.h index 8663331..9b6c0bd 100755 --- a/ITWindowEffect.h +++ b/ITWindowEffect.h @@ -3,8 +3,8 @@ * ITWindowEffect * Protocal and abstract superclass for performing effects on windows. * - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * * Copyright (c) 2002 - 2003 iThink Software. * All Rights Reserved diff --git a/ITWindowPositioning.h b/ITWindowPositioning.h index e2e5850..c43a7f4 100755 --- a/ITWindowPositioning.h +++ b/ITWindowPositioning.h @@ -3,9 +3,8 @@ * ITWindowPositioning * Protocol which defines methods for window positioning presets. * - * Original Author : Kent Sutherland - * Original Author : Matt Judy - * Responsibility : Matt Judy + * Original Author : Matthew Judy + * Responsibility : Matthew Judy * Responsibility : Joseph Spiros * * Copyright (c) 2002 - 2003 iThink Software. -- 2.20.1