Adding a better cancel job to the Pivot effect. Also redoing the showcase interface...
[ITKit.git] / Showcase / Controller.m
index d7808c7..16b5c0b 100755 (executable)
@@ -1,6 +1,7 @@
 #import "Controller.h"
 #import "ITTransientStatusWindow.h"
 #import "ITTextField.h"
+#import "ITPivotWindowEffect.h"
 
 #define SW_PAD    24.0
 #define SW_SPACE  24.0
     [[statusWindow contentView] addSubview:textField];
 
     [[statusWindow contentView] setNeedsDisplay:YES];
-}
 
-- (IBAction)showStatusWindow:(id)sender
-{
-//    [[statusWindow contentView] setNeedsDisplay:YES];
-    [statusWindow setFrame:NSMakeRect( (0.0 - NSWidth([statusWindow frame])),
-                                       SW_BORDER,
-                                       NSWidth([statusWindow frame]),
-                                       NSHeight([statusWindow frame]) )
-                   display:YES];
-    [statusWindow orderFront:self];
-    [statusWindow setFrame:NSMakeRect( SW_BORDER,
-                                       SW_BORDER,
-                                       NSWidth([statusWindow frame]),
-                                       NSHeight([statusWindow frame]) )
-                   display:YES
-                   animate:YES];
+    [statusWindow setEntryEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]];
+    [statusWindow setExitEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]];
 }
 
-- (IBAction)hideStatusWindow:(id)sender
+- (IBAction)toggleStatusWindow:(id)sender
 {
-    [statusWindow orderOut:self];
+    if ( ([statusWindow visibilityState] == ITTransientStatusWindowHiddenState) ||
+         ([statusWindow visibilityState] == ITTransientStatusWindowVanishingState) ) {
+        [[statusWindow contentView] setNeedsDisplay:YES];
+        [statusWindow appear:self];
+    } else {
+        [statusWindow vanish:self];
+    }
 }
 
-- (IBAction)setRotation:(id)sender
+- (IBAction)changeWindowSetting:(id)sender
 {
-    [statusWindow setRotation:([sender floatValue] * (pi / 180))];
+    switch ( [sender tag] )
+    {
+        case 3010:  // Not yet supported.
+            break;
+        case 3020:  // Not yet supported.
+            break;
+        case 3030:  // Change vanish delay
+            [statusWindow setExitDelay:[sender floatValue]];
+            break;
+        case 3040:  // Change vertical position
+            [statusWindow setVerticalPosition:[sender indexOfSelectedItem]];
+            break;
+        case 3050:  // Change horizontal position
+            [statusWindow setHorizontalPosition:[sender indexOfSelectedItem]];
+            break;
+        case 3060:  // Change effect speed
+            [[statusWindow entryEffect] setEffectTime:[sender floatValue]];
+            [[statusWindow exitEffect]  setEffectTime:[sender floatValue]];
+            break;
+        case 3070:  // Change entry effect
+            break;
+        case 3080:  // Change exit effect
+            break;
+    }
 }
 
+
 /*************************************************************************/
 #pragma mark -
-#pragma mark ITTransientStatusWindow SUPPORT
+#pragma mark ITTabView SUPPORT
 /*************************************************************************/
 
 - (IBAction)toggleTabDragging:(id)sender
 {
 }
 
+
 /*************************************************************************/
 #pragma mark -
 #pragma mark NSWindow DELEGATE METHODS