// // PanelController.m // Perforce // // Created by Adam Czubernat on 11.07.2013. // Copyright (c) 2013 Perforce Software, Inc. All rights reserved. // #import "PanelController.h" @implementation PanelController { __strong id retain; } @synthesize parentWindow; - (id)init { return self = [super initWithWindowNibName:NSStringFromClass([self class])]; } - (void)windowDidLoad { [super windowDidLoad]; [self.window setPreventsApplicationTerminationWhenModal:NO]; } - (void)presentWithWindow:(NSWindow *)window { parentWindow = window; retain = self; while ([window attachedSheet]) window = [window attachedSheet]; // Traverse through sheets [[NSApplication sharedApplication] beginSheet:self.window modalForWindow:window modalDelegate:nil didEndSelector:nil contextInfo:NULL]; } - (void)dismiss { [[NSApplication sharedApplication] endSheet:self.window]; [self close]; retain = nil; } - (void)setPresentedView:(NSView *)view { [self setPresentedView:view animated:NO]; } - (void)setPresentedView:(NSView *)view animated:(BOOL)animated { [presentedView removeFromSuperview]; presentedView = view; [self.window.contentView setFrame:view.bounds]; [self.window setFrame:view.bounds display:YES animate:animated]; [self.window.contentView addSubview:view]; } - (void)dismissAfter:(NSTimeInterval)delay { [self performSelector:@selector(dismiss) withObject:nil afterDelay:delay]; } - (void)presentExclusiveWithWindow:(NSWindow *)window { NSWindow *attachedSheet = [window attachedSheet]; if (attachedSheet) { [[NSApplication sharedApplication] endSheet:attachedSheet]; [attachedSheet close]; } [self presentWithWindow:window]; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 16817 | christoph_leithner | "Forking branch Main of perforce-software-piper to christoph_leithner-piper." | ||
//guest/perforce_software/piper/main/mac/R1.0/Perforce/Classes/WindowControllers/PanelController.m | |||||
#1 | 16507 | perforce_software | Move to main branch. | ||
//guest/perforce_software/piper/mac/R1.0/Perforce/Classes/WindowControllers/PanelController.m | |||||
#1 | 11254 | alan_petersen |
Populate //guest/perforce_software/piper/mac/R1.0/... from //guest/perforce_software/piper/mac/main/.... |
||
//guest/perforce_software/piper/mac/main/Perforce/Classes/WindowControllers/PanelController.m | |||||
#1 | 11252 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/mac/Perforce/Classes/WindowControllers/PanelController.m | |||||
#1 | 10744 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/Perforce/Classes/WindowControllers/PanelController.m | |||||
#1 | 8919 | Matt Attaway | Initial add of Piper, a lightweight Perforce client for artists and designers. |