mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 10:21:00 +00:00
Correction for #bug9608 and bug#18073.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23931 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
56c7361744
commit
ae51b2739d
2 changed files with 69 additions and 6 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2006-10-21 11:30-EDT Matt Rice <ratmice@yahoo.com>
|
||||||
|
|
||||||
|
* Source/NSTableView.m: If the tableview is smaller than
|
||||||
|
it's clipview, then resize it so that it fits.
|
||||||
|
Corrects bug#9608 and bug#18073.
|
||||||
|
Patch committed by: Gregory Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
2006-10-19 21:17-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
2006-10-19 21:17-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/NSMenuItemCell.m: Correct menu highlighting issue
|
* Source/NSMenuItemCell.m: Correct menu highlighting issue
|
||||||
|
|
|
@ -3350,7 +3350,6 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
// Pathological case -- ignore mouse down
|
// Pathological case -- ignore mouse down
|
||||||
if ((_numberOfRows == 0) || (_numberOfColumns == 0))
|
if ((_numberOfRows == 0) || (_numberOfColumns == 0))
|
||||||
{
|
{
|
||||||
[super mouseDown: theEvent];
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3384,6 +3383,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
if (![self _isCellEditableColumn: _clickedColumn row: _clickedRow ])
|
if (![self _isCellEditableColumn: _clickedColumn row: _clickedRow ])
|
||||||
{
|
{
|
||||||
// Send double-action but don't edit
|
// Send double-action but don't edit
|
||||||
|
if (_clickedRow != -1)
|
||||||
[self sendAction: _doubleAction to: _target];
|
[self sendAction: _doubleAction to: _target];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3475,6 +3475,8 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
id originalValue;
|
id originalValue;
|
||||||
|
|
||||||
// Prepare the cell
|
// Prepare the cell
|
||||||
|
if (_clickedRow != -1)
|
||||||
|
{
|
||||||
tb = [_tableColumns objectAtIndex: _clickedColumn];
|
tb = [_tableColumns objectAtIndex: _clickedColumn];
|
||||||
/* we should copy the cell here, as we do on editing.
|
/* we should copy the cell here, as we do on editing.
|
||||||
otherwise validation on a cell being edited could
|
otherwise validation on a cell being edited could
|
||||||
|
@ -3521,6 +3523,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
[self setNeedsDisplayInRect: cellFrame];
|
[self setNeedsDisplayInRect: cellFrame];
|
||||||
lastEvent = [NSApp currentEvent];
|
lastEvent = [NSApp currentEvent];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
while (done != YES)
|
while (done != YES)
|
||||||
{
|
{
|
||||||
|
@ -3731,6 +3734,15 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
|
|
||||||
if (shouldComputeNewSelection == YES)
|
if (shouldComputeNewSelection == YES)
|
||||||
{
|
{
|
||||||
|
if (originalRow == -1)
|
||||||
|
{
|
||||||
|
originalRow = currentRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentRow == -1)
|
||||||
|
{
|
||||||
|
currentRow = _numberOfRows - 1;
|
||||||
|
}
|
||||||
computeNewSelection(self,
|
computeNewSelection(self,
|
||||||
oldSelectedRows,
|
oldSelectedRows,
|
||||||
_selectedRows,
|
_selectedRows,
|
||||||
|
@ -3769,6 +3781,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
TODO: should we ask the data source/column for the cell for this
|
TODO: should we ask the data source/column for the cell for this
|
||||||
row/column and check whether it has its own action/target?
|
row/column and check whether it has its own action/target?
|
||||||
*/
|
*/
|
||||||
|
if (_clickedRow != -1)
|
||||||
[self sendAction: _action to: _target];
|
[self sendAction: _action to: _target];
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -4002,7 +4015,42 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
|
|
||||||
- (void) setFrame: (NSRect)frameRect
|
- (void) setFrame: (NSRect)frameRect
|
||||||
{
|
{
|
||||||
[super setFrame: frameRect];
|
NSRect tmpRect = frameRect;
|
||||||
|
|
||||||
|
if ([_super_view respondsToSelector:@selector(documentRect)])
|
||||||
|
{
|
||||||
|
NSRect docRect = [(NSClipView *)_super_view documentRect];
|
||||||
|
|
||||||
|
if (docRect.size.height > tmpRect.size.height)
|
||||||
|
{
|
||||||
|
tmpRect.size.height = docRect.size.height;
|
||||||
|
}
|
||||||
|
// TODO width?
|
||||||
|
}
|
||||||
|
[super setFrame: tmpRect];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setFrameSize: (NSSize)frameSize
|
||||||
|
{
|
||||||
|
NSSize tmpSize = frameSize;
|
||||||
|
|
||||||
|
if ([_super_view respondsToSelector:@selector(documentRect)])
|
||||||
|
{
|
||||||
|
NSRect docRect = [(NSClipView *)_super_view documentRect];
|
||||||
|
if (docRect.size.height > tmpSize.height)
|
||||||
|
{
|
||||||
|
tmpSize.height = docRect.size.height;
|
||||||
|
}
|
||||||
|
// TODO width?
|
||||||
|
}
|
||||||
|
[super setFrameSize: tmpSize];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) viewWillMoveToSuperview:(NSView *)newSuper
|
||||||
|
{
|
||||||
|
[super viewWillMoveToSuperview:newSuper];
|
||||||
|
/* need to potentially enlarge to fill the documentRect of the clip view */
|
||||||
|
[self setFrame:_frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) sizeToFit
|
- (void) sizeToFit
|
||||||
|
@ -5697,6 +5745,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
}
|
}
|
||||||
_superview_width = visible_width;
|
_superview_width = visible_width;
|
||||||
}
|
}
|
||||||
|
[self setFrame:_frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5803,7 +5852,14 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
|
|
||||||
[[NSColor darkGrayColor] set];
|
[[NSColor darkGrayColor] set];
|
||||||
|
|
||||||
if (currentDropOperation == NSTableViewDropAbove)
|
if (currentDropRow > _numberOfRows)
|
||||||
|
{
|
||||||
|
newRect = [self bounds];
|
||||||
|
NSFrameRectWithWidth(newRect, 2.0);
|
||||||
|
oldDraggingRect = newRect;
|
||||||
|
currentDropRow = _numberOfRows;
|
||||||
|
}
|
||||||
|
else if (currentDropOperation == NSTableViewDropAbove)
|
||||||
{
|
{
|
||||||
if (currentDropRow == 0)
|
if (currentDropRow == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue