X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/c6baa45585d2caea0a6d824a63e308e47f2f52de..650aa30b6ac73ecb0727ec4409f02bf90adf51f5:/Showcase/Controller.m?ds=inline diff --git a/Showcase/Controller.m b/Showcase/Controller.m old mode 100755 new mode 100644 index ba9c278..9f9c1f6 --- a/Showcase/Controller.m +++ b/Showcase/Controller.m @@ -9,6 +9,7 @@ #import "ITSlideHorizontallyWindowEffect.h" #import "ITSlideVerticallyWindowEffect.h" #import "ITPivotWindowEffect.h" +#import "ITZoomWindowEffect.h" #import "ITMultilineTextFieldCell.h" @@ -31,7 +32,7 @@ { [self createStatusItem]; [button setBezelStyle:1001]; - [button setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:14]]; + [button setFont:[NSFont fontWithName:@"LucidaGrande-Bold" size:14]]; [button setTitle:@"Launch Manually"]; [button sizeToFit]; [button setFrameSize:NSMakeSize([button frame].size.width + 8, 24)]; @@ -40,9 +41,10 @@ [bevelView setBevelDepth:10]; statusWindow = [ITIconAndTextStatusWindow sharedWindow]; [statusWindow setEntryEffect:[[ITCutWindowEffect alloc] initWithWindow:statusWindow]]; - [statusWindow setExitEffect:[[ITDissolveWindowEffect alloc] initWithWindow:statusWindow]]; + [statusWindow setExitEffect:[[ITCutWindowEffect alloc] initWithWindow:statusWindow]]; [[statusWindow entryEffect] setEffectTime:[swEntrySpeedSlider floatValue]]; [[statusWindow exitEffect] setEffectTime:[swExitSpeedSlider floatValue]]; + [self populateEffectPopups]; // [tabView setAllowsDragging:YES]; [[NSColorPanel sharedColorPanel] setShowsAlpha:YES]; @@ -152,6 +154,21 @@ #pragma mark ITTransientStatusWindow SUPPORT /*************************************************************************/ +- (void)populateEffectPopups +{ + NSArray *effects = [ITWindowEffect effectClasses]; + int i; + [entryEffectPopup removeAllItems]; + [exitEffectPopup removeAllItems]; + for (i = 0; i < [effects count]; i++) { + id anItem = [effects objectAtIndex:i]; + [entryEffectPopup addItemWithTitle:[anItem effectName]]; + [exitEffectPopup addItemWithTitle:[anItem effectName]]; + [[entryEffectPopup lastItem] setRepresentedObject:anItem]; + [[exitEffectPopup lastItem] setRepresentedObject:anItem]; + } +} + - (IBAction)buildStatusWindow:(id)sender { NSImage *image = [NSImage imageNamed:SW_IMAGE]; @@ -194,39 +211,12 @@ } else if ( [sender tag] == 3061 ) { [[statusWindow exitEffect] setEffectTime:[sender floatValue]]; } else if ( [sender tag] == 3070 ) { - - if ( [sender indexOfSelectedItem] == 0 ) { - [statusWindow setEntryEffect:[[[ITCutWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; - } else if ( [sender indexOfSelectedItem] == 1 ) { - [statusWindow setEntryEffect:[[[ITDissolveWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; - } else if ( [sender indexOfSelectedItem] == 2 ) { - [statusWindow setEntryEffect:[[[ITSlideVerticallyWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; - } else if ( [sender indexOfSelectedItem] == 3 ) { - [statusWindow setEntryEffect:[[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; - } else if ( [sender indexOfSelectedItem] == 4 ) { - [statusWindow setEntryEffect:[[[ITPivotWindowEffect alloc] initWithWindow:statusWindow] autorelease]]; - } - + [statusWindow setEntryEffect:[[[[[sender selectedItem] representedObject] alloc] initWithWindow:statusWindow] autorelease]]; [[statusWindow entryEffect] setEffectTime:[swEntrySpeedSlider floatValue]]; - } else if ( [sender tag] == 3080 ) { - - if ( [sender indexOfSelectedItem] == 0 ) { - [statusWindow setExitEffect:[[ITCutWindowEffect alloc] initWithWindow:statusWindow]]; - } else if ( [sender indexOfSelectedItem] == 1 ) { - [statusWindow setExitEffect:[[ITDissolveWindowEffect alloc] initWithWindow:statusWindow]]; - } else if ( [sender indexOfSelectedItem] == 2 ) { - [statusWindow setExitEffect:[[ITSlideVerticallyWindowEffect alloc] initWithWindow:statusWindow]]; - } else if ( [sender indexOfSelectedItem] == 3 ) { - [statusWindow setExitEffect:[[ITSlideHorizontallyWindowEffect alloc] initWithWindow:statusWindow]]; - } else if ( [sender indexOfSelectedItem] == 4 ) { - [statusWindow setExitEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]]; - } - + [statusWindow setExitEffect:[[[[[sender selectedItem] representedObject] alloc] initWithWindow:statusWindow] autorelease]]; [[statusWindow exitEffect] setEffectTime:[swExitSpeedSlider floatValue]]; - } else if ( [sender tag] == 3090 ) { - if ( [sender indexOfSelectedItem] == 0 ) { [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundMode:ITTSWBackgroundApple]; } else if ( [sender indexOfSelectedItem] == 1 ) { @@ -234,7 +224,6 @@ } else if ( [sender indexOfSelectedItem] == 2 ) { [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundMode:ITTSWBackgroundColored]; } - } else if ( [sender tag] == 3100 ) { [(ITTSWBackgroundView *)[statusWindow contentView] setBackgroundColor:[sender color]]; }