* Headers/AppKit/NSTableView.h: Add ivar for

verticalMotionCanBeginDrag.
        * Source/NSTableView.m: Implement verticalMotionCanBeginDrag
        bump class version.
        * Source/NSTextView_actions.m: Fix method name from previous changes.
        * KeyBindings/DefaultKeyBindings.dict: Add new key bindings.
        * ChangeLog: Add to description of a previous change.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24067 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2006-11-10 13:40:28 +00:00
parent affd41f5b1
commit 1fcec7ffe9
5 changed files with 39 additions and 32 deletions

View file

@ -1,3 +1,12 @@
2006-11-10 Matt Rice <ratmice@gmail.com>
* Headers/AppKit/NSTableView.h: Add ivar for
verticalMotionCanBeginDrag.
* Source/NSTableView.m: Implement verticalMotionCanBeginDrag
bump class version.
* Source/NSTextView_actions.m: Fix method name from previous changes.
* KeyBindings/DefaultKeyBindings.dict: Add new key bindings.
* ChangeLog: Add to description of a previous change.
2006-11-09 Matt Rice <ratmice@gmail.com>
@ -26,7 +35,8 @@
2006-11-06 Matt Rice <ratmice@yahoo.com>
* Source/NSTextView_actions.m: Fix keyboard movement scrolling.
* Source/NSTextView_actions.m: Fix keyboard movement scrolling
when selecting text off the bottom or right of the visible area.
2006-11-06 Matt Rice <ratmice@yahoo.com>

View file

@ -91,6 +91,7 @@ enum {
NSCell *_editedCell;
BOOL _autosaveTableColumns;
NSString *_autosaveName;
BOOL _verticalMotionDrag;
/*
* Ivars Acting as Cache

View file

@ -10,6 +10,11 @@
"Control-DownArrow" = "pageDown:";
"Control-LeftArrow" = "moveToBeginningOfLine:";
"Control-RightArrow" = "moveToEndOfLine:";
"Control-Shift-LeftArrow" = "moveToBeginningOfLineAndModifySelection:";
"Control-Shift-RightArrow" = "moveToEndOfLineAndModifySelection:";
"Control-Shift-UpArrow" = "moveToBeginningOfDocumentAndModifySelection:";
"Control-Shift-DownArrow" = "moveToEndOfDocumentAndModifySelection:";
/* "Alternate-UpArrow" = ("moveUp:", "moveWordBackward:"); */
/* "Alternate-DownArrow" = ("moveDown:", "moveWordForward:"); */
@ -40,6 +45,9 @@
/* "Shift-End" = "moveToEndOfParagraphAndModifySelection:"; */
"PageUp" = "pageUp:";
"PageDown" = "pageDown:";
"Shift-PageDown" = "pageDownAndModifySelection:";
"Shift-PageUp" = "pageUpAndModifySelection:";
/* Emacs Control keybindings */
"Control-a" = "moveToBeginningOfLine:";

View file

@ -64,7 +64,7 @@
#include <math.h>
static NSNotificationCenter *nc = nil;
static const int currentVersion = 3;
static const int currentVersion = 4;
static NSRect oldDraggingRect;
static int oldDropRow;
@ -3657,31 +3657,16 @@ static inline float computePeriod(NSPoint mouseLocationWin,
if (draggingPossible == YES)
{
if (mouseLocationWin.y - initialLocation.y > 2
|| mouseLocationWin.y - initialLocation.y < -2)
if ([_selectedRows containsIndex:_clickedRow] == NO
|| (_verticalMotionDrag == NO
&& fabs(mouseLocationWin.y - initialLocation.y) > 2))
{
draggingPossible = NO;
}
else if (fabs(mouseLocationWin.x - initialLocation.x) >= 4)
else if ((fabs(mouseLocationWin.x - initialLocation.x) >= 4)
|| (_verticalMotionDrag
&& fabs(mouseLocationWin.y - initialLocation.y) >= 4))
{
mouseLocationView.x = _bounds.origin.x;
oldRow = currentRow;
currentRow = [self rowAtPoint: mouseLocationView];
if (![_selectedRows containsIndex: currentRow])
{
/* Mouse drag in a row that wasn't selected.
select the new row before dragging */
computeNewSelection(self,
oldSelectedRows,
_selectedRows,
originalRow,
oldRow,
currentRow,
&_selectedRow,
selectionMode);
}
if ([self _startDragOperationWithEvent: theEvent])
{
return;
@ -5507,17 +5492,12 @@ static BOOL selectContiguousRegion(NSTableView *self,
- (void) setVerticalMotionCanBeginDrag: (BOOL)flag
{
// TODO
NSLog(@"Method %s is not implemented for class %s",
"setVerticalMotionCanBeginDrag:", "NSTableView");
_verticalMotionDrag = flag;
}
- (BOOL) verticalMotionCanBeginDrag
{
// TODO
NSLog(@"Method %s is not implemented for class %s",
"verticalMotionCanBeginDrag", "NSTableView");
return NO;
return _verticalMotionDrag;
}
/*
@ -5606,6 +5586,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit];
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_verticalMotionDrag];
}
}
@ -5744,6 +5725,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
int version = [aDecoder versionForClassName:
@"NSTableView"];
id aDelegate;
_verticalMotionDrag = NO;
_dataSource = [aDecoder decodeObject];
_tableColumns = RETAIN([aDecoder decodeObject]);
@ -5770,7 +5752,7 @@ static BOOL selectContiguousRegion(NSTableView *self,
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsEmptySelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnSelection];
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnResizing];
if (version == currentVersion)
if (version >= 3)
{
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_allowsColumnReordering];
}
@ -5779,6 +5761,12 @@ static BOOL selectContiguousRegion(NSTableView *self,
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_autoresizesAllColumnsToFit];
}
if (version >= 4)
{
[aDecoder decodeValueOfObjCType: @encode(BOOL) at: &_verticalMotionDrag];
}
ASSIGN (_selectedColumns, [NSMutableIndexSet indexSet]);
ASSIGN (_selectedRows, [NSMutableIndexSet indexSet]);
if (_numberOfColumns)

View file

@ -1066,7 +1066,7 @@ and layout is left-to-right */
select: NO];
}
- (void) moveToEndOfLineAndModify: (id)sender
- (void) moveToEndOfLineAndModifySelection: (id)sender
{
[self _move: GSInsertionPointMoveRight
distance: 1e8