aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Editor.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-08-15 15:13:15 +1000
committerNeil <nyamatongwe@gmail.com>2013-08-15 15:13:15 +1000
commit2b08c6ee48f984b99165a156690dfcf4c67fea21 (patch)
tree87a806590e7d7e4a4aee9ebdaa97ab41fa022dc1 /src/Editor.cxx
parenta499680e07e1eeb55d23bbf1f61dde535d5beb78 (diff)
downloadscintilla-mirror-2b08c6ee48f984b99165a156690dfcf4c67fea21.tar.gz
Feature: [feature-requests:#1007]. Option to allow mouse selection to
switch to rectangular by pressing Alt after start of gesture. From Neomi.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r--src/Editor.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 45a88711f..3a30c52a4 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -169,6 +169,7 @@ Editor::Editor() {
endAtLastLine = true;
caretSticky = SC_CARETSTICKY_OFF;
marginOptions = SC_MARGINOPTION_NONE;
+ mouseSelectionRectangularSwitch = false;
multipleSelection = false;
additionalSelectionTyping = false;
multiPasteMode = SC_MULTIPASTE_ONCE;
@@ -6495,7 +6496,7 @@ void Editor::GetHotSpotRange(int &hsStart_, int &hsEnd_) const {
hsEnd_ = hsEnd;
}
-void Editor::ButtonMove(Point pt) {
+void Editor::ButtonMoveWithModifiers(Point pt, int modifiers) {
if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
DwellEnd(true);
}
@@ -6529,6 +6530,9 @@ void Editor::ButtonMove(Point pt) {
SetDragPosition(movePos);
} else {
if (selectionType == selChar) {
+ if (sel.selType == Selection::selStream && (modifiers & SCI_ALT) && mouseSelectionRectangularSwitch) {
+ sel.selType = Selection::selRectangle;
+ }
if (sel.IsRectangular()) {
sel.Rectangular() = SelectionRange(movePos, sel.Rectangular().anchor);
SetSelection(movePos, sel.RangeMain().anchor);
@@ -6607,6 +6611,10 @@ void Editor::ButtonMove(Point pt) {
}
}
+void Editor::ButtonMove(Point pt) {
+ ButtonMoveWithModifiers(pt, 0);
+}
+
void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
//Platform::DebugPrintf("ButtonUp %d %d\n", HaveMouseCapture(), inDragDrop);
SelectionPosition newPos = SPositionFromLocation(pt, false, false,
@@ -9389,6 +9397,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
pdoc->AddUndoAction(wParam, lParam & UNDO_MAY_COALESCE);
break;
+ case SCI_SETMOUSESELECTIONRECTANGULARSWITCH:
+ mouseSelectionRectangularSwitch = wParam != 0;
+ break;
+
+ case SCI_GETMOUSESELECTIONRECTANGULARSWITCH:
+ return mouseSelectionRectangularSwitch;
+
case SCI_SETMULTIPLESELECTION:
multipleSelection = wParam != 0;
InvalidateCaret();