mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 11:29:31 +02:00
SrcEdit: Fixed Ctrl-Middle click (was no longer closing all others) / added option to enable/disbale the behaviour
git-svn-id: trunk@28439 -
This commit is contained in:
parent
15785bf24f
commit
ef88560836
@ -1004,6 +1004,7 @@ type
|
||||
|
||||
// Multi window
|
||||
FMultiWinEditAccessOrder: TEditorOptionsEditAccessOrderList;
|
||||
FCtrlMiddleTabClickClosesOthers: Boolean;
|
||||
|
||||
FDefaultValues: TEditorOptions;
|
||||
|
||||
@ -1180,6 +1181,9 @@ type
|
||||
property PasStringKeywordMode: TSynPasStringMode
|
||||
read FPasStringKeywordMode write FPasStringKeywordMode default spsmDefault;
|
||||
|
||||
// Multi window
|
||||
property CtrlMiddleTabClickClosesOthers: Boolean
|
||||
read FCtrlMiddleTabClickClosesOthers write FCtrlMiddleTabClickClosesOthers default True;
|
||||
end;
|
||||
|
||||
const
|
||||
@ -3295,6 +3299,8 @@ begin
|
||||
FPasExtendedKeywordsMode := False;
|
||||
FPasStringKeywordMode := spsmDefault;
|
||||
|
||||
// Multi window
|
||||
FCtrlMiddleTabClickClosesOthers := True;
|
||||
end;
|
||||
|
||||
procedure TEditorOptions.Load;
|
||||
|
@ -4,7 +4,6 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
Anchors = [akTop]
|
||||
ClientHeight = 415
|
||||
ClientWidth = 521
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
DesignLeft = 929
|
||||
DesignTop = 308
|
||||
@ -17,20 +16,18 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 221
|
||||
Top = 194
|
||||
Height = 214
|
||||
Top = 201
|
||||
Width = 509
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
BorderSpacing.Left = 6
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Right = 6
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 221
|
||||
ClientHeight = 214
|
||||
ClientWidth = 509
|
||||
TabOrder = 0
|
||||
object listAccessType: TCheckListBox
|
||||
AnchorSideLeft.Control = AccessTypePanel
|
||||
AnchorSideTop.Control = AccessTypePanel
|
||||
AnchorSideBottom.Control = AccessTypePanel
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
@ -46,16 +43,15 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
OnExit = listAccessTypeClickCheck
|
||||
OnKeyUp = listAccessTypeKeyUp
|
||||
TabOrder = 0
|
||||
TopIndex = -1
|
||||
end
|
||||
object Panel2: TPanel
|
||||
Left = 0
|
||||
Height = 56
|
||||
Height = 50
|
||||
Top = 165
|
||||
Width = 509
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 56
|
||||
ClientHeight = 50
|
||||
ClientWidth = 509
|
||||
Constraints.MinHeight = 50
|
||||
TabOrder = 1
|
||||
@ -88,7 +84,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 3
|
||||
Top = 79
|
||||
Top = 92
|
||||
Width = 60
|
||||
BorderSpacing.Bottom = 6
|
||||
end
|
||||
@ -99,8 +95,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 70
|
||||
Height = 16
|
||||
Top = 72
|
||||
Width = 209
|
||||
Top = 85
|
||||
Width = 167
|
||||
BorderSpacing.Left = 10
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'lblEditActivationOrderSection'
|
||||
@ -115,10 +111,10 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 289
|
||||
Left = 247
|
||||
Height = 3
|
||||
Top = 79
|
||||
Width = 232
|
||||
Top = 92
|
||||
Width = 274
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 10
|
||||
end
|
||||
@ -129,8 +125,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 72
|
||||
Top = 94
|
||||
Height = 66
|
||||
Top = 107
|
||||
Width = 509
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
@ -138,7 +134,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
BorderSpacing.Right = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 72
|
||||
ClientHeight = 66
|
||||
ClientWidth = 509
|
||||
TabOrder = 1
|
||||
object lblAccessOrder: TLabel
|
||||
@ -159,15 +155,15 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 22
|
||||
Height = 19
|
||||
Top = 22
|
||||
Width = 509
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Caption = 'radioAccessOrderEdit'
|
||||
Checked = True
|
||||
OnChange = radioAccessOrderEditChange
|
||||
State = cbChecked
|
||||
TabOrder = 0
|
||||
TabStop = True
|
||||
end
|
||||
object radioAccessOrderWin: TRadioButton
|
||||
AnchorSideLeft.Control = Panel1
|
||||
@ -176,8 +172,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Control = Panel1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 22
|
||||
Top = 44
|
||||
Height = 19
|
||||
Top = 41
|
||||
Width = 509
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Bottom = 6
|
||||
@ -194,7 +190,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 16
|
||||
Top = 172
|
||||
Top = 179
|
||||
Width = 521
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
Caption = 'lblAccessType'
|
||||
@ -219,7 +215,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
Left = 70
|
||||
Height = 16
|
||||
Top = 0
|
||||
Width = 157
|
||||
Width = 127
|
||||
BorderSpacing.Left = 10
|
||||
BorderSpacing.Bottom = 6
|
||||
Caption = 'lblMultiWinTabSection'
|
||||
@ -234,10 +230,10 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideTop.Side = asrCenter
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 237
|
||||
Left = 207
|
||||
Height = 3
|
||||
Top = 7
|
||||
Width = 284
|
||||
Width = 314
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 10
|
||||
end
|
||||
@ -248,7 +244,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 44
|
||||
Height = 57
|
||||
Top = 22
|
||||
Width = 509
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -261,22 +257,22 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 44
|
||||
ClientHeight = 57
|
||||
ClientWidth = 509
|
||||
TabOrder = 2
|
||||
object chkShowCloseBtn: TCheckBox
|
||||
Left = 0
|
||||
Height = 22
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 254
|
||||
Width = 293
|
||||
Caption = 'chkShowCloseBtn'
|
||||
TabOrder = 0
|
||||
end
|
||||
object chkShowNumbers: TCheckBox
|
||||
Left = 254
|
||||
Height = 22
|
||||
Left = 293
|
||||
Height = 19
|
||||
Top = 0
|
||||
Width = 255
|
||||
Width = 216
|
||||
Caption = 'chkShowNumbers'
|
||||
TabOrder = 1
|
||||
end
|
||||
@ -284,19 +280,27 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 22
|
||||
Top = 22
|
||||
Width = 254
|
||||
Height = 19
|
||||
Top = 19
|
||||
Width = 293
|
||||
Caption = 'chkHideSingleTab'
|
||||
TabOrder = 2
|
||||
end
|
||||
object chkUseTabHistory: TCheckBox
|
||||
Left = 254
|
||||
Height = 22
|
||||
Top = 22
|
||||
Width = 255
|
||||
Left = 293
|
||||
Height = 19
|
||||
Top = 19
|
||||
Width = 216
|
||||
Caption = 'chkUseTabHistory'
|
||||
TabOrder = 3
|
||||
end
|
||||
object chkCtrlMiddleCloseOthers: TCheckBox
|
||||
Left = 0
|
||||
Height = 19
|
||||
Top = 38
|
||||
Width = 293
|
||||
Caption = 'chkCtrlMiddleCloseOthers'
|
||||
TabOrder = 4
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -37,6 +37,7 @@ type
|
||||
Bevel1a: TBevel;
|
||||
Bevel2a: TBevel;
|
||||
Bevel2: TBevel;
|
||||
chkCtrlMiddleCloseOthers: TCheckBox;
|
||||
chkUseTabHistory: TCheckBox;
|
||||
chkShowCloseBtn: TCheckBox;
|
||||
chkShowNumbers: TCheckBox;
|
||||
@ -131,6 +132,7 @@ begin
|
||||
chkShowNumbers.Caption := dlgTabNumbersNotebook;
|
||||
chkShowCloseBtn.Caption := dlgCloseButtonsNotebook;
|
||||
chkUseTabHistory.Caption := dlgUseTabsHistory;
|
||||
chkCtrlMiddleCloseOthers.Caption := dlgCtrlMiddleTabCloseOtherPages;
|
||||
end;
|
||||
|
||||
procedure TEditorMultiWindowOptionsFrame.ReadSettings(
|
||||
@ -143,6 +145,7 @@ begin
|
||||
chkShowNumbers.Checked := ShowTabNumbers;
|
||||
chkShowCloseBtn.Checked := ShowTabCloseButtons;
|
||||
chkUseTabHistory.Checked := UseTabHistory;
|
||||
chkCtrlMiddleCloseOthers.Checked := CtrlMiddleTabClickClosesOthers;
|
||||
end;
|
||||
FMultiWinEditAccessOrder.Assign(TEditorOptions(AOptions).MultiWinEditAccessOrder);
|
||||
|
||||
@ -167,6 +170,7 @@ begin
|
||||
ShowTabNumbers := chkShowNumbers.Checked;
|
||||
ShowTabCloseButtons := chkShowCloseBtn.Checked;
|
||||
UseTabHistory := chkUseTabHistory.Checked;
|
||||
CtrlMiddleTabClickClosesOthers := chkCtrlMiddleCloseOthers.Checked;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1277,6 +1277,7 @@ resourcestring
|
||||
dlgScrollHint = 'Show scroll hint';
|
||||
lisShowSpecialCharacters = 'Show special characters';
|
||||
dlgCloseButtonsNotebook = 'Show close buttons in notebook';
|
||||
dlgCtrlMiddleTabCloseOtherPages = 'Ctrl-middle-click on tab closes all others';
|
||||
dlgHideSingleTabInNotebook = 'Hide tab in single page windows';
|
||||
dlgTabNumbersNotebook = 'Show tab numbers in notebook';
|
||||
dlgNotebookTabPos = 'Source notebook tabs position';
|
||||
|
@ -716,8 +716,7 @@ type
|
||||
procedure EndAutoFocusLock;
|
||||
|
||||
protected
|
||||
procedure CloseTabClicked(Sender: TObject);
|
||||
procedure CloseClicked(Sender: TObject);
|
||||
procedure CloseClicked(Sender: TObject; CloseOthers: Boolean = False);
|
||||
procedure ToggleFormUnitClicked(Sender: TObject);
|
||||
procedure ToggleObjectInspClicked(Sender: TObject);
|
||||
|
||||
@ -4994,7 +4993,6 @@ Begin
|
||||
Options:=Options-[nboShowCloseButtons];
|
||||
TabPosition := EditorOpts.TabPosition;
|
||||
OnPageChanged := @NotebookPageChanged;
|
||||
OnCloseTabClicked:=@CloseTabClicked;
|
||||
OnMouseDown:=@NotebookMouseDown;
|
||||
TabDragMode := dmAutomatic;
|
||||
OnTabDragOverEx := @NotebookCanDragTabMove;
|
||||
@ -6546,10 +6544,10 @@ begin
|
||||
Result:=FSourceEditorList.Count;
|
||||
end;
|
||||
|
||||
Procedure TSourceNotebook.CloseClicked(Sender: TObject);
|
||||
Procedure TSourceNotebook.CloseClicked(Sender: TObject; CloseOthers: Boolean = False);
|
||||
Begin
|
||||
if assigned(Manager) and Assigned(Manager.OnCloseClicked) then
|
||||
Manager.OnCloseClicked(Sender, False);
|
||||
Manager.OnCloseClicked(Sender, CloseOthers);
|
||||
end;
|
||||
|
||||
procedure TSourceNotebook.ToggleFormUnitClicked(Sender: TObject);
|
||||
@ -6738,7 +6736,8 @@ begin
|
||||
if (Button = mbMiddle) then begin
|
||||
TabIndex:=FNotebook.TabIndexAtClientPos(Point(X,Y));
|
||||
if TabIndex>=0 then
|
||||
CloseClicked(NoteBookPage[TabIndex])
|
||||
CloseClicked(NoteBookPage[TabIndex],
|
||||
(GetKeyState(VK_CONTROL) < 0) and EditorOpts.CtrlMiddleTabClickClosesOthers);
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -7382,13 +7381,6 @@ begin
|
||||
Editors[i].ClearExecutionMarks;
|
||||
end;
|
||||
|
||||
procedure TSourceNotebook.CloseTabClicked(Sender: TObject);
|
||||
begin
|
||||
FPageIndex := PageIndex;
|
||||
if assigned(manager) and Assigned(Manager.OnCloseClicked) then
|
||||
Manager.OnCloseClicked(Sender, GetKeyState(VK_CONTROL) < 0);
|
||||
end;
|
||||
|
||||
{ TSynEditPlugin1 }
|
||||
|
||||
constructor TSynEditPlugin1.Create(AOwner: TComponent);
|
||||
|
Loading…
Reference in New Issue
Block a user