mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 22:00:10 +02:00
SynEdit: more MouseActions tuning. Do not let emcStartDrag prevent up-clicks, if no drag ever started.
git-svn-id: trunk@48163 -
This commit is contained in:
parent
a1c02e40de
commit
f707710907
@ -519,6 +519,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -519,6 +519,10 @@ msgstr "Výběr sloupce"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Uchop výběr"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Výběr řádky"
|
||||
|
@ -522,6 +522,10 @@ msgstr "Spaltenmodus"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Auswahl verschieben"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Zeilenmodus"
|
||||
|
@ -517,6 +517,10 @@ msgstr "Selección de columna"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Arrastre la selección"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Selección de línea"
|
||||
|
@ -512,6 +512,10 @@ msgstr "Sarakevalinta"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Vedä valinta"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Rivivalinta"
|
||||
|
@ -518,6 +518,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -517,6 +517,10 @@ msgstr "בחירת עמודה"
|
||||
msgid "Drag Selection"
|
||||
msgstr "גרור את הבחירה"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "בחירת שורה"
|
||||
|
@ -519,6 +519,10 @@ msgstr "Oszlop kijelölés"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Kijelölés húzása"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Sor kijelölés"
|
||||
|
@ -522,6 +522,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -520,6 +520,10 @@ msgstr "Scegli colonna"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Trascina la selezione"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Selezione riga"
|
||||
|
@ -520,6 +520,10 @@ msgstr "Stulpelio žymėjimas"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Vilkti atranką"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Eilutės žymėjimas"
|
||||
|
@ -519,6 +519,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -523,6 +523,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Zaznaczenie wiersza"
|
||||
|
@ -509,6 +509,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -518,6 +518,10 @@ msgstr "Seleção Coluna"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Arrastar Seleção"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Seleção Linha"
|
||||
|
@ -518,6 +518,10 @@ msgstr "Выделение столбца"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Перетаскивание выделенного"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Выбор строки"
|
||||
|
@ -520,6 +520,10 @@ msgstr "Вибір Стовпчика"
|
||||
msgid "Drag Selection"
|
||||
msgstr "Вибір Перетягування"
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr "Вибір Рядка"
|
||||
|
@ -522,6 +522,10 @@ msgstr ""
|
||||
msgid "Drag Selection"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartdragmove_opt
|
||||
msgid "Caret on up if not dragged, No Caret on up if not dragged"
|
||||
msgstr ""
|
||||
|
||||
#: syneditstrconst.syns_emcstartlineselections
|
||||
msgid "Line Selection"
|
||||
msgstr ""
|
||||
|
@ -188,7 +188,7 @@ type
|
||||
// Mouse-states
|
||||
sfLeftGutterClick, sfRightGutterClick,
|
||||
sfInClick, sfDblClicked, sfTripleClicked, sfQuadClicked,
|
||||
sfWaitForDragging, sfIsDragging, sfWaitForMouseSelecting, sfMouseSelecting, sfMouseDoneSelecting,
|
||||
sfWaitForDragging, sfWaitForDraggingNoCaret, sfIsDragging, sfWaitForMouseSelecting, sfMouseSelecting, sfMouseDoneSelecting,
|
||||
sfIgnoreUpClick,
|
||||
sfSelChanged
|
||||
); //mh 2000-10-30
|
||||
@ -3205,6 +3205,8 @@ begin
|
||||
begin
|
||||
if SelAvail and (SelectionMode = smNormal) then begin
|
||||
Include(fStateFlags, sfWaitForDragging);
|
||||
if AnAction.Option = emcoNotDragedNoCaretOnUp then
|
||||
Include(fStateFlags, sfWaitForDraggingNoCaret);
|
||||
MouseCapture := True;
|
||||
ResetMouseCapture := False;
|
||||
end
|
||||
@ -3441,7 +3443,7 @@ begin
|
||||
fStateFlags := fStateFlags - [sfDblClicked, sfTripleClicked, sfQuadClicked,
|
||||
sfLeftGutterClick, sfRightGutterClick,
|
||||
sfWaitForMouseSelecting, sfMouseSelecting, sfMouseDoneSelecting,
|
||||
sfWaitForDragging, sfIgnoreUpClick
|
||||
sfWaitForDragging, sfWaitForDraggingNoCaret, sfIgnoreUpClick
|
||||
];
|
||||
|
||||
Include(fStateFlags, sfInClick);
|
||||
@ -3516,7 +3518,7 @@ begin
|
||||
or (Abs(fMouseDownY - Y) >= GetSystemMetrics(SM_CYDRAG))
|
||||
then begin
|
||||
FStateFlags := FStateFlags
|
||||
-[sfWaitForDragging, sfWaitForMouseSelecting, sfMouseSelecting]
|
||||
-[sfWaitForDragging, sfWaitForDraggingNoCaret, sfWaitForMouseSelecting, sfMouseSelecting]
|
||||
+ [sfIsDragging];
|
||||
FBlockSelection.StickyAutoExtend := False;
|
||||
//debugln('TCustomSynEdit.MouseMove BeginDrag');
|
||||
@ -3724,7 +3726,7 @@ begin
|
||||
CType := ccSingle;
|
||||
fStateFlags:=fStateFlags - [sfInClick, sfDblClicked,sfTripleClicked,sfQuadClicked];
|
||||
|
||||
if sfWaitForDragging in fStateFlags then
|
||||
if fStateFlags * [sfWaitForDragging, sfWaitForDraggingNoCaret] = [sfWaitForDragging] then
|
||||
begin
|
||||
ComputeCaret(X, Y);
|
||||
SetBlockBegin(LogicalCaretXY);
|
||||
|
@ -157,6 +157,7 @@ type
|
||||
property IgnoreUpClick: Boolean read FIgnoreUpClick write SetIgnoreUpClick default False; // only for mouse down
|
||||
property Option: TSynEditorMouseCommandOpt read FOption write SetOption default 0;
|
||||
property Option2: Integer read FOption2 write SetOption2 default 0;
|
||||
// Priority: 0 = highest / MaxInt = lowest
|
||||
property Priority: TSynEditorMouseCommandOpt read FPriority write SetPriority default 0;
|
||||
end;
|
||||
|
||||
@ -313,6 +314,9 @@ const
|
||||
emcoMouseLinkShow = TSynEditorMouseCommandOpt(0);
|
||||
emcoMouseLinkHide = TSynEditorMouseCommandOpt(1);
|
||||
|
||||
emcoNotDragedSetCaretOnUp = TSynEditorMouseCommandOpt(0);
|
||||
emcoNotDragedNoCaretOnUp = TSynEditorMouseCommandOpt(1);
|
||||
|
||||
emcoCodeFoldCollapsOne = TSynEditorMouseCommandOpt(0);
|
||||
emcoCodeFoldCollapsAll = TSynEditorMouseCommandOpt(1);
|
||||
emcoCodeFoldCollapsAtCaret = TSynEditorMouseCommandOpt(2);
|
||||
@ -480,6 +484,7 @@ begin
|
||||
emcStartLineSelectionsNoneEmpty: Result := SYNS_emcSelection_opt;
|
||||
emcSelectLine: Result := SYNS_emcSelectLine_opt;
|
||||
emcMouseLink: Result := SYNS_emcMouseLink_opt;
|
||||
emcStartDragMove: Result := SYNS_emcStartDragMove_opt;
|
||||
emcCodeFoldCollaps: Result := SYNS_emcCodeFoldCollaps_opt;
|
||||
emcCodeFoldExpand: Result := SYNS_emcCodeFoldExpand_opt;
|
||||
emcContextMenu: Result := SYNS_emcContextMenuCaretMove_opt;
|
||||
|
@ -411,6 +411,7 @@ resourcestring
|
||||
SYNS_emcPasteSelection = 'Quick Paste Selection';
|
||||
SYNS_emcMouseLink = 'Source Link';
|
||||
SYNS_emcMouseLink_opt = 'Underline,yes, no';
|
||||
SYNS_emcStartDragMove_opt = 'Caret on up if not dragged, No Caret on up if not dragged';
|
||||
SYNS_emcContextMenu = 'Popup Menu';
|
||||
SYNS_emcBreakPointToggle = 'Toggle Breakpoint';
|
||||
SYNS_emcCodeFoldCollaps = 'Fold Code';
|
||||
|
@ -1522,6 +1522,7 @@ begin
|
||||
Result := False;
|
||||
|
||||
if AnAction.Command = emcPluginMultiCaretToggleCaret then begin
|
||||
Result := True;
|
||||
i := Carets.FindCaretIdx(AnInfo.NewCaret.BytePos, AnInfo.NewCaret.LinePos);
|
||||
if i >= 0 then
|
||||
RemoveCaret(i)
|
||||
|
@ -3494,7 +3494,7 @@ procedure TEditorMouseOptions.ResetTextToDefault;
|
||||
mbaContextMenuTab:
|
||||
AddCommand(emcContextMenu, True, AButton, AClickCount, ADir, AShift, AShiftMask, emcoSelectionCaretMoveOutside, 0, 2);
|
||||
mbaMultiCaretToggle:
|
||||
AddCommand(emcPluginMultiCaretToggleCaret, True, AButton, AClickCount, ADir, AShift, AShiftMask, 0, 0, 0);
|
||||
AddCommand(emcPluginMultiCaretToggleCaret, False, AButton, AClickCount, ADir, AShift, AShiftMask);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -3685,8 +3685,9 @@ begin
|
||||
|
||||
if FTextDrag then
|
||||
with FSelActions do begin
|
||||
AddCommand(emcStartDragMove, False, mbXLeft, ccSingle, cdDown, [], []);
|
||||
AddCommand(emcStartDragMove, False, mbXLeft, ccSingle, cdDown, [], [], emcoNotDragedNoCaretOnUp);
|
||||
end;
|
||||
FTextActions.AddCommand(emcNone, True, mbXLeft, ccSingle, cdUp, [], [], 0, 99);
|
||||
end;
|
||||
|
||||
procedure TEditorMouseOptions.ResetToUserScheme;
|
||||
|
Loading…
Reference in New Issue
Block a user