Revision: 5449
http://skim-app.svn.sourceforge.net/skim-app/?rev=5449&view=rev
Author: hofman
Date: 2009-06-23 23:45:23 +0000 (Tue, 23 Jun 2009)
Log Message:
-----------
simplify sheet controller API, combine some private methods
Modified Paths:
--------------
trunk/SKSheetController.m
Modified: trunk/SKSheetController.m
===================================================================
--- trunk/SKSheetController.m 2009-06-23 23:15:24 UTC (rev 5448)
+++ trunk/SKSheetController.m 2009-06-23 23:45:23 UTC (rev 5449)
@@ -42,9 +42,15 @@
@implementation SKSheetController
+- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo {
+ NSInvocation *invocation = [(NSInvocation *)contextInfo autorelease];
+ if (invocation) {
+ [invocation setArgument:&returnCode atIndex:3];
+ [invocation invoke];
+ }
+}
+
- (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)delegate
didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo {
- [self prepare];
-
NSInvocation *invocation = nil;
if (delegate != nil && didEndSelector != NULL) {
invocation = [NSInvocation invocationWithTarget:delegate
selector:didEndSelector argument:&self];
@@ -60,24 +66,10 @@
contextInfo:[invocation retain]];
}
-- (void)prepare {}
-
- (IBAction)dismiss:(id)sender {
- [self endSheetWithReturnCode:[sender tag]];
+ [NSApp endSheet:[self window] returnCode:[sender tag]];
+ [[self window] orderOut:self];
[self release];
}
-- (void)didEndSheet:(NSWindow *)sheet returnCode:(NSInteger)returnCode
contextInfo:(void *)contextInfo {
- NSInvocation *invocation = [(NSInvocation *)contextInfo autorelease];
- if (invocation) {
- [invocation setArgument:&returnCode atIndex:3];
- [invocation invoke];
- }
-}
-
-- (void)endSheetWithReturnCode:(NSInteger)returnCode {
- [NSApp endSheet:[self window] returnCode:returnCode];
- [[self window] orderOut:self];
-}
-
@end
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit