MCPcopy Create free account
hub / github.com/cxasm/notepad-- / ButtonMoveWithModifiers

Method ButtonMoveWithModifiers

src/qscint/scintilla/src/Editor.cpp:4735–4858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4733}
4734
4735void Editor::ButtonMoveWithModifiers(Point pt, unsigned int, int modifiers) {
4736 if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
4737 DwellEnd(true);
4738 }
4739
4740 SelectionPosition movePos = SPositionFromLocation(pt, false, false,
4741 AllowVirtualSpace(virtualSpaceOptions, sel.IsRectangular()));
4742 movePos = MovePositionOutsideChar(movePos, sel.MainCaret() - movePos.Position());
4743
4744 if (inDragDrop == ddInitial) {
4745 if (DragThreshold(ptMouseLast, pt)) {
4746 SetMouseCapture(false);
4747 FineTickerCancel(tickScroll);
4748 SetDragPosition(movePos);
4749 CopySelectionRange(&drag);
4750 StartDrag();
4751 }
4752 return;
4753 }
4754
4755 ptMouseLast = pt;
4756 PRectangle rcClient = GetClientRectangle();
4757 const Point ptOrigin = GetVisibleOriginInMain();
4758 rcClient.Move(0, -ptOrigin.y);
4759 if ((dwellDelay < SC_TIME_FOREVER) && rcClient.Contains(pt)) {
4760 FineTickerStart(tickDwell, dwellDelay, dwellDelay/10);
4761 }
4762 //Platform::DebugPrintf("Move %d %d\n", pt.x, pt.y);
4763 if (HaveMouseCapture()) {
4764
4765 // Slow down autoscrolling/selection
4766 autoScrollTimer.ticksToWait -= timer.tickSize;
4767 if (autoScrollTimer.ticksToWait > 0)
4768 return;
4769 autoScrollTimer.ticksToWait = autoScrollDelay;
4770
4771 // Adjust selection
4772 if (posDrag.IsValid()) {
4773 SetDragPosition(movePos);
4774 } else {
4775 if (selectionType == selChar) {
4776 if (sel.selType == Selection::selStream && (modifiers & SCI_ALT) && mouseSelectionRectangularSwitch) {
4777 sel.selType = Selection::selRectangle;
4778 }
4779 if (sel.IsRectangular()) {
4780 sel.Rectangular() = SelectionRange(movePos, sel.Rectangular().anchor);
4781 SetSelection(movePos, sel.RangeMain().anchor);
4782 } else if (sel.Count() > 1) {
4783 InvalidateSelection(sel.RangeMain(), false);
4784 const SelectionRange range(movePos, sel.RangeMain().anchor);
4785 sel.TentativeSelection(range);
4786 InvalidateSelection(range, true);
4787 } else {
4788 SetSelection(movePos, sel.RangeMain().anchor);
4789 }
4790 } else if (selectionType == selWord) {
4791 // Continue selecting by word
4792 if (movePos.Position() == wordSelectInitialCaretPos) { // Didn't move

Callers 1

mouseMoveEventMethod · 0.80

Calls 11

AllowVirtualSpaceFunction · 0.85
SelectionRangeClass · 0.85
IsRectangularMethod · 0.80
MainCaretMethod · 0.80
PositionMethod · 0.80
CountMethod · 0.80
TentativeSelectionMethod · 0.80
ValidMethod · 0.80
MoveMethod · 0.45
ContainsMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected