mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:50:48 +00:00
Thu Feb 18 1999 Felipe A. Rodriguez <farz@mindspring.com>
* NSView.m display: fix for display bug in buttons example * NSCell.m endEditing: fix for display bug in buttons example * NSTextField.m textShouldEndEditing: The changes to these three classes fix a display bug visible in the buttons example when the top text field is selected for editing and then asked to resign when the user clicks on say the bottom text field. This causes a rect encompassing both views to be invalidated and displayed. Beyond being inefficient this also causes a display glitch given the current drawing methodology. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3755 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eda323eadd
commit
a06e5954ac
4 changed files with 54 additions and 18 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
Thu Feb 18 1999 Felipe A. Rodriguez <farz@mindspring.com>
|
||||||
|
|
||||||
|
* NSView.m display: fix for display bug in buttons example
|
||||||
|
* NSCell.m endEditing: fix for display bug in buttons example
|
||||||
|
* NSTextField.m textShouldEndEditing: The changes to these three classes
|
||||||
|
fix a display bug visible in the buttons example when the top text field is
|
||||||
|
selected for editing and then asked to resign when the user clicks on say
|
||||||
|
the bottom text field. This causes a rect encompassing both views to be
|
||||||
|
invalidated and displayed. Beyond being inefficient this also causes a
|
||||||
|
display glitch given the current drawing methodology.
|
||||||
|
|
||||||
Wed Feb 17 11:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Wed Feb 17 11:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSView.m: Tidyup - visibleRect is empty if we have no window.
|
* Source/NSView.m: Tidyup - visibleRect is empty if we have no window.
|
||||||
|
|
|
@ -339,16 +339,12 @@ NSString* number_string = [[NSNumber numberWithInt:anInt] stringValue];
|
||||||
[controlView unlockFocus];
|
[controlView unlockFocus];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
- (void)endEditing:(NSText *)textObject // editing is complete,
|
||||||
* editing is complete, remove the text obj acting as the field
|
{ // remove the text obj
|
||||||
* editor from window's view heirarchy, set our contents from it
|
[textObject setDelegate:nil]; // acting as the field
|
||||||
*/
|
[textObject removeFromSuperview]; // editor from window'
|
||||||
- (void)endEditing:(NSText *)textObject
|
[self setStringValue: [textObject text]]; // view heirarchy, set
|
||||||
{
|
} // our contents from it
|
||||||
[textObject setDelegate:nil];
|
|
||||||
[textObject removeFromSuperview];
|
|
||||||
[self setStringValue: [textObject text]];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)selectWithFrame:(NSRect)aRect
|
- (void)selectWithFrame:(NSRect)aRect
|
||||||
inView:(NSView *)controlView
|
inView:(NSView *)controlView
|
||||||
|
|
|
@ -384,8 +384,28 @@ id nextResponder;
|
||||||
|
|
||||||
- (BOOL)textShouldEndEditing:(NSText *)aTextObject // NSText(field editor)
|
- (BOOL)textShouldEndEditing:(NSText *)aTextObject // NSText(field editor)
|
||||||
{ // delegate method
|
{ // delegate method
|
||||||
[cell endEditing:aTextObject];
|
if([cell isEntryAcceptable: [aTextObject text]])
|
||||||
fprintf(stderr, " TextField textShouldEndEditing --- ");
|
{
|
||||||
|
// if([delegate respondsTo:control:textShouldEndEditing:]) // FIX ME
|
||||||
|
// {
|
||||||
|
// if(![delegate control:textShouldEndEditing:])
|
||||||
|
// {
|
||||||
|
// NSBeep();
|
||||||
|
// return NO;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// return YES;
|
||||||
|
// }
|
||||||
|
[cell endEditing:aTextObject];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ // entry is not valid
|
||||||
|
NSBeep();
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
[self display];
|
||||||
|
[window flushWindow];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
|
@ -928,13 +928,22 @@ static PSMatrix *flip = nil;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) display
|
- (void)display
|
||||||
{
|
{
|
||||||
if (!window)
|
if(!window) // do nothing if not in
|
||||||
return;
|
return; // a window's heirarchy
|
||||||
|
|
||||||
[self displayRect: bounds];
|
if ([self isOpaque]) // if self is opaque
|
||||||
}
|
[self displayRect:bounds]; // display visible rect
|
||||||
|
else // else back up to a
|
||||||
|
{
|
||||||
|
NSView *firstOpaque = [self opaqueAncestor]; // convert rect into
|
||||||
|
NSRect rect = bounds; // coordinates of the
|
||||||
|
// first opaque view
|
||||||
|
rect = [firstOpaque convertRect:rect fromView:self];
|
||||||
|
[firstOpaque displayRect:rect];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) displayIfNeeded
|
- (void) displayIfNeeded
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue