From 859ec0bba34fe743d78fa27a03bbe2de35f3272b Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 8 Sep 2008 13:24:56 +0000 Subject: [PATCH] synedit: carbon: ctrl mouse links now use Cmd under carbon git-svn-id: trunk@16488 - --- components/synedit/synedit.pp | 14 ++++++++------ ide/editoroptions.pp | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 909621ad3c..9609b73b0a 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -219,7 +219,7 @@ type eoDoubleClickSelectsLine, // Select line on double click eoHideRightMargin, // Hides the right margin line 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 eoSpacesToTabs // Converts space characters to tabs and spaces {$ENDIF} @@ -253,6 +253,8 @@ const {$IFDEF SYN_LAZARUS} SYNEDIT_DEFAULT_OPTIONS2 = [ ]; + + SYNEDIT_LINK_MODIFIER = {$IFDEF LCLcarbon}ssMeta{$ELSE}ssCtrl{$ENDIF}; {$ENDIF} type @@ -2253,7 +2255,7 @@ begin {$ENDIF} inherited; {$IFDEF SYN_LAZARUS} - if fLastControlIsPressed<>(GetKeyShiftState=[ssCtrl]) then + if fLastControlIsPressed<>(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]) then UpdateCtrlMouse; {$ENDIF} Data := nil; @@ -2285,7 +2287,7 @@ begin ,' Shift=',ssShift in Shift,' Ctrl=',ssCtrl in Shift,' Alt=',ssAlt in Shift); {$ENDIF} inherited KeyUp(Key, Shift); - if fLastControlIsPressed<>(GetKeyShiftState=[ssCtrl]) then + if fLastControlIsPressed<>(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]) then UpdateCtrlMouse; end; {$ENDIF} @@ -2514,7 +2516,7 @@ begin and (Y >= 0) and (Y < ClientHeight{$IFDEF SYN_LAZARUS}-ScrollBarWidth{$ENDIF}) then begin - if (Cursor <> crHandPoint) or (not (ssCtrl in Shift)) then + if (Cursor <> crHandPoint) or (not (SYNEDIT_LINK_MODIFIER in Shift)) then Cursor := crIBeam; end else @@ -2741,7 +2743,7 @@ begin {$IFDEF SYN_LAZARUS} if (eoShowCtrlMouseLinks in Options) and not(wasDragging) - and (Button=mbLeft) and (ssCtrl in Shift) + and (Button=mbLeft) and (SYNEDIT_LINK_MODIFIER in Shift) and assigned(FOnClickLink) then begin FOnClickLink(Self, Button, Shift, X,Y);; @@ -6884,7 +6886,7 @@ procedure TCustomSynEdit.UpdateCtrlMouse; var NewY, NewX1, NewX2: integer; begin - fLastControlIsPressed:=(GetKeyShiftState=[ssCtrl]); + fLastControlIsPressed:=(GetKeyShiftState=[SYNEDIT_LINK_MODIFIER]); if (eoShowCtrlMouseLinks in Options) and fLastControlIsPressed and (fLastMouseCaret.X>0) and (fLastMouseCaret.Y>0) then begin // show link diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index c43fd1ac74..532ceaf87b 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -450,7 +450,7 @@ type property SynEditOptions2: TSynEditorOptions2 read fSynEditOptions2 write fSynEditOptions2 default SynEditDefaultOptions2; property CtrlMouseLinks: Boolean - read fCtrlMouseLinks write fCtrlMouseLinks; + read fCtrlMouseLinks write fCtrlMouseLinks;// ctrl = SYNEDIT_LINK_MODIFIER property ShowTabCloseButtons: Boolean read fShowTabCloseButtons write fShowTabCloseButtons; property UndoAfterSave: Boolean read fUndoAfterSave