mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 06:00:48 +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;
|
turnedOn: (BOOL)flag;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/* TODO: Remove */
|
||||||
// not the same as NSMakeRange!
|
// not the same as NSMakeRange!
|
||||||
static inline
|
static inline
|
||||||
NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
||||||
|
@ -593,8 +594,7 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
||||||
return [_typingAttributes objectForKey: NSForegroundColorAttributeName];
|
return [_typingAttributes objectForKey: NSForegroundColorAttributeName];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setTextColor: (NSColor*) color
|
- (void) setTextColor: (NSColor*)color range: (NSRange)aRange
|
||||||
range: (NSRange) aRange
|
|
||||||
{
|
{
|
||||||
if (aRange.location == NSNotFound)
|
if (aRange.location == NSNotFound)
|
||||||
return;
|
return;
|
||||||
|
@ -619,13 +619,12 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
||||||
[self didChangeText];
|
[self didChangeText];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setColor: (NSColor*) color
|
- (void) setColor: (NSColor*)color ofRange: (NSRange)aRange
|
||||||
ofRange: (NSRange) aRange
|
|
||||||
{
|
{
|
||||||
[self setTextColor: color range: aRange];
|
[self setTextColor: color range: aRange];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setTextColor: (NSColor*) color
|
- (void) setTextColor: (NSColor*)color
|
||||||
{
|
{
|
||||||
NSRange fullRange = NSMakeRange (0, [self textLength]);
|
NSRange fullRange = NSMakeRange (0, [self textLength]);
|
||||||
|
|
||||||
|
@ -935,22 +934,9 @@ NSRange MakeRangeFromAbs (unsigned a1, unsigned a2)
|
||||||
return _delegate;
|
return _delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setDelegate: (id) anObject
|
- (void) setDelegate: (id)anObject
|
||||||
{
|
{
|
||||||
if (_delegate)
|
_delegate = anObject;
|
||||||
[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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue