Permalink
Browse files

Plug-in conversion of the Dialog 2 testing framework. This should com…

…pile and accept commands, e.g.

echo '{ menuItems = ({title = 'foo';});}' | "$DIALOG" menu

Note: currently I’ve set it up to hijack the $DIALOG environment variable, this has been working fine for me but I’m not sure if it’s a long-term solution (is the plug-in load order consistent?).
When tm_dialog2 is called it checks the first character of the argument list, and if it’s a ‘-’ then it replaces itself with the corresponding call to tm_dialog



git-svn-id: http://svn.textmate.org/branches/WIP/Tools/Dialog2@8484 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 13a1f39 commit 0a9875c6d4e801729b186c137947f8ae4f79bb43 ciaran committed Nov 20, 2007

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,16 @@
+//
+// TMDBorderLessWindow.h
+// Dialog
+//
+// Created by Joachim Mårtensson on 2007-08-14.
+// Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+@interface TMDBorderLessWindow : NSWindow {
+
+}
+- (BOOL)canBecomeMainWindow;
+@end
@@ -0,0 +1,54 @@
+//
+// TMDBorderLessWindow.m
+// Dialog
+//
+// Created by Joachim Mårtensson on 2007-08-14.
+// Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import "TMDBorderLessWindow.h"
+
+
+@implementation TMDBorderLessWindow
+
+- (id)initWithContentRect:(NSRect)contentRect
+ styleMask:(unsigned int)aStyle
+ backing:(NSBackingStoreType)bufferingType
+ defer:(BOOL)flag
+{
+ self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:NO];
+
+// [result setBackgroundColor:[NSColor clearColor]];
+ [self setAlphaValue:0];
+ [self setHasShadow:YES];
+ [self setOpaque:NO];
+//[self makeKeyWindow];
+ return self;
+}
+
+- (BOOL)canBecomeMainWindow
+{
+ return YES;
+}
+
+- (BOOL) canBecomeKeyWindow
+{
+ return YES;
+}
+
+-(BOOL)acceptsFirstResponder
+{
+ return YES;
+}
+
+- (BOOL)showsResizeIndicator
+{
+ return NO;
+}
+
+-(BOOL)resignFirstResponder
+{
+ return NO;
+}
+
+@end
@@ -0,0 +1,47 @@
+//
+// TMDIncrementalPopUpMenu.h
+//
+// Created by Joachim MŒrtensson on 2007-08-10.
+// Copyright (c) 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#define MAX_ROWS 15
+
+@interface TMDIncrementalPopUpMenu : NSWindowController
+{
+ IBOutlet NSArrayController* anArrayController;
+ NSArray* suggestions;
+ NSMutableString* mutablePrefix;
+ NSString* staticPrefix;
+ NSArray* filtered;
+ NSString* shell;
+ NSMutableAttributedString* attrString;
+ IBOutlet id theTableView;
+ float stringWidth;
+ NSPoint caretPos;
+ BOOL isAbove;
+ NSRect mainScreen;
+ BOOL closeMe;
+ id ed;
+ id controllerObject;
+}
+- (id)initWithDictionary:(NSDictionary*)aDictionary
+ andEditor:(id)editor;
+- (void)filter;
+- (NSMutableString*)mutablePrefix;
+- (id)theTableView;
+- (void)keyDown:(NSEvent*)anEvent;
+- (void)tab;
+- (int)stringWidth;
+- (void)writeToTM:(NSString*)aString asSnippet:(BOOL)snippet;
+- (NSString*)executeShellCommand:(NSString*)command WithDictionary:(NSDictionary*)dict;
+- (NSArray*)filtered;
+- (void)setFiltered:(NSArray*)aValue;
+- (void)setCaretPos:(NSPoint)aPos;
+- (void)setMainScreen:(NSRect)aScreen;
+- (void)setAbove:(BOOL)aBool;
+- (void)completeAndInsertSnippet:(id)nothing;
+- (BOOL)getCloseStatus;
+
+@end
Oops, something went wrong.

0 comments on commit 0a9875c

Please sign in to comment.