mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-03 18:30:51 +00:00
Merge NSCell.m with GUI trunk revision 40273
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e5a5d5cd5
commit
d6373fd31b
1 changed files with 26 additions and 5 deletions
|
@ -1655,8 +1655,15 @@ static NSColor *dtxtCol;
|
||||||
NSStringFromRect(cellFrame), point.x, point.y);
|
NSStringFromRect(cellFrame), point.x, point.y);
|
||||||
|
|
||||||
_mouse_down_flags = [theEvent modifierFlags];
|
_mouse_down_flags = [theEvent modifierFlags];
|
||||||
if (![self startTrackingAt: point inView: controlView])
|
if (![self isEnabled])
|
||||||
|
{
|
||||||
return NO;
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![self startTrackingAt: point inView: controlView])
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
if (![controlView mouse: point inRect: cellFrame])
|
if (![controlView mouse: point inRect: cellFrame])
|
||||||
return NO; // point is not in cell
|
return NO; // point is not in cell
|
||||||
|
@ -1665,7 +1672,7 @@ static NSColor *dtxtCol;
|
||||||
&& [theEvent type] == NSLeftMouseDown)
|
&& [theEvent type] == NSLeftMouseDown)
|
||||||
[self _sendActionFrom: controlView];
|
[self _sendActionFrom: controlView];
|
||||||
|
|
||||||
if (_action_mask & NSPeriodicMask)
|
if ([self isContinuous])
|
||||||
{
|
{
|
||||||
[self getPeriodicDelay: &delay interval: &interval];
|
[self getPeriodicDelay: &delay interval: &interval];
|
||||||
[NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval];
|
[NSEvent startPeriodicEventsAfterDelay: delay withPeriod: interval];
|
||||||
|
@ -1771,8 +1778,10 @@ static NSColor *dtxtCol;
|
||||||
inView: controlView
|
inView: controlView
|
||||||
mouseIsUp: mouseWentUp];
|
mouseIsUp: mouseWentUp];
|
||||||
|
|
||||||
if (_action_mask & NSPeriodicMask)
|
if ([self isContinuous])
|
||||||
|
{
|
||||||
[NSEvent stopPeriodicEvents];
|
[NSEvent stopPeriodicEvents];
|
||||||
|
}
|
||||||
|
|
||||||
if (mouseWentUp)
|
if (mouseWentUp)
|
||||||
{
|
{
|
||||||
|
@ -1823,8 +1832,14 @@ static NSColor *dtxtCol;
|
||||||
|
|
||||||
case NSNullCellType:
|
case NSNullCellType:
|
||||||
default:
|
default:
|
||||||
|
if (_cell.is_disabled == NO)
|
||||||
|
{
|
||||||
|
hitResult = NSCellHitContentArea | NSCellHitTrackableArea;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
hitResult = NSCellHitContentArea;
|
hitResult = NSCellHitContentArea;
|
||||||
// FIXME: If the cell not disabled, and it would track, OR in NSCellHitTrackableArea...
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2335,6 +2350,7 @@ static NSColor *dtxtCol;
|
||||||
_cell.shows_first_responder = YES;
|
_cell.shows_first_responder = YES;
|
||||||
_cell.in_editing = YES;
|
_cell.in_editing = YES;
|
||||||
|
|
||||||
|
// TESTPLANT-MAL-12282916: Paul Landers added this code...need to keep it...
|
||||||
if ([textObject isKindOfClass:[NSTextView class]])
|
if ([textObject isKindOfClass:[NSTextView class]])
|
||||||
{
|
{
|
||||||
NSCellUndoManager * undoManager = [[NSCellUndoManager alloc] init];
|
NSCellUndoManager * undoManager = [[NSCellUndoManager alloc] init];
|
||||||
|
@ -3069,6 +3085,7 @@ static NSColor *dtxtCol;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TESTPLANT-MAL-12282016: Keeping branch code...
|
||||||
- (NSAttributedString*)_resizeAttributedString: (NSAttributedString*)attrstring forRect:(NSRect)titleRect
|
- (NSAttributedString*)_resizeAttributedString: (NSAttributedString*)attrstring forRect:(NSRect)titleRect
|
||||||
{
|
{
|
||||||
// Redo string based on selected truncation mask...
|
// Redo string based on selected truncation mask...
|
||||||
|
@ -3140,8 +3157,10 @@ static NSColor *dtxtCol;
|
||||||
*/
|
*/
|
||||||
aRect.origin.y = NSMidY (aRect) - titleSize.height/2;
|
aRect.origin.y = NSMidY (aRect) - titleSize.height/2;
|
||||||
aRect.size.height = titleSize.height;
|
aRect.size.height = titleSize.height;
|
||||||
|
// TESTPLANT-MAL-12282016: Keeping branch code...
|
||||||
aString = [self _resizeAttributedString:aString forRect:aRect];
|
aString = [self _resizeAttributedString:aString forRect:aRect];
|
||||||
|
|
||||||
|
// TESTPLANT-MAL-12282016: Keeping branch code...
|
||||||
[aString drawWithRect: aRect options: NSStringDrawingUsesLineFragmentOrigin];
|
[aString drawWithRect: aRect options: NSStringDrawingUsesLineFragmentOrigin];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3163,6 +3182,7 @@ static NSColor *dtxtCol;
|
||||||
*/
|
*/
|
||||||
cellFrame.origin.y = NSMidY (cellFrame) - titleSize.height/2;
|
cellFrame.origin.y = NSMidY (cellFrame) - titleSize.height/2;
|
||||||
cellFrame.size.height = titleSize.height;
|
cellFrame.size.height = titleSize.height;
|
||||||
|
// TESTPLANT-MAL-12282016: Keeping branch code...
|
||||||
aString = [self _resizeDrawString:aString withAttrbutes:attributes forRect:cellFrame];
|
aString = [self _resizeDrawString:aString withAttrbutes:attributes forRect:cellFrame];
|
||||||
|
|
||||||
[aString drawInRect: cellFrame withAttributes: attributes];
|
[aString drawInRect: cellFrame withAttributes: attributes];
|
||||||
|
@ -3187,6 +3207,7 @@ static NSColor *dtxtCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private helper method
|
// Private helper method
|
||||||
|
// TESTPLANT-MAL-12282016: Keeping branch code...
|
||||||
- (void) _drawFocusRingWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
- (void) _drawFocusRingWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||||
{
|
{
|
||||||
BOOL inFocus = NO;
|
BOOL inFocus = NO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue