mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 13:10:52 +00:00
Documentation tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14760 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d73d397164
commit
92867e201f
3 changed files with 31 additions and 21 deletions
|
@ -122,9 +122,13 @@
|
|||
return _layoutManager;
|
||||
}
|
||||
|
||||
- (void) replaceLayoutManager: (NSLayoutManager *)newLayoutManager
|
||||
/**
|
||||
* Replaces the layout manager while maintaining the text object
|
||||
* framework intact.
|
||||
*/
|
||||
- (void) replaceLayoutManager: (NSLayoutManager*)aLayoutManager
|
||||
{
|
||||
if (newLayoutManager != _layoutManager)
|
||||
if (aLayoutManager != _layoutManager)
|
||||
{
|
||||
id textStorage = [_layoutManager textStorage];
|
||||
NSArray *textContainers = [_layoutManager textContainers];
|
||||
|
@ -133,7 +137,7 @@
|
|||
|
||||
RETAIN (oldLayoutManager);
|
||||
[textStorage removeLayoutManager: _layoutManager];
|
||||
[textStorage addLayoutManager: newLayoutManager];
|
||||
[textStorage addLayoutManager: aLayoutManager];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
|
@ -141,7 +145,7 @@
|
|||
|
||||
container = RETAIN ([textContainers objectAtIndex: i]);
|
||||
[_layoutManager removeTextContainerAtIndex: i];
|
||||
[newLayoutManager addTextContainer: container];
|
||||
[aLayoutManager addTextContainer: container];
|
||||
/* The textview is caching the layout manager; refresh the
|
||||
* cache with this do-nothing call. */
|
||||
[[container textView] setTextContainer: container];
|
||||
|
|
|
@ -551,9 +551,9 @@ static Class textFieldCellClass;
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) textShouldEndEditing: (NSText *)aTextObject
|
||||
- (BOOL) textShouldEndEditing: (NSText*)textObject
|
||||
{
|
||||
if ([_cell isEntryAcceptable: [aTextObject text]] == NO)
|
||||
if ([_cell isEntryAcceptable: [textObject text]] == NO)
|
||||
{
|
||||
[self sendAction: _error_action to: [self target]];
|
||||
return NO;
|
||||
|
@ -562,16 +562,14 @@ static Class textFieldCellClass;
|
|||
if ([_delegate respondsToSelector:
|
||||
@selector(control:textShouldEndEditing:)])
|
||||
{
|
||||
if ([_delegate control: self
|
||||
textShouldEndEditing: aTextObject] == NO)
|
||||
if ([_delegate control: self textShouldEndEditing: textObject] == NO)
|
||||
{
|
||||
NSBeep ();
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(control:isValidObject:)] == YES)
|
||||
if ([_delegate respondsToSelector: @selector(control:isValidObject:)] == YES)
|
||||
{
|
||||
NSFormatter *formatter;
|
||||
id newObjectValue;
|
||||
|
@ -579,12 +577,13 @@ static Class textFieldCellClass;
|
|||
formatter = [_cell formatter];
|
||||
|
||||
if ([formatter getObjectValue: &newObjectValue
|
||||
forString: [_text_object text]
|
||||
errorDescription: NULL] == YES)
|
||||
forString: [_text_object text]
|
||||
errorDescription: NULL] == YES)
|
||||
{
|
||||
if ([_delegate control: self
|
||||
isValidObject: newObjectValue] == NO)
|
||||
return NO;
|
||||
if ([_delegate control: self isValidObject: newObjectValue] == NO)
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -262,14 +262,18 @@ static NSNotificationCenter *nc = nil;
|
|||
return _editedDelta;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set/get the delegate
|
||||
/**
|
||||
* Set the delegate (adds it as an observer for text storage notifications)
|
||||
* and removes any old value (removes it as an observer).<br />
|
||||
* The delegate is <em>not</em> retained.
|
||||
*/
|
||||
- (void) setDelegate: (id)anObject
|
||||
- (void) setDelegate: (id)delegate
|
||||
{
|
||||
if (_delegate)
|
||||
[nc removeObserver: _delegate name: nil object: self];
|
||||
_delegate = anObject;
|
||||
if (_delegate != nil)
|
||||
{
|
||||
[nc removeObserver: _delegate name: nil object: self];
|
||||
}
|
||||
_delegate = delegate;
|
||||
|
||||
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
||||
if ([_delegate respondsToSelector: @selector(textStorage##notif_name:)]) \
|
||||
|
@ -281,6 +285,9 @@ static NSNotificationCenter *nc = nil;
|
|||
SET_DELEGATE_NOTIFICATION(WillProcessEditing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value most recently set usiong the -setDelegate: method.
|
||||
*/
|
||||
- (id) delegate
|
||||
{
|
||||
return _delegate;
|
||||
|
|
Loading…
Reference in a new issue