Added code for multiword selection. Currently it's disabled because it doesn't work due to some bugs in app server

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12794 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-05-23 22:07:50 +00:00
parent ee4e1e5076
commit 2753f0d240
+34 -8
View File
@@ -615,7 +615,7 @@ BTextView::MouseDown(BPoint where)
the cursor is in the view. the cursor is in the view.
\param where The point where the mouse button has been released. \param where The point where the mouse button has been released.
Doesn't do anything useful at the moment Stops asynchronous mouse tracking
*/ */
void void
BTextView::MouseUp(BPoint where) BTextView::MouseUp(BPoint where)
@@ -3886,10 +3886,14 @@ bool
BTextView::PerformMouseUp(BPoint where) BTextView::PerformMouseUp(BPoint where)
{ {
CALLED(); CALLED();
// TODO: Put here the code for asynchronous mouse tracking if (fClickRunner == NULL)
return false;
StopMouseTracking(); StopMouseTracking();
return false;
fClickOffset = OffsetAt(where);
return true;
} }
@@ -3900,12 +3904,34 @@ BTextView::PerformMouseMoved(BPoint where, uint32 code)
if (fClickRunner == NULL) if (fClickRunner == NULL)
return false; return false;
// TODO: Multiword/Line selection int32 start = 0, end = 0;
int32 offset = OffsetAt(where); int32 offset = OffsetAt(where);
if (offset < fClickOffset)
Select(offset, fClickOffset); int32 clickCount = 1;
else
Select(fClickOffset, offset); #if 0
Window()->CurrentMessage()->FindInt32("clicks", &clickCount);
#endif
switch (clickCount) {
case 1:
start = min_c(offset, fClickOffset);
end = max_c(offset, fClickOffset);
break;
case 2:
FindWord(offset, &start, &end);
break;
case 3:
//TODO: Multiline selection
break;
default:
break;
}
Select(start, end);
return true; return true;
} }