mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:30:37 +00:00
Removed most delegate code now handled by NSTextView
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8381 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7427870911
commit
6ab26e6943
1 changed files with 6 additions and 20 deletions
|
@ -92,6 +92,7 @@ static Class concrete;
|
|||
turnedOn: (BOOL)flag;
|
||||
@end
|
||||
|
||||
/* TODO: Remove */
|
||||
// not the same as NSMakeRange!
|
||||
static inline
|
||||
NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
||||
|
@ -593,8 +594,7 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
|||
return [_typingAttributes objectForKey: NSForegroundColorAttributeName];
|
||||
}
|
||||
|
||||
- (void) setTextColor: (NSColor*) color
|
||||
range: (NSRange) aRange
|
||||
- (void) setTextColor: (NSColor*)color range: (NSRange)aRange
|
||||
{
|
||||
if (aRange.location == NSNotFound)
|
||||
return;
|
||||
|
@ -619,13 +619,12 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
|||
[self didChangeText];
|
||||
}
|
||||
|
||||
- (void) setColor: (NSColor*) color
|
||||
ofRange: (NSRange) aRange
|
||||
- (void) setColor: (NSColor*)color ofRange: (NSRange)aRange
|
||||
{
|
||||
[self setTextColor: color range: aRange];
|
||||
}
|
||||
|
||||
- (void) setTextColor: (NSColor*) color
|
||||
- (void) setTextColor: (NSColor*)color
|
||||
{
|
||||
NSRange fullRange = NSMakeRange (0, [self textLength]);
|
||||
|
||||
|
@ -935,22 +934,9 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
|||
return _delegate;
|
||||
}
|
||||
|
||||
- (void) setDelegate: (id) anObject
|
||||
- (void) setDelegate: (id)anObject
|
||||
{
|
||||
if (_delegate)
|
||||
[nc removeObserver: _delegate name: nil object: self];
|
||||
ASSIGN(_delegate, anObject);
|
||||
|
||||
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
||||
if ([_delegate respondsToSelector: @selector(text##notif_name:)]) \
|
||||
[nc addObserver: _delegate \
|
||||
selector: @selector(text##notif_name:) \
|
||||
name: NSText##notif_name##Notification \
|
||||
object: self]
|
||||
|
||||
SET_DELEGATE_NOTIFICATION(DidBeginEditing);
|
||||
SET_DELEGATE_NOTIFICATION(DidChange);
|
||||
SET_DELEGATE_NOTIFICATION(DidEndEditing);
|
||||
_delegate = anObject;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue