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