Marked text field is hidden whenever window loses focus

git-svn-id: http://macvim.googlecode.com/svn/trunk@212 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-08-29 12:03:22 +00:00
parent 0616ef9225
commit 290847c707
3 changed files with 13 additions and 10 deletions
+1
View File
@@ -32,5 +32,6 @@
- (void)setShouldDrawInsertionPoint:(BOOL)on;
- (void)drawInsertionPointAtRow:(int)row column:(int)col shape:(int)shape
fraction:(int)percent color:(NSColor *)color;
- (void)hideMarkedTextField;
@end
+9 -10
View File
@@ -34,7 +34,6 @@ static float MMDragAreaSize = 73.0f;
- (MMVimController *)vimController;
- (void)startDragTimerWithInterval:(NSTimeInterval)t;
- (void)dragTimerFired:(NSTimer *)timer;
- (void)hideMarkedTextField;
- (void)sendKeyDown:(const char *)chars length:(int)len modifiers:(int)flags;
@end
@@ -90,6 +89,15 @@ static float MMDragAreaSize = 73.0f;
[self setInsertionPointColor:color];
}
- (void)hideMarkedTextField
{
if (markedTextField) {
NSWindow *win = [markedTextField window];
[win close];
[markedTextField setStringValue:@""];
}
}
- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];
@@ -883,15 +891,6 @@ static float MMDragAreaSize = 73.0f;
++tick;
}
- (void)hideMarkedTextField
{
if (markedTextField) {
NSWindow *win = [markedTextField window];
[win close];
[markedTextField setStringValue:@""];
}
}
- (void)sendKeyDown:(const char *)chars length:(int)len modifiers:(int)flags
{
if (chars && len > 0) {
+3
View File
@@ -627,6 +627,9 @@ NSMutableArray *buildMenuAddress(NSMenu *menu)
- (void)windowDidResignMain:(NSNotification *)notification
{
[vimController sendMessage:LostFocusMsgID data:nil wait:NO];
if (textView)
[textView hideMarkedTextField];
}
- (BOOL)windowShouldClose:(id)sender