From e6521636f519371a9e5d65a3fd59d0e87dd392f9 Mon Sep 17 00:00:00 2001 From: wcray Date: Mon, 19 Aug 2013 15:29:05 -0400 Subject: [PATCH] Added displayDialog withTitle withOK withNOK to provide both "OK" and "Cancel" buttons in modal dialog New displayDialog function - same as old, only allows filling defaultButton and alternateButton txt fields. --- src/JSTExtras.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/JSTExtras.m b/src/JSTExtras.m index a0d19fe..03df5c2 100644 --- a/src/JSTExtras.m +++ b/src/JSTExtras.m @@ -132,6 +132,17 @@ - (void)activate { SetFrontProcess( &xpsn ); } + +- (NSInteger) displayDialog:(NSString*)msg withTitle:(NSString*)title withOK:(NSString*)oktxt withNOK:(NSString*)noktxt { + + NSAlert *alert = [NSAlert alertWithMessageText:title defaultButton:oktxt alternateButton:noktxt otherButton:nil informativeTextWithFormat:@"%@", msg]; + + NSInteger button = [alert runModal]; + + return button; +} + + - (NSInteger)displayDialog:(NSString*)msg withTitle:(NSString*) title { NSAlert *alert = [NSAlert alertWithMessageText:title defaultButton:nil alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@", msg];