diff options
author | Geenz <geenz@geenzo.com> | 2013-05-23 09:39:49 -0400 |
---|---|---|
committer | Geenz <geenz@geenzo.com> | 2013-05-23 09:39:49 -0400 |
commit | 7decac40e6453b2d8822d2677b9b59300bc260cf (patch) | |
tree | 4a7adfb0e7eeaf01167d0a8175f2170c8fab82d2 | |
parent | cda10266ae91e28f2ac60b8472d6b8592f877d65 (diff) |
Override NSPanel's close method to hide the window instead of actually removing the window.
-rw-r--r-- | indra/llwindow/llopenglview-objc.h | 4 | ||||
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 25 | ||||
-rw-r--r-- | indra/newview/SecondLife.nib | bin | 13009 -> 13021 bytes | |||
-rw-r--r-- | indra/newview/SecondLife.xib | 14 |
4 files changed, 35 insertions, 8 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 diff --git a/indra/newview/SecondLife.nib b/indra/newview/SecondLife.nib Binary files differindex cb289ebf09..a5f2717167 100644 --- a/indra/newview/SecondLife.nib +++ b/indra/newview/SecondLife.nib diff --git a/indra/newview/SecondLife.xib b/indra/newview/SecondLife.xib index c6b72485a1..e5736f76a4 100644 --- a/indra/newview/SecondLife.xib +++ b/indra/newview/SecondLife.xib @@ -2,7 +2,7 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00"> <data> <int key="IBDocument.SystemTarget">1060</int> - <string key="IBDocument.SystemVersion">12E30</string> + <string key="IBDocument.SystemVersion">12E52</string> <string key="IBDocument.InterfaceBuilderVersion">3084</string> <string key="IBDocument.AppKitVersion">1187.39</string> <string key="IBDocument.HIToolboxVersion">626.00</string> @@ -335,7 +335,7 @@ <string key="NSFrameSize">{1024, 600}</string> <string key="NSReuseIdentifierKey">_NS:20</string> </object> - <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> + <string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string> <string key="NSFrameAutosaveName">Second Life</string> <int key="NSWindowCollectionBehavior">128</int> @@ -347,7 +347,7 @@ <string key="NSWindowRect">{{272, 176}, {938, 42}}</string> <int key="NSWTFlags">-1535638528</int> <string key="NSWindowTitle">Input Window</string> - <string key="NSWindowClass">NSPanel</string> + <string key="NSWindowClass">LLUserInputWindow</string> <nil key="NSViewClass"/> <nil key="NSUserInterfaceItemIdentifier"/> <object class="NSView" key="NSWindowView" id="1044753903"> @@ -533,7 +533,7 @@ <reference key="NSNextKeyView" ref="238626476"/> <string key="NSReuseIdentifierKey">_NS:21</string> </object> - <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> + <string key="NSScreenRect">{{0, 0}, {2560, 1440}}</string> <string key="NSMaxSize">{10000000000000, 10000000000000}</string> <bool key="NSWindowIsRestorable">YES</bool> </object> @@ -1180,11 +1180,11 @@ </object> </object> <object class="IBPartialClassDescription"> - <string key="className">NSLayoutConstraint</string> - <string key="superclassName">NSObject</string> + <string key="className">LLUserInputWindow</string> + <string key="superclassName">NSPanel</string> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/NSLayoutConstraint.h</string> + <string key="minorKey">./Classes/LLUserInputWindow.h</string> </object> </object> </array> |