* Source/NSTableHeaderView.m: Use resize cursors

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33042 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-05-15 05:48:22 +00:00
parent 7e17fa5ca5
commit 360c974c4e
2 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2011-05-14 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSTableHeaderView.m: Use resize cursors
2011-05-14 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSTextView.m: Use IBeam cursor if selectable

View file

@ -41,6 +41,7 @@
#import "AppKit/NSEvent.h"
#import "AppKit/NSApplication.h"
#import "AppKit/NSColor.h"
#import "AppKit/NSCursor.h"
#import "AppKit/NSScrollView.h"
#import "AppKit/NSGraphics.h"
#import "GSGuiPrivate.h"
@ -170,6 +171,29 @@
inView: self];
}
- (void) resetCursorRects
{
if ([[self tableView] allowsColumnResizing])
{
const NSRect visibleRect = [self visibleRect];
NSInteger i;
const NSInteger count = [[[self tableView] tableColumns] count];
for (i = 0; i < (count - 1) && (count > 0); i++)
{
NSRect resizeRect = [self headerRectOfColumn: i];
resizeRect.origin.x = NSMaxX(resizeRect) - mouse_sensitivity;
resizeRect.size.width = 2 * mouse_sensitivity;
resizeRect = NSIntersectionRect(resizeRect, visibleRect);
if (!NSEqualRects(NSZeroRect, resizeRect))
{
[self addCursorRect: resizeRect cursor: [NSCursor resizeLeftRightCursor]];
}
}
}
}
/**
* In -mouseDown we intercept the mouse event to handle the
* colum resize and rearrangement. Resizing or moving columns
@ -287,6 +311,8 @@
/* Do we need to check that we already fit into this area ?
We should */
[[NSCursor resizeLeftRightCursor] push];
if (!liveResize)
{
oldHighlightRect = NSZeroRect;
@ -375,6 +401,8 @@
}
[NSEvent stopPeriodicEvents];
[NSCursor pop];
if (!liveResize)
{
if (lit)