mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 23:08:05 +02:00
IDE: updated adv. mouse act. editor
git-svn-id: trunk@34042 -
This commit is contained in:
parent
af439d12fd
commit
b5a053fda9
@ -387,13 +387,15 @@ begin
|
||||
case emc of
|
||||
emcStartSelections,
|
||||
emcStartColumnSelections,
|
||||
emcStartLineSelections: Result := SYNS_emcSelection_opt;
|
||||
emcSelectLine: Result := SYNS_emcSelectLine_opt;
|
||||
emcMouseLink: Result := SYNS_emcMouseLink_opt;
|
||||
emcCodeFoldCollaps: Result := SYNS_emcCodeFoldCollaps_opt;
|
||||
emcCodeFoldExpand: Result := SYNS_emcCodeFoldExpand_opt;
|
||||
emcContextMenu: Result := SYNS_emcContextMenuCaretMove_opt;
|
||||
else Result := ''
|
||||
emcStartLineSelections: Result := SYNS_emcSelection_opt;
|
||||
emcSelectLine: Result := SYNS_emcSelectLine_opt;
|
||||
emcMouseLink: Result := SYNS_emcMouseLink_opt;
|
||||
emcCodeFoldCollaps: Result := SYNS_emcCodeFoldCollaps_opt;
|
||||
emcCodeFoldExpand: Result := SYNS_emcCodeFoldExpand_opt;
|
||||
emcContextMenu: Result := SYNS_emcContextMenuCaretMove_opt;
|
||||
emcWheelScrollDown..emcWheelVertScrollUp:
|
||||
Result := SYNS_emcWheelScroll_opt;
|
||||
else Result := ''
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -415,6 +415,7 @@ resourcestring
|
||||
SYNS_emcWheelZoomNorm = 'Wheel zoom default';
|
||||
|
||||
SYNS_emcContextMenuCaretMove_opt = '"Move caret, when selection exists", Never, "Click outside", Always';
|
||||
SYNS_emcWheelScroll_opt = 'Speed,"System settings",Lines,Pages,"Pages (less one line)"';
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -1329,6 +1329,9 @@ resourcestring
|
||||
dlfMouseSimpleTextSectAltWheelLabel = 'Alt Wheel';
|
||||
dlfMouseSimpleTextShiftSectWheelLabel = 'Shift Wheel';
|
||||
|
||||
dlfMouseSimpleTextSectPageBtn = 'Buttons';
|
||||
dlfMouseSimpleTextSectPageWheel = 'Wheel';
|
||||
|
||||
dlfMouseSimpleTextSectCtrlLeftLabel = 'Ctrl Left Button';
|
||||
dlfMouseSimpleButtonNothing = 'Nothing/Default';
|
||||
dlfMouseSimpleButtonPaste = 'Paste';
|
||||
@ -1413,6 +1416,7 @@ resourcestring
|
||||
dlgMouseOptBtnCancel = 'Cancel';
|
||||
dlgMouseOptBtnModDef = 'Make Fallback';
|
||||
dlgMouseOptPriorLabel = 'Priority';
|
||||
dlgMouseOptOpt2Label = 'Opt';
|
||||
dlgMouseOptDlgTitle = 'Edit Mouse';
|
||||
dlgMouseOptCapture = 'Capture';
|
||||
dlgMouseOptCaretMove = 'Move Caret (extra)';
|
||||
|
@ -85,10 +85,21 @@ object MouseaActionDialog: TMouseaActionDialog
|
||||
BorderSpacing.Right = 6
|
||||
BevelOuter = bvLowered
|
||||
BevelWidth = 2
|
||||
ClientHeight = 25
|
||||
ClientWidth = 262
|
||||
Color = clBtnShadow
|
||||
ParentColor = False
|
||||
TabOrder = 2
|
||||
OnMouseDown = CapturePanelMouseDown
|
||||
object PaintBox1: TPaintBox
|
||||
Left = 2
|
||||
Height = 21
|
||||
Top = 2
|
||||
Width = 258
|
||||
Align = alClient
|
||||
OnMouseDown = CapturePanelMouseDown
|
||||
OnMouseWheel = PaintBox1MouseWheel
|
||||
end
|
||||
end
|
||||
object ShiftCheck: TCheckBox
|
||||
AnchorSideLeft.Control = ButtonBox
|
||||
@ -226,8 +237,11 @@ object MouseaActionDialog: TMouseaActionDialog
|
||||
TabOrder = 0
|
||||
end
|
||||
object ButtonPanel1: TButtonPanel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = BtnDefault
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 36
|
||||
Top = 225
|
||||
@ -273,4 +287,35 @@ object MouseaActionDialog: TMouseaActionDialog
|
||||
MaxValue = 3
|
||||
TabOrder = 12
|
||||
end
|
||||
object Opt2Spin: TSpinEdit
|
||||
AnchorSideLeft.Control = OptLabel
|
||||
AnchorSideTop.Control = OptBox
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 296
|
||||
Height = 23
|
||||
Top = 105
|
||||
Width = 60
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
MaxValue = 999
|
||||
TabOrder = 13
|
||||
end
|
||||
object Opt2Label: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Opt2Spin
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Opt2Spin
|
||||
Left = 235
|
||||
Height = 16
|
||||
Top = 108
|
||||
Width = 55
|
||||
Anchors = [akTop, akRight]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Right = 6
|
||||
Caption = 'Opt2Label'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, Forms, Controls, ExtCtrls, StdCtrls, ButtonPanel, Spin,
|
||||
SynEditMouseCmds, LazarusIDEStrConsts, KeyMapping, IDECommands;
|
||||
SynEditMouseCmds, LazarusIDEStrConsts, KeyMapping, IDECommands, types;
|
||||
|
||||
var
|
||||
ButtonName: Array [TSynMouseButton] of String;
|
||||
@ -27,12 +27,15 @@ type
|
||||
ButtonPanel1: TButtonPanel;
|
||||
CaretCheck: TCheckBox;
|
||||
ClickBox: TComboBox;
|
||||
PaintBox1: TPaintBox;
|
||||
PriorLabel: TLabel;
|
||||
OptBox: TComboBox;
|
||||
CtrlCheck: TCheckBox;
|
||||
DirCheck: TCheckBox;
|
||||
CapturePanel: TPanel;
|
||||
OptLabel: TLabel;
|
||||
Opt2Spin: TSpinEdit;
|
||||
Opt2Label: TLabel;
|
||||
ShiftCheck: TCheckBox;
|
||||
PriorSpin: TSpinEdit;
|
||||
procedure ActionBoxChange(Sender: TObject);
|
||||
@ -41,6 +44,8 @@ type
|
||||
procedure CapturePanelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure PaintBox1MouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
private
|
||||
FKeyMap: TKeyCommandRelationList;
|
||||
public
|
||||
@ -123,6 +128,7 @@ begin
|
||||
BtnLabel.Caption := dlgMouseOptDescButton;
|
||||
BtnDefault.Caption := dlgMouseOptBtnModDef;
|
||||
PriorLabel.Caption := dlgMouseOptPriorLabel;
|
||||
Opt2Label.Caption := dlgMouseOptOpt2Label;
|
||||
end;
|
||||
|
||||
procedure TMouseaActionDialog.ResetInputs;
|
||||
@ -193,9 +199,21 @@ begin
|
||||
if ssDouble in Shift then ClickBox.ItemIndex := 1;
|
||||
if ssTriple in Shift then ClickBox.ItemIndex := 2;
|
||||
if ssQuad in Shift then ClickBox.ItemIndex := 3;
|
||||
ShiftCheck.Checked := ssShift in Shift ;
|
||||
AltCheck.Checked := ssAlt in Shift ;
|
||||
CtrlCheck.Checked := ssCtrl in Shift ;
|
||||
ShiftCheck.Checked := ssShift in Shift;
|
||||
AltCheck.Checked := ssAlt in Shift;
|
||||
CtrlCheck.Checked := ssCtrl in Shift;
|
||||
end;
|
||||
|
||||
procedure TMouseaActionDialog.PaintBox1MouseWheel(Sender: TObject; Shift: TShiftState;
|
||||
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
||||
begin
|
||||
if WheelDelta > 0
|
||||
then ButtonBox.ItemIndex := BtnToIndex[mbWheelUp]
|
||||
else ButtonBox.ItemIndex := BtnToIndex[mbWheelDown];
|
||||
ClickBox.ItemIndex := 4;
|
||||
ShiftCheck.Checked := ssShift in Shift;
|
||||
AltCheck.Checked := ssAlt in Shift;
|
||||
CtrlCheck.Checked := ssCtrl in Shift;
|
||||
end;
|
||||
|
||||
procedure TMouseaActionDialog.ReadFromAction(MAct: TSynEditMouseAction);
|
||||
@ -212,6 +230,7 @@ begin
|
||||
CtrlCheck.Checked := (ssCtrl in MAct.ShiftMask) and (ssCtrl in MAct.Shift);
|
||||
if not(ssCtrl in MAct.ShiftMask) then CtrlCheck.State := cbGrayed;
|
||||
PriorSpin.Value := MAct.Priority;
|
||||
Opt2Spin.Value := MAct.Option2;
|
||||
|
||||
ActionBoxChange(nil);
|
||||
ButtonBoxChange(nil);
|
||||
@ -241,6 +260,7 @@ begin
|
||||
if AltCheck.Checked then MAct.Shift := MAct.Shift + [ssAlt];
|
||||
if CtrlCheck.Checked then MAct.Shift := MAct.Shift + [ssCtrl];
|
||||
MAct.Priority := PriorSpin.Value;
|
||||
MAct.Option2 := Opt2Spin.Value;
|
||||
|
||||
if OptBox.Enabled then begin
|
||||
if MAct.Command = emcSynEditCommand then begin
|
||||
|
Loading…
Reference in New Issue
Block a user