mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 18:40:47 +00:00
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:
parent
c50f0dae54
commit
e57412cbff
8 changed files with 27 additions and 17 deletions
|
@ -363,6 +363,7 @@ id gnustep_gui_nsbutton_class = nil;
|
||||||
|
|
||||||
[cell drawWithFrame:bounds inView:self];
|
[cell drawWithFrame:bounds inView:self];
|
||||||
}
|
}
|
||||||
|
[[self window] flushWindow];
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include <Foundation/NSValue.h>
|
#include <Foundation/NSValue.h>
|
||||||
#include <AppKit/NSApplication.h>
|
#include <AppKit/NSApplication.h>
|
||||||
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/NSImage.h>
|
#include <AppKit/NSImage.h>
|
||||||
#include <AppKit/NSFont.h>
|
#include <AppKit/NSFont.h>
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
@ -633,7 +634,10 @@
|
||||||
|
|
||||||
// If point is in cellFrame then highlight the cell
|
// If point is in cellFrame then highlight the cell
|
||||||
if ([controlView mouse: point inRect: cellFrame])
|
if ([controlView mouse: point inRect: cellFrame])
|
||||||
|
{
|
||||||
[self highlight:YES withFrame:cellFrame inView:controlView];
|
[self highlight:YES withFrame:cellFrame inView:controlView];
|
||||||
|
[[controlView window] flushWindow];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
@ -646,9 +650,6 @@
|
||||||
last_point = point;
|
last_point = point;
|
||||||
e = [theApp nextEventMatchingMask:event_mask untilDate:nil
|
e = [theApp nextEventMatchingMask:event_mask untilDate:nil
|
||||||
inMode:nil dequeue:YES];
|
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];
|
location = [e locationInWindow];
|
||||||
point = [controlView convertPoint: location fromView: nil];
|
point = [controlView convertPoint: location fromView: nil];
|
||||||
NSDebugLog(@"NSCell location %f %f\n", location.x, location.y);
|
NSDebugLog(@"NSCell location %f %f\n", location.x, location.y);
|
||||||
|
@ -664,6 +665,7 @@
|
||||||
[self highlight: NO withFrame: cellFrame
|
[self highlight: NO withFrame: cellFrame
|
||||||
inView: controlView];
|
inView: controlView];
|
||||||
[self drawWithFrame: cellFrame inView: controlView];
|
[self drawWithFrame: cellFrame inView: controlView];
|
||||||
|
[[controlView window] flushWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we now return or keep tracking
|
// Do we now return or keep tracking
|
||||||
|
@ -684,6 +686,7 @@
|
||||||
[self highlight: YES withFrame: cellFrame
|
[self highlight: YES withFrame: cellFrame
|
||||||
inView: controlView];
|
inView: controlView];
|
||||||
//[self drawWithFrame: cellFrame inView: controlView];
|
//[self drawWithFrame: cellFrame inView: controlView];
|
||||||
|
[[controlView window] flushWindow];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,12 +311,14 @@ right:(unsigned)rightDigits
|
||||||
|
|
||||||
- (void)updateCell:(NSCell *)aCell
|
- (void)updateCell:(NSCell *)aCell
|
||||||
{
|
{
|
||||||
[self drawCell:aCell];
|
[self setNeedsDisplay:YES];
|
||||||
|
// [self drawCell:aCell];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateCellInside:(NSCell *)aCell
|
- (void)updateCellInside:(NSCell *)aCell
|
||||||
{
|
{
|
||||||
[self drawCellInside:aCell];
|
[self setNeedsDisplay:YES];
|
||||||
|
// [self drawCellInside:aCell];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -61,13 +61,13 @@ NSString*NSAFMXHeight = @"XHeight";
|
||||||
Convention (see the red book). */
|
Convention (see the red book). */
|
||||||
static NSMutableSet* fontsUsed = nil;
|
static NSMutableSet* fontsUsed = nil;
|
||||||
|
|
||||||
static NSFont* getFont(NSString* key, NSString* defaultFont, float fontSize)
|
static NSFont* getFont(NSString* key, NSString* defaultFontName, float fontSize)
|
||||||
{
|
{
|
||||||
NSString* fontName;
|
NSString* fontName;
|
||||||
|
|
||||||
fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key];
|
fontName = [[NSUserDefaults standardUserDefaults] objectForKey:key];
|
||||||
if (!fontName)
|
if (!fontName)
|
||||||
return [NSFont fontWithName: defaultFont size: fontSize];
|
fontName = defaultFontName;
|
||||||
|
|
||||||
return [NSFont fontWithName:fontName size:fontSize];
|
return [NSFont fontWithName:fontName size:fontSize];
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,6 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
||||||
NSImage* image = [[NSImage alloc] initByReferencingFile:path];
|
NSImage* image = [[NSImage alloc] initByReferencingFile:path];
|
||||||
if (image)
|
if (image)
|
||||||
[image setName:_base_name(path)];
|
[image setName:_base_name(path)];
|
||||||
[nameDict setObject: image forKey: [image name]];
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,8 @@
|
||||||
if (eventSelector != @selector(keyDown:))
|
if (eventSelector != @selector(keyDown:))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NSBeep();
|
/* Commented out to be able to create shared libraries on OS 4.1 */
|
||||||
|
// NSBeep();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)rightMouseDown:(NSEvent *)theEvent
|
- (void)rightMouseDown:(NSEvent *)theEvent
|
||||||
|
|
|
@ -98,8 +98,7 @@ id gnustep_gui_nsscroller_class = nil;
|
||||||
[super initWithFrame:frameRect];
|
[super initWithFrame:frameRect];
|
||||||
|
|
||||||
// set our cell
|
// set our cell
|
||||||
[[self cell] release];
|
[self setCell:[[gnustep_gui_nsscroller_class new] autorelease]];
|
||||||
[self setCell:[[gnustep_gui_nsscroller_class alloc] init]];
|
|
||||||
[self selectCell: cell];
|
[self selectCell: cell];
|
||||||
|
|
||||||
arrows_position = NSScrollerArrowsMaxEnd;
|
arrows_position = NSScrollerArrowsMaxEnd;
|
||||||
|
|
|
@ -163,7 +163,7 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
||||||
is_flipped = NO;
|
is_flipped = NO;
|
||||||
is_rotated_from_base = NO;
|
is_rotated_from_base = NO;
|
||||||
is_rotated_or_scaled_from_base = NO;
|
is_rotated_or_scaled_from_base = NO;
|
||||||
opaque = NO;
|
opaque = YES;
|
||||||
disable_autodisplay = NO;
|
disable_autodisplay = NO;
|
||||||
needs_display = YES;
|
needs_display = YES;
|
||||||
post_frame_changes = NO;
|
post_frame_changes = NO;
|
||||||
|
@ -756,24 +756,29 @@ NSString *NSViewFocusChangedNotification = @"NSViewFocusChangedNotification";
|
||||||
|
|
||||||
[self lockFocus];
|
[self lockFocus];
|
||||||
[self drawRect:bounds];
|
[self drawRect:bounds];
|
||||||
[self unlockFocus];
|
|
||||||
|
|
||||||
// Tell subviews to display
|
// Tell subviews to display
|
||||||
j = [sub_views count];
|
j = [sub_views count];
|
||||||
for (i = 0;i < j; ++i)
|
for (i = 0;i < j; ++i)
|
||||||
[(NSView *)[sub_views objectAtIndex:i] display];
|
[(NSView *)[sub_views objectAtIndex:i] display];
|
||||||
|
[[self window] flushWindow];
|
||||||
|
[self unlockFocus];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)displayIfNeeded
|
- (void)displayIfNeeded
|
||||||
{
|
{
|
||||||
if ((needs_display) && (opaque))
|
if ((needs_display) && (opaque)) {
|
||||||
[self display];
|
[self display];
|
||||||
|
[self setNeedsDisplay:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)displayIfNeededIgnoringOpacity
|
- (void)displayIfNeededIgnoringOpacity
|
||||||
{
|
{
|
||||||
if (needs_display)
|
if (needs_display) {
|
||||||
[self display];
|
[self display];
|
||||||
|
[self setNeedsDisplay:NO];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)displayRect:(NSRect)aRect
|
- (void)displayRect:(NSRect)aRect
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue