fixed some remaining bugs in keyboard selection, reimported code for up/down keys handling
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18954 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2844,10 +2844,10 @@ BTextView::HandleArrowKey(uint32 inArrowKey)
|
|||||||
if (shiftDown) {
|
if (shiftDown) {
|
||||||
fClickOffset = PreviousInitialByte(fClickOffset);
|
fClickOffset = PreviousInitialByte(fClickOffset);
|
||||||
if (fClickOffset != currentOffset) {
|
if (fClickOffset != currentOffset) {
|
||||||
if (fClickOffset > fSelStart) {
|
if (fClickOffset >= fSelStart) {
|
||||||
selStart = fSelStart;
|
selStart = fSelStart;
|
||||||
selEnd = fClickOffset;
|
selEnd = fClickOffset;
|
||||||
} else if (fClickOffset < fSelStart) {
|
} else {
|
||||||
selStart = fClickOffset;
|
selStart = fClickOffset;
|
||||||
selEnd = fSelEnd;
|
selEnd = fSelEnd;
|
||||||
}
|
}
|
||||||
@@ -2861,10 +2861,10 @@ BTextView::HandleArrowKey(uint32 inArrowKey)
|
|||||||
if (shiftDown) {
|
if (shiftDown) {
|
||||||
fClickOffset = NextInitialByte(fClickOffset);
|
fClickOffset = NextInitialByte(fClickOffset);
|
||||||
if (fClickOffset != currentOffset) {
|
if (fClickOffset != currentOffset) {
|
||||||
if (fClickOffset < fSelEnd) {
|
if (fClickOffset <= fSelEnd) {
|
||||||
selStart = fClickOffset;
|
selStart = fClickOffset;
|
||||||
selEnd = fSelEnd;
|
selEnd = fSelEnd;
|
||||||
} else if (fClickOffset > fSelEnd) {
|
} else {
|
||||||
selStart = fSelStart;
|
selStart = fSelStart;
|
||||||
selEnd = fClickOffset;
|
selEnd = fClickOffset;
|
||||||
}
|
}
|
||||||
@@ -2879,6 +2879,12 @@ BTextView::HandleArrowKey(uint32 inArrowKey)
|
|||||||
BPoint point = PointAt(fClickOffset, &height);
|
BPoint point = PointAt(fClickOffset, &height);
|
||||||
point.y -= height;
|
point.y -= height;
|
||||||
fClickOffset = OffsetAt(point);
|
fClickOffset = OffsetAt(point);
|
||||||
|
if (shiftDown) {
|
||||||
|
if (fClickOffset > fSelStart)
|
||||||
|
selEnd = fClickOffset;
|
||||||
|
else
|
||||||
|
selStart = fClickOffset;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2888,6 +2894,12 @@ BTextView::HandleArrowKey(uint32 inArrowKey)
|
|||||||
BPoint point = PointAt(fClickOffset, &height);
|
BPoint point = PointAt(fClickOffset, &height);
|
||||||
point.y += height;
|
point.y += height;
|
||||||
fClickOffset = OffsetAt(point);
|
fClickOffset = OffsetAt(point);
|
||||||
|
if (shiftDown) {
|
||||||
|
if (fClickOffset < fSelEnd)
|
||||||
|
selStart = fClickOffset;
|
||||||
|
else
|
||||||
|
selEnd = fClickOffset;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2902,6 +2914,7 @@ BTextView::HandleArrowKey(uint32 inArrowKey)
|
|||||||
Select(fClickOffset, fClickOffset);
|
Select(fClickOffset, fClickOffset);
|
||||||
|
|
||||||
fClickOffset = currentOffset;
|
fClickOffset = currentOffset;
|
||||||
|
// Select sets fClickOffset = fSelEnd
|
||||||
|
|
||||||
// scroll if needed
|
// scroll if needed
|
||||||
ScrollToOffset(fClickOffset);
|
ScrollToOffset(fClickOffset);
|
||||||
|
|||||||
Reference in New Issue
Block a user