Skip to content

Commit

Permalink
Plug-in conversion of the Dialog 2 testing framework. This should com…
Browse files Browse the repository at this point in the history
…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
ciaran committed Nov 20, 2007
1 parent 13a1f39 commit 0a9875c
Show file tree
Hide file tree
Showing 35 changed files with 3,095 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Commands/ExtendedPopUp/IncrementalPopUpMenu.nib/classes.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Commands/ExtendedPopUp/IncrementalPopUpMenu.nib/info.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
16 changes: 16 additions & 0 deletions Commands/ExtendedPopUp/TMDBorderLessWindow.h
@@ -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
54 changes: 54 additions & 0 deletions Commands/ExtendedPopUp/TMDBorderLessWindow.m
@@ -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
47 changes: 47 additions & 0 deletions Commands/ExtendedPopUp/TMDIncrementalPopUpMenu.h
@@ -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

0 comments on commit 0a9875c

Please sign in to comment.