Call the deprecated OpenStep delegate methods if the delegate of a

text attachment does not implement the new Mac OS X methods.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@31816 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2011-01-01 16:56:12 +00:00
parent f29e316d4e
commit 6014a699ab
2 changed files with 46 additions and 18 deletions

View file

@ -1,3 +1,9 @@
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextAttachment.m (-trackMouse:inRect:ofView:...): Call
the deprecated OpenStep delegate methods if the delegate does not
implement the new Mac OS X methods.
2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com> 2011-01-01 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView.m (-mouseDown:): Add missing conversion from * Source/NSTextView.m (-mouseDown:): Add missing conversion from

View file

@ -167,27 +167,49 @@
{ {
if ([theEvent clickCount] == 2) if ([theEvent clickCount] == 2)
{ {
if (delegate != nil && [delegate respondsToSelector: if (delegate != nil)
@selector(textView:doubleClickedOnCell:inRect:atIndex:)]) {
{ if ([delegate respondsToSelector:
[delegate textView: textView @selector(textView:doubleClickedOnCell:inRect:atIndex:)])
doubleClickedOnCell: self {
inRect: cellFrame [delegate textView: textView
atIndex: charIndex]; doubleClickedOnCell: self
return YES; inRect: cellFrame
} atIndex: charIndex];
return YES;
}
else if ([delegate respondsToSelector:
@selector(textView:doubleClickedOnCell:inRect:)])
{
[delegate textView: textView
doubleClickedOnCell: self
inRect: cellFrame];
return YES;
}
}
} }
else else
{ {
if (delegate != nil && [delegate respondsToSelector: if (delegate != nil)
@selector(textView:clickedOnCell:inRect:atIndex:)]) {
{ if ([delegate respondsToSelector:
[delegate textView: textView @selector(textView:clickedOnCell:inRect:atIndex:)])
clickedOnCell: self {
inRect: cellFrame [delegate textView: textView
atIndex: charIndex]; clickedOnCell: self
return YES; inRect: cellFrame
} atIndex: charIndex];
return YES;
}
else if ([delegate respondsToSelector:
@selector(textView:clickedOnCell:inRect:)])
{
[delegate textView: textView
clickedOnCell: self
inRect: cellFrame];
return YES;
}
}
} }
} }
else if (type == NSLeftMouseDragged) else if (type == NSLeftMouseDragged)