mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 15:20:38 +00:00
Tidyup
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
80028023e4
commit
563c98aa8d
6 changed files with 992 additions and 751 deletions
|
@ -222,6 +222,22 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSBitmapImageRep *copy;
|
||||
|
||||
copy = (NSBitmapImageRep*)[super copyWithZone: zone];
|
||||
|
||||
copy->bytesPerRow = bytesPerRow;
|
||||
copy->numColors = numColors;
|
||||
copy->bitsPerPixel = bitsPerPixel;
|
||||
copy->compression = compression;
|
||||
copy->_isPlanar = _isPlanar;
|
||||
copy->imagePlanes = 0;
|
||||
copy->imageData = [imageData copy];
|
||||
|
||||
return copy;
|
||||
}
|
||||
+ (BOOL) canInitWithData: (NSData *)data
|
||||
{
|
||||
TIFF *image = NULL;
|
||||
|
|
|
@ -1386,11 +1386,11 @@
|
|||
|
||||
- (void)_adjustMatrixOfColumn: (int)column
|
||||
{
|
||||
NSBrowserColumn *bc;
|
||||
NSScrollView *sc;
|
||||
id matrix;
|
||||
NSSize cs, ms;
|
||||
NSRect mr;
|
||||
NSBrowserColumn *bc;
|
||||
NSScrollView *sc;
|
||||
id matrix;
|
||||
NSSize cs, ms;
|
||||
NSRect mr;
|
||||
|
||||
if (column >= (int)[_browserColumns count])
|
||||
return;
|
||||
|
@ -1398,8 +1398,9 @@ NSRect mr;
|
|||
bc = [_browserColumns objectAtIndex: column];
|
||||
sc = [bc columnScrollView];
|
||||
matrix = [bc columnMatrix];
|
||||
// Adjust matrix to fit in scrollview
|
||||
if (sc && matrix && [bc isLoaded]) // do it only if column has been loaded
|
||||
|
||||
// Adjust matrix to fit in scrollview if column has been loaded
|
||||
if (sc && matrix && [bc isLoaded])
|
||||
{
|
||||
cs = [sc contentSize];
|
||||
ms = [matrix cellSize];
|
||||
|
@ -1407,11 +1408,13 @@ NSRect mr;
|
|||
[matrix setCellSize: ms];
|
||||
mr = [matrix frame];
|
||||
|
||||
if (mr.size.height < cs.height) // matrix smaller than
|
||||
{ // scrollview's content
|
||||
mr.origin.y = cs.height; // view requires origin
|
||||
[matrix setFrame: mr]; // adjustment for it to
|
||||
} // appear at top
|
||||
// matrix smaller than scrollview's content
|
||||
if (mr.size.height < cs.height)
|
||||
{
|
||||
// view requires origin adjustment for it to appear at top
|
||||
mr.origin.y = cs.height;
|
||||
[matrix setFrame: mr];
|
||||
}
|
||||
|
||||
[sc setDocumentView: matrix];
|
||||
}
|
||||
|
@ -1499,7 +1502,8 @@ NSRect mr;
|
|||
NSRect matrixRect = {{0, 0}, {100, 100}};
|
||||
int i;
|
||||
|
||||
matrix = [[[_browserMatrixClass alloc] // create a new col matrix
|
||||
// create a new col matrix
|
||||
matrix = [[[_browserMatrixClass alloc]
|
||||
initWithFrame: matrixRect
|
||||
mode: NSListModeMatrix
|
||||
prototype: _browserCellPrototype
|
||||
|
@ -1513,7 +1517,8 @@ NSRect mr;
|
|||
[matrix setAction: @selector(doClick:)];
|
||||
[matrix setDoubleAction: @selector(doDoubleClick:)];
|
||||
|
||||
[bc setColumnMatrix: matrix]; // set new col matrix and release old
|
||||
// set new col matrix and release old
|
||||
[bc setColumnMatrix: matrix];
|
||||
[sc setDocumentView: matrix];
|
||||
|
||||
// Now loop through the cells and load each one
|
||||
|
@ -1533,7 +1538,8 @@ NSRect mr;
|
|||
id oldm = [bc columnMatrix];
|
||||
NSRect matrixRect = {{0, 0}, {100, 100}};
|
||||
|
||||
matrix = [[[_browserMatrixClass alloc] // create a new col matrix
|
||||
// create a new col matrix
|
||||
matrix = [[[_browserMatrixClass alloc]
|
||||
initWithFrame: matrixRect
|
||||
mode: NSListModeMatrix
|
||||
prototype: _browserCellPrototype
|
||||
|
@ -1547,16 +1553,19 @@ NSRect mr;
|
|||
[matrix setAction: @selector(doClick:)];
|
||||
[matrix setDoubleAction: @selector(doDoubleClick:)];
|
||||
|
||||
[bc setColumnMatrix: matrix]; // set new col matrix and release old
|
||||
// set new col matrix and release old
|
||||
[bc setColumnMatrix: matrix];
|
||||
[sc setDocumentView: matrix];
|
||||
|
||||
// Tell the delegate to create the rows
|
||||
[_browserDelegate browser: self createRowsForColumn: column
|
||||
[_browserDelegate browser: self
|
||||
createRowsForColumn: column
|
||||
inMatrix: matrix];
|
||||
}
|
||||
}
|
||||
|
||||
[bc setIsLoaded: YES];
|
||||
[self setNeedsDisplayInRect: [self frameOfColumn: column]];
|
||||
}
|
||||
|
||||
- (void)_unloadFromColumn: (int)column
|
||||
|
|
|
@ -268,10 +268,9 @@ static NSImage *highlight_image;
|
|||
control_view = controlView; // remember last view cell was drawn in
|
||||
if (cell_highlighted || cell_state) // temporary hack FAR FIX ME?
|
||||
{
|
||||
NSColor *white = [NSColor whiteColor];
|
||||
NSColor *backColor = [NSColor selectedControlColor];
|
||||
|
||||
[white set];
|
||||
// [_browserText setBackgroundColor: white];
|
||||
[backColor set];
|
||||
if (!_isLeaf)
|
||||
{
|
||||
image = _highlightBranchImage;
|
||||
|
@ -288,7 +287,6 @@ static NSImage *highlight_image;
|
|||
NSColor *backColor = [[controlView window] backgroundColor];
|
||||
|
||||
[backColor set];
|
||||
// [_browserText setBackgroundColor: backColor];
|
||||
if (!_isLeaf)
|
||||
{
|
||||
image = _branchImage;
|
||||
|
|
|
@ -442,7 +442,7 @@
|
|||
delegate: (id)anObject
|
||||
start: (int)selStart
|
||||
length: (int)selLength
|
||||
{ // preliminary FIX ME
|
||||
{
|
||||
if (!controlView || !textObject || !cell_font ||
|
||||
(cell_type != NSTextCellType))
|
||||
return;
|
||||
|
@ -450,10 +450,13 @@
|
|||
[[controlView window] makeFirstResponder: textObject];
|
||||
|
||||
[textObject setFrame: aRect];
|
||||
[textObject setAlignment: text_align];
|
||||
[textObject setText: [self stringValue]];
|
||||
[textObject setDelegate: anObject];
|
||||
[controlView addSubview: textObject];
|
||||
[controlView lockFocus];
|
||||
NSEraseRect(aRect);
|
||||
[controlView unlockFocus];
|
||||
[textObject display];
|
||||
}
|
||||
|
||||
|
|
|
@ -143,6 +143,23 @@ static NSMutableArray* imageReps = NULL;
|
|||
return (NSArray *)array;
|
||||
}
|
||||
|
||||
- (id) copyWithZone: (NSZone *)zone
|
||||
{
|
||||
NSImageRep *copy;
|
||||
|
||||
copy = (NSImageRep*)NSCopyObject(self, 0, zone);
|
||||
|
||||
copy->size = size;
|
||||
copy->hasAlpha = hasAlpha;
|
||||
copy->isOpaque = isOpaque;
|
||||
copy->bitsPerSample = bitsPerSample;
|
||||
copy->_pixelsWide = _pixelsWide;
|
||||
copy->_pixelsHigh = _pixelsHigh;
|
||||
copy->_colorSpace = RETAIN(_colorSpace);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[_colorSpace release];
|
||||
|
|
1180
Source/NSMatrix.m
1180
Source/NSMatrix.m
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue