summaryrefslogtreecommitdiff
path: root/indra/llwindow/llopenglview-objc.mm
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-05-23 09:39:49 -0400
committerGeenz <geenz@geenzo.com>2013-05-23 09:39:49 -0400
commit7decac40e6453b2d8822d2677b9b59300bc260cf (patch)
tree4a7adfb0e7eeaf01167d0a8175f2170c8fab82d2 /indra/llwindow/llopenglview-objc.mm
parentcda10266ae91e28f2ac60b8472d6b8592f877d65 (diff)
Override NSPanel's close method to hide the window instead of actually removing the window.
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r--indra/llwindow/llopenglview-objc.mm25
1 files changed, 24 insertions, 1 deletions
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