Override NSPanel's close method to hide the window instead of actually removing the window.
parent
cda10266ae
commit
7decac40e6
|
|
@ -47,6 +47,10 @@
|
|||
|
||||
@end
|
||||
|
||||
@interface LLUserInputWindow : NSPanel
|
||||
|
||||
@end
|
||||
|
||||
@interface LLNonInlineTextView : NSTextView
|
||||
{
|
||||
LLOpenGLView *glview;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue