mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 21:41:35 +02:00
synedit: carbon: ctrl mouse links now use Cmd under carbon
git-svn-id: trunk@16488 -
This commit is contained in:
parent
391e62dbb5
commit
859ec0bba3
@ -219,7 +219,7 @@ type
|
|||||||
eoDoubleClickSelectsLine, // Select line on double click
|
eoDoubleClickSelectsLine, // Select line on double click
|
||||||
eoHideRightMargin, // Hides the right margin line
|
eoHideRightMargin, // Hides the right margin line
|
||||||
eoPersistentCaret, // Do not hide caret when focus lost
|
eoPersistentCaret, // Do not hide caret when focus lost
|
||||||
eoShowCtrlMouseLinks, // Pressing Ctrl will highlight the word under the mouse cursor
|
eoShowCtrlMouseLinks, // Pressing Ctrl (SYNEDIT_LINK_MODIFIER) will highlight the word under the mouse cursor
|
||||||
eoAutoIndentOnPaste, // Indent text inserted from clipboard
|
eoAutoIndentOnPaste, // Indent text inserted from clipboard
|
||||||
eoSpacesToTabs // Converts space characters to tabs and spaces
|
eoSpacesToTabs // Converts space characters to tabs and spaces
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -253,6 +253,8 @@ const
|
|||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
SYNEDIT_DEFAULT_OPTIONS2 = [
|
SYNEDIT_DEFAULT_OPTIONS2 = [
|
||||||
];
|
];
|
||||||
|
|
||||||
|
SYNEDIT_LINK_MODIFIER = {$IFDEF LCLcarbon}ssMeta{$ELSE}ssCtrl{$ENDIF};
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -2253,7 +2255,7 @@ begin
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
inherited;
|
inherited;
|
||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
if fLastControlIsPressed<>(GetKeyShiftState=[ssCtrl]) then
|
if fLastControlIsPressed<>(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]) then
|
||||||
UpdateCtrlMouse;
|
UpdateCtrlMouse;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Data := nil;
|
Data := nil;
|
||||||
@ -2285,7 +2287,7 @@ begin
|
|||||||
,' Shift=',ssShift in Shift,' Ctrl=',ssCtrl in Shift,' Alt=',ssAlt in Shift);
|
,' Shift=',ssShift in Shift,' Ctrl=',ssCtrl in Shift,' Alt=',ssAlt in Shift);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
inherited KeyUp(Key, Shift);
|
inherited KeyUp(Key, Shift);
|
||||||
if fLastControlIsPressed<>(GetKeyShiftState=[ssCtrl]) then
|
if fLastControlIsPressed<>(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]) then
|
||||||
UpdateCtrlMouse;
|
UpdateCtrlMouse;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -2514,7 +2516,7 @@ begin
|
|||||||
and (Y >= 0)
|
and (Y >= 0)
|
||||||
and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF})
|
and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF})
|
||||||
then begin
|
then begin
|
||||||
if (Cursor <> crHandPoint) or (not (ssCtrl in Shift)) then
|
if (Cursor <> crHandPoint) or (not (SYNEDIT_LINK_MODIFIER in Shift)) then
|
||||||
Cursor := crIBeam;
|
Cursor := crIBeam;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -2741,7 +2743,7 @@ begin
|
|||||||
{$IFDEF SYN_LAZARUS}
|
{$IFDEF SYN_LAZARUS}
|
||||||
if (eoShowCtrlMouseLinks in Options)
|
if (eoShowCtrlMouseLinks in Options)
|
||||||
and not(wasDragging)
|
and not(wasDragging)
|
||||||
and (Button=mbLeft) and (ssCtrl in Shift)
|
and (Button=mbLeft) and (SYNEDIT_LINK_MODIFIER in Shift)
|
||||||
and assigned(FOnClickLink)
|
and assigned(FOnClickLink)
|
||||||
then begin
|
then begin
|
||||||
FOnClickLink(Self, Button, Shift, X,Y);;
|
FOnClickLink(Self, Button, Shift, X,Y);;
|
||||||
@ -6884,7 +6886,7 @@ procedure TCustomSynEdit.UpdateCtrlMouse;
|
|||||||
var
|
var
|
||||||
NewY, NewX1, NewX2: integer;
|
NewY, NewX1, NewX2: integer;
|
||||||
begin
|
begin
|
||||||
fLastControlIsPressed:=(GetKeyShiftState=[ssCtrl]);
|
fLastControlIsPressed:=(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]);
|
||||||
if (eoShowCtrlMouseLinks in Options) and fLastControlIsPressed
|
if (eoShowCtrlMouseLinks in Options) and fLastControlIsPressed
|
||||||
and (fLastMouseCaret.X>0) and (fLastMouseCaret.Y>0) then begin
|
and (fLastMouseCaret.X>0) and (fLastMouseCaret.Y>0) then begin
|
||||||
// show link
|
// show link
|
||||||
|
@ -450,7 +450,7 @@ type
|
|||||||
property SynEditOptions2: TSynEditorOptions2
|
property SynEditOptions2: TSynEditorOptions2
|
||||||
read fSynEditOptions2 write fSynEditOptions2 default SynEditDefaultOptions2;
|
read fSynEditOptions2 write fSynEditOptions2 default SynEditDefaultOptions2;
|
||||||
property CtrlMouseLinks: Boolean
|
property CtrlMouseLinks: Boolean
|
||||||
read fCtrlMouseLinks write fCtrlMouseLinks;
|
read fCtrlMouseLinks write fCtrlMouseLinks;// ctrl = SYNEDIT_LINK_MODIFIER
|
||||||
property ShowTabCloseButtons: Boolean
|
property ShowTabCloseButtons: Boolean
|
||||||
read fShowTabCloseButtons write fShowTabCloseButtons;
|
read fShowTabCloseButtons write fShowTabCloseButtons;
|
||||||
property UndoAfterSave: Boolean read fUndoAfterSave
|
property UndoAfterSave: Boolean read fUndoAfterSave
|
||||||
|
Loading…
Reference in New Issue
Block a user