mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
Change some defaults and minor bug fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@1806 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2c37af52c9
commit
4f871af2e9
6 changed files with 168 additions and 53 deletions
|
@ -1,3 +1,11 @@
|
|||
Sat Sep 21 12:25:23 1996 GNUstep Development <gnustep@duncan.ocbi.com>
|
||||
|
||||
* Source/NSButtonCell.m (-initTextCell:): Make default font
|
||||
be the user font instead of the user fixed pitch font.
|
||||
* Source/NSColor.m: Use global variables for common colors.
|
||||
* Source/NSView.m (+popFocusView): Remove dictionary object.
|
||||
* Source/NSWindow.m: Make default background color light gray.
|
||||
|
||||
Thu Sep 12 13:49:53 1996 GNUstep Development <gnustep@ocbi.com>
|
||||
|
||||
* Headers/gnustep/gui/NSFontPrivate.h: New file.
|
||||
|
|
|
@ -75,7 +75,7 @@
|
|||
- initTextCell:(NSString *)aString
|
||||
{
|
||||
[super initTextCell:aString];
|
||||
support = [NSFont userFixedPitchFontOfSize:12];
|
||||
support = [NSFont userFontOfSize:12];
|
||||
alt_contents = @"Button";
|
||||
cell_type = NSMomentaryPushButton;
|
||||
[self setEnabled:YES];
|
||||
|
|
187
Source/NSColor.m
187
Source/NSColor.m
|
@ -33,7 +33,23 @@
|
|||
#include <gnustep/gui/NSView.h>
|
||||
|
||||
// Class variables
|
||||
BOOL gnustep_gui_ignores_alpha;
|
||||
BOOL gnustep_gui_ignores_alpha = YES;
|
||||
// Common colors
|
||||
NSColor *gnustep_gui_black = nil;
|
||||
NSColor *gnustep_gui_blue = nil;
|
||||
NSColor *gnustep_gui_brown = nil;
|
||||
NSColor *gnustep_gui_clear = nil;
|
||||
NSColor *gnustep_gui_cyan = nil;
|
||||
NSColor *gnustep_gui_dark_gray = nil;
|
||||
NSColor *gnustep_gui_gray = nil;
|
||||
NSColor *gnustep_gui_green = nil;
|
||||
NSColor *gnustep_gui_light_gray = nil;
|
||||
NSColor *gnustep_gui_magenta = nil;
|
||||
NSColor *gnustep_gui_orange = nil;
|
||||
NSColor *gnustep_gui_purple = nil;
|
||||
NSColor *gnustep_gui_red = nil;
|
||||
NSColor *gnustep_gui_white = nil;
|
||||
NSColor *gnustep_gui_yellow = nil;
|
||||
|
||||
// Global strings
|
||||
NSString *NSCalibratedWhiteColorSpace = @"NSCalibratedWhiteColorSpace";
|
||||
|
@ -204,43 +220,63 @@ const float NSWhite = 1;
|
|||
//
|
||||
+ (NSColor *)blackColor
|
||||
{
|
||||
return [self colorWithCalibratedWhite: NSBlack alpha: 1.0];
|
||||
if (!gnustep_gui_black)
|
||||
{
|
||||
gnustep_gui_black = [self colorWithCalibratedWhite: NSBlack alpha: 1.0];
|
||||
[gnustep_gui_black retain];
|
||||
}
|
||||
return gnustep_gui_black;
|
||||
}
|
||||
|
||||
+ (NSColor *)blueColor
|
||||
{
|
||||
return [self colorWithCalibratedRed:0
|
||||
green:0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_blue)
|
||||
{
|
||||
gnustep_gui_blue = [self colorWithCalibratedRed:0
|
||||
green:0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_blue retain];
|
||||
}
|
||||
return gnustep_gui_blue;
|
||||
}
|
||||
|
||||
+ (NSColor *)brownColor
|
||||
{
|
||||
return [self colorWithCalibratedRed:0.6
|
||||
green:0.4
|
||||
blue:0.2
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_brown)
|
||||
{
|
||||
gnustep_gui_brown = [self colorWithCalibratedRed:0.6
|
||||
green:0.4
|
||||
blue:0.2
|
||||
alpha:1.0];
|
||||
[gnustep_gui_brown retain];
|
||||
}
|
||||
return gnustep_gui_brown;
|
||||
}
|
||||
|
||||
+ (NSColor *)clearColor
|
||||
{
|
||||
NSColor *c;
|
||||
c = [self colorWithCalibratedRed:0
|
||||
green:1.0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
[c setClear:YES];
|
||||
return c;
|
||||
if (!gnustep_gui_clear)
|
||||
{
|
||||
gnustep_gui_clear = [self colorWithCalibratedWhite: NSBlack alpha: 1.0];
|
||||
[gnustep_gui_clear retain];
|
||||
[gnustep_gui_clear setClear:YES];
|
||||
}
|
||||
return gnustep_gui_clear;
|
||||
}
|
||||
|
||||
+ (NSColor *)cyanColor
|
||||
{
|
||||
// Why does OpenStep say RGB color space instead of CMYK?
|
||||
return [self colorWithCalibratedRed:0
|
||||
green:1.0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_cyan)
|
||||
{
|
||||
gnustep_gui_cyan = [self colorWithCalibratedRed:0
|
||||
green:1.0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_cyan retain];
|
||||
}
|
||||
return gnustep_gui_cyan;
|
||||
#if 0
|
||||
return [self colorWithCalibratedCyan: 1.0
|
||||
magenta:0
|
||||
|
@ -252,34 +288,62 @@ const float NSWhite = 1;
|
|||
|
||||
+ (NSColor *)darkGrayColor
|
||||
{
|
||||
return [self colorWithCalibratedWhite: NSDarkGray alpha: 1.0];
|
||||
if (!gnustep_gui_dark_gray)
|
||||
{
|
||||
gnustep_gui_dark_gray = [self colorWithCalibratedWhite: NSDarkGray
|
||||
alpha: 1.0];
|
||||
[gnustep_gui_dark_gray retain];
|
||||
}
|
||||
return gnustep_gui_dark_gray;
|
||||
}
|
||||
|
||||
+ (NSColor *)grayColor
|
||||
{
|
||||
return [self colorWithCalibratedWhite: NSGray alpha: 1.0];
|
||||
if (!gnustep_gui_gray)
|
||||
{
|
||||
gnustep_gui_gray = [self colorWithCalibratedWhite: NSGray
|
||||
alpha: 1.0];
|
||||
[gnustep_gui_gray retain];
|
||||
}
|
||||
return gnustep_gui_gray;
|
||||
}
|
||||
|
||||
+ (NSColor *)greenColor
|
||||
{
|
||||
return [self colorWithCalibratedRed:0
|
||||
green:1.0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_green)
|
||||
{
|
||||
gnustep_gui_green = [self colorWithCalibratedRed:0
|
||||
green:1.0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_green retain];
|
||||
}
|
||||
return gnustep_gui_green;
|
||||
}
|
||||
|
||||
+ (NSColor *)lightGrayColor
|
||||
{
|
||||
return [self colorWithCalibratedWhite: NSLightGray alpha: 1];
|
||||
if (!gnustep_gui_light_gray)
|
||||
{
|
||||
gnustep_gui_light_gray = [self colorWithCalibratedWhite: NSLightGray
|
||||
alpha: 1.0];
|
||||
[gnustep_gui_light_gray retain];
|
||||
}
|
||||
return gnustep_gui_light_gray;
|
||||
}
|
||||
|
||||
+ (NSColor *)magentaColor
|
||||
{
|
||||
// Why does OpenStep say RGB color space instead of CMYK?
|
||||
return [self colorWithCalibratedRed:1.0
|
||||
green:0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_magenta)
|
||||
{
|
||||
gnustep_gui_magenta = [self colorWithCalibratedRed:1.0
|
||||
green:0
|
||||
blue:1.0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_magenta retain];
|
||||
}
|
||||
return gnustep_gui_magenta;
|
||||
#if 0
|
||||
return [self colorWithCalibratedCyan:0
|
||||
magenta:1.0
|
||||
|
@ -291,40 +355,65 @@ const float NSWhite = 1;
|
|||
|
||||
+ (NSColor *)orangeColor;
|
||||
{
|
||||
return [self colorWithCalibratedRed:1.0
|
||||
green:0.5
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_orange)
|
||||
{
|
||||
gnustep_gui_orange = [self colorWithCalibratedRed:1.0
|
||||
green:0.5
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_orange retain];
|
||||
}
|
||||
return gnustep_gui_orange;
|
||||
}
|
||||
|
||||
+ (NSColor *)purpleColor;
|
||||
{
|
||||
return [self colorWithCalibratedRed:0.5
|
||||
green:0
|
||||
blue:0.5
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_purple)
|
||||
{
|
||||
gnustep_gui_purple = [self colorWithCalibratedRed:0.5
|
||||
green:0
|
||||
blue:0.5
|
||||
alpha:1.0];
|
||||
[gnustep_gui_purple retain];
|
||||
}
|
||||
return gnustep_gui_purple;
|
||||
}
|
||||
|
||||
+ (NSColor *)redColor;
|
||||
{
|
||||
return [self colorWithCalibratedRed:1.0
|
||||
green:0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_red)
|
||||
{
|
||||
gnustep_gui_red = [self colorWithCalibratedRed:1.0
|
||||
green:0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_red retain];
|
||||
}
|
||||
return gnustep_gui_red;
|
||||
}
|
||||
|
||||
+ (NSColor *)whiteColor;
|
||||
{
|
||||
return [self colorWithCalibratedWhite: NSWhite alpha: 1.0];
|
||||
if (!gnustep_gui_white)
|
||||
{
|
||||
gnustep_gui_white = [self colorWithCalibratedWhite: NSWhite alpha: 1.0];
|
||||
[gnustep_gui_white retain];
|
||||
}
|
||||
return gnustep_gui_white;
|
||||
}
|
||||
|
||||
+ (NSColor *)yellowColor
|
||||
{
|
||||
// Why does OpenStep say RGB color space instead of CMYK?
|
||||
return [self colorWithCalibratedRed:1.0
|
||||
green:1.0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
if (!gnustep_gui_yellow)
|
||||
{
|
||||
gnustep_gui_yellow = [self colorWithCalibratedRed:1.0
|
||||
green:1.0
|
||||
blue:0
|
||||
alpha:1.0];
|
||||
[gnustep_gui_yellow retain];
|
||||
}
|
||||
return gnustep_gui_yellow;
|
||||
#if 0
|
||||
return [self colorWithCalibratedCyan:0
|
||||
magenta:0
|
||||
|
|
|
@ -708,7 +708,9 @@ Class NSMATRIX_DEFAULT_CELL_CLASS;
|
|||
|| (aPoint.y < myFrame.origin.y)
|
||||
|| (aPoint.y > (myFrame.origin.y + myFrame.size.height)))
|
||||
{
|
||||
NSDebugLog(@"NSMatrix not in frame rect\n");
|
||||
NSDebugLog(@"NSMatrix point %f %f not in rect %f %f %f %f\n",
|
||||
aPoint.x, aPoint.y, myFrame.origin.x, myFrame.origin.y,
|
||||
myFrame.size.width, myFrame.size.height);
|
||||
return NO;
|
||||
}
|
||||
else
|
||||
|
@ -1136,6 +1138,12 @@ Class NSMATRIX_DEFAULT_CELL_CLASS;
|
|||
[(NSView *)self setFrameSize:newSize];
|
||||
}
|
||||
|
||||
- (void)resizeWithOldSuperviewSize:(NSSize)oldSize
|
||||
{
|
||||
NSDebugLog(@"NSMatrix resize %f %f old %f %f\n", bounds.size.width,
|
||||
bounds.size.height, oldSize.width, oldSize.height);
|
||||
}
|
||||
|
||||
//
|
||||
// Scrolling
|
||||
//
|
||||
|
|
|
@ -97,7 +97,17 @@ NSString *NSViewFocusChangedNotification;
|
|||
}
|
||||
|
||||
+ (NSView *)popFocusView
|
||||
{}
|
||||
{
|
||||
NSThread *current_thread = [NSThread currentThread];
|
||||
|
||||
// Obtain lock so we can edit the dictionary
|
||||
[gnustep_gui_nsview_lock lock];
|
||||
|
||||
// Remove from dictionary
|
||||
[gnustep_gui_nsview_thread_dict removeObjectForKey: current_thread];
|
||||
|
||||
[gnustep_gui_nsview_lock unlock];
|
||||
}
|
||||
|
||||
+ (NSView *)focusView
|
||||
{
|
||||
|
|
|
@ -180,7 +180,7 @@ NSString *NSWindowWillMoveNotification;
|
|||
first_responder = nil;
|
||||
delegate = nil;
|
||||
window_num = 0;
|
||||
background_color = [NSColor grayColor];
|
||||
background_color = [NSColor lightGrayColor];
|
||||
represented_filename = @"Window";
|
||||
miniaturized_title = @"Window";
|
||||
window_title = @"Window";
|
||||
|
|
Loading…
Reference in a new issue