Some small changes to support backing-store.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2244 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Scott Christley 1997-03-17 18:43:27 +00:00
parent 1fee4feff2
commit 5d15da4e79
8 changed files with 27 additions and 17 deletions

View file

@ -363,6 +363,7 @@ id gnustep_gui_nsbutton_class = nil;
[cell drawWithFrame:bounds inView:self];
}
[[self window] flushWindow];
[self unlockFocus];
}

View file

@ -28,6 +28,7 @@
#include <Foundation/NSValue.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSFont.h>
#include <AppKit/NSView.h>
@ -633,7 +634,10 @@
// If point is in cellFrame then highlight the cell
if ([controlView mouse: point inRect: cellFrame])
{
[self highlight:YES withFrame:cellFrame inView:controlView];
[[controlView window] flushWindow];
}
else
return NO;
@ -646,9 +650,6 @@
last_point = point;
e = [theApp nextEventMatchingMask:event_mask untilDate:nil
inMode:nil dequeue:YES];
// What is going on here? After the following statement location
// should be in the window coordinates, but is in the receiving
// view's coordinate.
location = [e locationInWindow];
point = [controlView convertPoint: location fromView: nil];
NSDebugLog(@"NSCell location %f %f\n", location.x, location.y);
@ -664,6 +665,7 @@
[self highlight: NO withFrame: cellFrame
inView: controlView];
[self drawWithFrame: cellFrame inView: controlView];
[[controlView window] flushWindow];
}
// Do we now return or keep tracking
@ -684,6 +686,7 @@
[self highlight: YES withFrame: cellFrame
inView: controlView];
//[self drawWithFrame: cellFrame inView: controlView];
[[controlView window] flushWindow];
}
}

View file

@ -311,12 +311,14 @@ right:(unsigned)rightDigits
- (void)updateCell:(NSCell *)aCell
{
[self drawCell:aCell];
[self setNeedsDisplay:YES];
// [self drawCell:aCell];
}
- (void)updateCellInside:(NSCell *)aCell
{
[self drawCellInside:aCell];
[self setNeedsDisplay:YES];
// [self drawCellInside:aCell];
}
//

View file

@ -61,13 +61,13 @@ NSString*NSAFMXHeight = @"XHeight";
Convention (see the red book). */
static NSMutableSet* fontsUsed = nil;
static NSFont* getFont(NSString* key, NSString* defaultFont, float fontSize)
static NSFont* getFont(NSString* key, NSString* defaultFontName, float fontSize)
{
NSString* fontName;
fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key];
if (!fontName)
return [NSFont fontWithName: defaultFont size: fontSize];
fontName = defaultFontName;
return [NSFont fontWithName:fontName size:fontSize];
}

View file

@ -232,7 +232,6 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
NSImage* image = [[NSImage alloc] initByReferencingFile:path];
if (image)
[image setName:_base_name(path)];
[nameDict setObject: image forKey: [image name]];
return image;
}
}

View file

@ -195,7 +195,8 @@
if (eventSelector != @selector(keyDown:))
return;
NSBeep();
/* Commented out to be able to create shared libraries on OS 4.1 */
// NSBeep();
}
- (void)rightMouseDown:(NSEvent *)theEvent

View file

@ -98,8 +98,7 @@ id gnustep_gui_nsscroller_class = nil;
[super initWithFrame:frameRect];
// set our cell
[[self cell] release];
[self setCell:[[gnustep_gui_nsscroller_class alloc] init]];
[self setCell:[[gnustep_gui_nsscroller_class new] autorelease]];
[self selectCell: cell];
arrows_position = NSScrollerArrowsMaxEnd;

View file

@ -163,7 +163,7 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
is_flipped = NO;
is_rotated_from_base = NO;
is_rotated_or_scaled_from_base = NO;
opaque = NO;
opaque = YES;
disable_autodisplay = NO;
needs_display = YES;
post_frame_changes = NO;
@ -756,24 +756,29 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
[self lockFocus];
[self drawRect:bounds];
[self unlockFocus];
// Tell subviews to display
j = [sub_views count];
for (i = 0;i < j; ++i)
[(NSView *)[sub_views objectAtIndex:i] display];
[[self window] flushWindow];
[self unlockFocus];
}
- (void)displayIfNeeded
{
if ((needs_display) && (opaque))
if ((needs_display) && (opaque)) {
[self display];
[self setNeedsDisplay:NO];
}
}
- (void)displayIfNeededIgnoringOpacity
{
if (needs_display)
if (needs_display) {
[self display];
[self setNeedsDisplay:NO];
}
}
- (void)displayRect:(NSRect)aRect