X-Git-Url: http://git.ithinksw.org/ITKit.git/blobdiff_plain/78553c25bacdbd190fd14591420cf4f7fa578617..079b33aed3d1c849f1f46022040813d6394100f2:/Showcase/Controller.m diff --git a/Showcase/Controller.m b/Showcase/Controller.m index 8998a38..1a9eab2 100755 --- a/Showcase/Controller.m +++ b/Showcase/Controller.m @@ -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 @@ -20,6 +21,7 @@ { [self createStatusItem]; [testTextField setCastsShadow:YES]; + [tabView setAllowsDragging:YES]; statusWindow = [ITTransientStatusWindow sharedWindow]; // [tabView setAllowsDragging:YES]; } @@ -186,6 +188,8 @@ textWidth, textHeight); textField = [[[ITTextField alloc] initWithFrame:textRect] autorelease]; + [textField setEditable:NO]; + [textField setSelectable:NO]; [textField setBordered:NO]; [textField setDrawsBackground:NO]; [textField setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:18]]; @@ -195,61 +199,75 @@ [[statusWindow contentView] addSubview:textField]; [[statusWindow contentView] setNeedsDisplay:YES]; -} - -/* -- (IBAction)foo:(id)sender -{ - - maxLineHeight = ( ( maxLineHeight > [cdImage size].height ) ? maxLineHeight : [cdImage size].height ); - - totalWidth = ( ITTSWPADDING + [cdImage size].width + ITTSWSPACING + maxLineWidth + ITTSWPADDING ); - totalHeight = ( ITTSWPADDING + maxLineHeight + ITTSWPADDING ); - - totalWidth = ( ( totalWidth > ITTSWMINW ) ? totalWidth : ITTSWMINW ); - - - [statusWindow setFrame:NSMakeRect(72.0, 72.0, totalWidth, totalHeight) - display:YES]; - - textField = [[[ITTextField alloc] initWithFrame: - NSMakeRect((24.0 + [cdImage size].width + 32.0), 24.0, maxLineWidth, maxLineHeight)] autorelease]; - [[statusWindow contentView] addSubview:textField]; - [textField setBordered:NO]; - [textField setDrawsBackground:NO]; - [textField setFont:[NSFont fontWithName:@"Lucida Grande Bold" size:18]]; - [textField setTextColor:[NSColor whiteColor]]; - [textField setCastsShadow:YES]; - [textField setStringValue:text]; - - [[statusWindow contentView] lockFocus]; - [cdImage compositeToPoint:NSMakePoint(ITTSWPADDING, ( ITTSWPADDING + ((maxLineHeight - [cdImage size].height) / ITTSWPADDING)) ) - operation:NSCompositeSourceOver]; - [[statusWindow contentView] unlockFocus]; + [statusWindow setEntryEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]]; + [statusWindow setExitEffect:[[ITPivotWindowEffect alloc] initWithWindow:statusWindow]]; } -*/ - (IBAction)showStatusWindow:(id)sender { -// [[statusWindow contentView] setNeedsDisplay:YES]; + [[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 appear:self]; +/* [statusWindow setFrame:NSMakeRect( SW_BORDER, SW_BORDER, NSWidth([statusWindow frame]), NSHeight([statusWindow frame]) ) display:YES animate:YES]; +*/ } - (IBAction)hideStatusWindow:(id)sender { - [statusWindow orderOut:self]; + [statusWindow vanish:self]; +} + +- (IBAction)setRotation:(id)sender +{ + NSLog(@"no longer supported"); +} + +/*************************************************************************/ +#pragma mark - +#pragma mark ITTabView SUPPORT +/*************************************************************************/ + +- (IBAction)toggleTabDragging:(id)sender +{ + if ([sender state] == NSOnState) { + [tabView setAllowsDragging:YES]; + } else { + [tabView setAllowsDragging:NO]; + } +} + +- (IBAction)toggleCommandDragging:(id)sender +{ + if ([sender state] == NSOnState) { + [tabView setRequiredModifiers:NSCommandKeyMask]; + } else { + [tabView setRequiredModifiers:0]; + } +} + +- (IBAction)toggleControlDragging:(id)sender +{ +} + +- (IBAction)toggleOptionDragging:(id)sender +{ +} + +- (IBAction)toggleShiftDragging:(id)sender +{ } /*************************************************************************/