mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Implement NSColorPicker, add method defs to NSImage.h, add ivar init to
NSImage.m, fix bug in NSBundle [-pathForImageResource:] git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6380 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8e27362fa9
commit
0b2be78c02
6 changed files with 40 additions and 16 deletions
|
@ -1,3 +1,12 @@
|
|||
2000-03-25 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
||||
* Headers/gnustep/gui/NSColorPicker.h: Added ivar.
|
||||
* Headers/gnustep/gui/NSImage.h: Added setFlipped/isFlipped methods.
|
||||
* Source/NSBundleAdditions.m: Fixed bug in checking filename
|
||||
extension. ([-pathForImageResource:])
|
||||
* Source/NSColorPicker.m: Implement. ([-initWithPickerMask:colorPanel:]
|
||||
[-colorPanel] [-insertNewButtonImage:in:] [-provideNewButtonImage:])
|
||||
* Source/NSImage.m: Initialize _flags.flipDraw in [-initWithSize:]
|
||||
|
||||
2000-03-24 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
||||
* Source/NSFileWrapper.m: First implementation of NSFileWrapper
|
||||
* Headers/gnustep/gui/NSFileWrapper.h: Added ivars and enum
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
@interface NSColorPicker : NSObject <NSColorPickingDefault>
|
||||
{
|
||||
// Attributes
|
||||
id _colorPanel;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -150,6 +150,8 @@
|
|||
- (BOOL) drawRepresentation: (NSImageRep*)imageRep
|
||||
inRect: (NSRect)aRect;
|
||||
- (void) recache;
|
||||
- (void) setFlipped: (BOOL)flag;
|
||||
- (BOOL) isFlipped;
|
||||
|
||||
//
|
||||
// Assigning a Delegate
|
||||
|
|
|
@ -177,12 +177,7 @@
|
|||
NSString *ext = [name pathExtension];
|
||||
NSString *path = nil;
|
||||
|
||||
if (ext != nil)
|
||||
{
|
||||
name = [name stringByDeletingPathExtension];
|
||||
path = [self pathForResource: name ofType: ext];
|
||||
}
|
||||
else
|
||||
if ((ext == nil) || [ext isEqualToString:@""])
|
||||
{
|
||||
NSArray *types = [NSImage imageUnfilteredFileTypes];
|
||||
unsigned c = [types count];
|
||||
|
@ -194,6 +189,11 @@
|
|||
path = [self pathForResource: name ofType: ext];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
name = [name stringByDeletingPathExtension];
|
||||
path = [self pathForResource: name ofType: ext];
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
/*
|
||||
NSColorPicker.m
|
||||
|
||||
Description...
|
||||
Abstract superclass for NSColorPanel color pickers
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Author: Scott Christley <scottc@net-community.com>
|
||||
Date: 1996
|
||||
Author: Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
|
||||
Date: March 2000
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
|
@ -27,6 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <gnustep/gui/config.h>
|
||||
#include <AppKit/NSButtonCell.h>
|
||||
#include <AppKit/NSColorPicker.h>
|
||||
|
||||
@implementation NSColorPicker
|
||||
|
@ -53,7 +56,8 @@
|
|||
- (id)initWithPickerMask:(int)aMask
|
||||
colorPanel:(NSColorPanel *)colorPanel
|
||||
{
|
||||
return nil;
|
||||
ASSIGN(_colorPanel, colorPanel);
|
||||
return self;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -61,7 +65,7 @@
|
|||
//
|
||||
- (NSColorPanel *)colorPanel
|
||||
{
|
||||
return nil;
|
||||
return _colorPanel;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -69,38 +73,45 @@
|
|||
//
|
||||
- (void)insertNewButtonImage:(NSImage *)newImage
|
||||
in:(NSButtonCell *)newButtonCell
|
||||
{}
|
||||
{
|
||||
[newButtonCell setImage: newImage];
|
||||
}
|
||||
|
||||
- (NSImage *)provideNewButtonImage
|
||||
{
|
||||
return nil;
|
||||
Class myClass = [self class];
|
||||
NSBundle *bundle = [NSBundle bundleForClass: myClass];
|
||||
NSString *file = [bundle pathForResource: NSStringFromClass(myClass)
|
||||
ofType:@"tiff"];
|
||||
|
||||
return [[NSImage alloc] initWithContentsOfFile: file];
|
||||
}
|
||||
|
||||
//
|
||||
// Setting the Mode
|
||||
//
|
||||
- (void)setMode:(int)mode
|
||||
{}
|
||||
{} // does nothing; override
|
||||
|
||||
//
|
||||
// Using Color Lists
|
||||
//
|
||||
- (void)attachColorList:(NSColorList *)colorList
|
||||
{}
|
||||
{} // does nothing; override
|
||||
|
||||
- (void)detachColorList:(NSColorList *)colorList
|
||||
{}
|
||||
{} // does nothing; override
|
||||
|
||||
//
|
||||
// Showing Opacity Controls
|
||||
//
|
||||
- (void)alphaControlAddedOrRemoved:(id)sender
|
||||
{}
|
||||
{} // does nothing; override
|
||||
|
||||
//
|
||||
// Responding to a Resized View
|
||||
//
|
||||
- (void)viewSizeChanged:(id)sender
|
||||
{}
|
||||
{} // does nothing; override
|
||||
|
||||
@end
|
||||
|
|
|
@ -288,6 +288,7 @@ static Class cacheClass = 0;
|
|||
}
|
||||
_flags.colorMatchPreferred = YES;
|
||||
_flags.multipleResolutionMatching = YES;
|
||||
_flags.flipDraw = NO;
|
||||
_color = RETAIN(clearColor);
|
||||
|
||||
return self;
|
||||
|
|
Loading…
Reference in a new issue