diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llopenglview-objc.h | 4 | ||||
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 25 |
2 files changed, 28 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index e20ea533fb..5309dea664 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -47,6 +47,10 @@ @end +@interface LLUserInputWindow : NSPanel + +@end + @interface LLNonInlineTextView : NSTextView { LLOpenGLView *glview; diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 8ef6d4e682..17e8c3e3cc 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -527,6 +527,15 @@ attributedStringInfo getSegments(NSAttributedString *str) @end +@implementation LLUserInputWindow + +- (void) close +{ + [self orderOut:self]; +} + +@end + @implementation LLNonInlineTextView - (void) setGLView:(LLOpenGLView *)view @@ -536,16 +545,30 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void) insertText:(id)insertString { + [[self inputContext] discardMarkedText]; + [self setString:@""]; + [_window orderOut:_window]; [self insertText:insertString replacementRange:NSMakeRange(0, 0)]; } - (void) insertText:(id)aString replacementRange:(NSRange)replacementRange { [glview insertText:aString replacementRange:replacementRange]; +} + +- (void) insertNewline:(id)sender +{ [[self textStorage] setValue:@""]; [[self inputContext] discardMarkedText]; [self setString:@""]; - [_window orderOut:_window]; +} + +- (void)doCommandBySelector:(SEL)aSelector +{ + if (aSelector == @selector(insertNewline:)) + { + [self insertNewline:self]; + } } @end |