mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 05:29:29 +02:00
IDE, SourceEditor: Implement "Close tabs on right". Issue #0029929
git-svn-id: trunk@60016 -
This commit is contained in:
parent
fe756b5c1b
commit
781767973e
@ -666,7 +666,7 @@ const
|
|||||||
);
|
);
|
||||||
|
|
||||||
const
|
const
|
||||||
EditorOptsFormatVersion = 12;
|
EditorOptsFormatVersion = 13;
|
||||||
{ * Changes in Version 6:
|
{ * Changes in Version 6:
|
||||||
- ColorSchemes now have a Global settings part.
|
- ColorSchemes now have a Global settings part.
|
||||||
Language specific changes must save UseSchemeGlobals=False (Default is true)
|
Language specific changes must save UseSchemeGlobals=False (Default is true)
|
||||||
@ -686,6 +686,8 @@ const
|
|||||||
* Changes in Version 12:
|
* Changes in Version 12:
|
||||||
Used in Colorscheme/Version
|
Used in Colorscheme/Version
|
||||||
Colors for MarkupFoldColor can now have gaps (before unset colors were filtered)
|
Colors for MarkupFoldColor can now have gaps (before unset colors were filtered)
|
||||||
|
* Changes in Version 13:
|
||||||
|
CtrlMiddleTabClickClosesOthers was replaced by MiddleTabClickClosesOthersModifier
|
||||||
}
|
}
|
||||||
EditorMouseOptsFormatVersion = 1;
|
EditorMouseOptsFormatVersion = 1;
|
||||||
{ * Changes in Version 6:
|
{ * Changes in Version 6:
|
||||||
@ -1378,6 +1380,8 @@ type
|
|||||||
FBlockTabIndent: Integer;
|
FBlockTabIndent: Integer;
|
||||||
FCompletionLongLineHintInMSec: Integer;
|
FCompletionLongLineHintInMSec: Integer;
|
||||||
FCompletionLongLineHintType: TSynCompletionLongHintType;
|
FCompletionLongLineHintType: TSynCompletionLongHintType;
|
||||||
|
FMiddleTabClickClosesOthersModifier: TShiftState;
|
||||||
|
FMiddleTabClickClosesToRightModifier: TShiftState;
|
||||||
FMultiCaretDefaultColumnSelectMode: TSynPluginMultiCaretDefaultMode;
|
FMultiCaretDefaultColumnSelectMode: TSynPluginMultiCaretDefaultMode;
|
||||||
FMultiCaretDefaultMode: TSynPluginMultiCaretDefaultMode;
|
FMultiCaretDefaultMode: TSynPluginMultiCaretDefaultMode;
|
||||||
FMultiCaretDeleteSkipLineBreak: Boolean;
|
FMultiCaretDeleteSkipLineBreak: Boolean;
|
||||||
@ -1718,7 +1722,11 @@ type
|
|||||||
|
|
||||||
// Multi window
|
// Multi window
|
||||||
property CtrlMiddleTabClickClosesOthers: Boolean
|
property CtrlMiddleTabClickClosesOthers: Boolean
|
||||||
read FCtrlMiddleTabClickClosesOthers write FCtrlMiddleTabClickClosesOthers default True;
|
read FCtrlMiddleTabClickClosesOthers write FCtrlMiddleTabClickClosesOthers stored False default True;
|
||||||
|
property MiddleTabClickClosesOthersModifier: TShiftState
|
||||||
|
read FMiddleTabClickClosesOthersModifier write FMiddleTabClickClosesOthersModifier default [ssCtrl];
|
||||||
|
property MiddleTabClickClosesToRightModifier: TShiftState
|
||||||
|
read FMiddleTabClickClosesToRightModifier write FMiddleTabClickClosesToRightModifier default [];
|
||||||
|
|
||||||
property ShowFileNameInCaption: Boolean
|
property ShowFileNameInCaption: Boolean
|
||||||
read FShowFileNameInCaption write FShowFileNameInCaption default False;
|
read FShowFileNameInCaption write FShowFileNameInCaption default False;
|
||||||
@ -4668,6 +4676,8 @@ begin
|
|||||||
|
|
||||||
// Multi window
|
// Multi window
|
||||||
FCtrlMiddleTabClickClosesOthers := True;
|
FCtrlMiddleTabClickClosesOthers := True;
|
||||||
|
FMiddleTabClickClosesOthersModifier := [ssCtrl];
|
||||||
|
FMiddleTabClickClosesToRightModifier := [];
|
||||||
FShowFileNameInCaption := False;
|
FShowFileNameInCaption := False;
|
||||||
|
|
||||||
// Comment
|
// Comment
|
||||||
@ -4942,6 +4952,9 @@ begin
|
|||||||
on E: Exception do
|
on E: Exception do
|
||||||
DebugLn('[TEditorOptions.Load] ERROR: ', e.Message);
|
DebugLn('[TEditorOptions.Load] ERROR: ', e.Message);
|
||||||
end;
|
end;
|
||||||
|
if FileVersion < 13 then
|
||||||
|
if not CtrlMiddleTabClickClosesOthers then // user set option to false
|
||||||
|
MiddleTabClickClosesOthersModifier := [];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorOptions.Save;
|
procedure TEditorOptions.Save;
|
||||||
|
@ -21,15 +21,15 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 173
|
Height = 138
|
||||||
Top = 242
|
Top = 277
|
||||||
Width = 509
|
Width = 509
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 173
|
ClientHeight = 138
|
||||||
ClientWidth = 509
|
ClientWidth = 509
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object listAccessType: TCheckListBox
|
object listAccessType: TCheckListBox
|
||||||
@ -52,7 +52,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
object Panel2: TPanel
|
object Panel2: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 50
|
Height = 50
|
||||||
Top = 165
|
Top = 138
|
||||||
Width = 509
|
Width = 509
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
@ -75,7 +75,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
Cursor = crVSplit
|
Cursor = crVSplit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 5
|
Height = 5
|
||||||
Top = 160
|
Top = 138
|
||||||
Width = 509
|
Width = 509
|
||||||
Align = alTop
|
Align = alTop
|
||||||
ResizeAnchor = akTop
|
ResizeAnchor = akTop
|
||||||
@ -89,7 +89,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 3
|
Height = 3
|
||||||
Top = 135
|
Top = 170
|
||||||
Width = 60
|
Width = 60
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
end
|
end
|
||||||
@ -100,7 +100,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 70
|
Left = 70
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 129
|
Top = 164
|
||||||
Width = 166
|
Width = 166
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
@ -118,7 +118,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 246
|
Left = 246
|
||||||
Height = 3
|
Height = 3
|
||||||
Top = 135
|
Top = 170
|
||||||
Width = 275
|
Width = 275
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 10
|
BorderSpacing.Left = 10
|
||||||
@ -131,7 +131,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 65
|
Height = 65
|
||||||
Top = 150
|
Top = 185
|
||||||
Width = 509
|
Width = 509
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -195,7 +195,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 221
|
Top = 256
|
||||||
Width = 521
|
Width = 521
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
Caption = 'lblAccessType'
|
Caption = 'lblAccessType'
|
||||||
@ -249,7 +249,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 102
|
Height = 137
|
||||||
Top = 21
|
Top = 21
|
||||||
Width = 509
|
Width = 509
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
@ -259,7 +259,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ChildSizing.ControlsPerLine = 2
|
ChildSizing.ControlsPerLine = 2
|
||||||
ClientHeight = 102
|
ClientHeight = 137
|
||||||
ClientWidth = 509
|
ClientWidth = 509
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object chkShowCloseBtn: TCheckBox
|
object chkShowCloseBtn: TCheckBox
|
||||||
@ -315,19 +315,6 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
Caption = 'chkUseTabHistory'
|
Caption = 'chkUseTabHistory'
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object chkCtrlMiddleCloseOthers: TCheckBox
|
|
||||||
AnchorSideLeft.Control = pnlNBTabs
|
|
||||||
AnchorSideTop.Control = chkHideSingleTab
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
Left = 0
|
|
||||||
Height = 19
|
|
||||||
Top = 38
|
|
||||||
Width = 159
|
|
||||||
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
|
||||||
BorderSpacing.CellAlignVertical = ccaLeftTop
|
|
||||||
Caption = 'chkCtrlMiddleCloseOthers'
|
|
||||||
TabOrder = 4
|
|
||||||
end
|
|
||||||
object CenterLabel: TLabel
|
object CenterLabel: TLabel
|
||||||
AnchorSideLeft.Control = pnlNBTabs
|
AnchorSideLeft.Control = pnlNBTabs
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
@ -348,7 +335,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
Top = 38
|
Top = 38
|
||||||
Width = 89
|
Width = 89
|
||||||
Caption = 'chkMultiLine'
|
Caption = 'chkMultiLine'
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object EditorTabPositionLabel: TLabel
|
object EditorTabPositionLabel: TLabel
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
@ -356,7 +343,7 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 83
|
Top = 64
|
||||||
Width = 121
|
Width = 121
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
Caption = 'EditorTabPositionLabel'
|
Caption = 'EditorTabPositionLabel'
|
||||||
@ -369,26 +356,94 @@ object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 132
|
Left = 132
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 79
|
Top = 60
|
||||||
Width = 150
|
Width = 150
|
||||||
BorderSpacing.Left = 5
|
BorderSpacing.Left = 5
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
ItemHeight = 15
|
ItemHeight = 15
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
object chkShowFileNameInCaption: TCheckBox
|
object chkShowFileNameInCaption: TCheckBox
|
||||||
AnchorSideLeft.Control = pnlNBTabs
|
AnchorSideLeft.Control = pnlNBTabs
|
||||||
AnchorSideTop.Control = chkCtrlMiddleCloseOthers
|
AnchorSideTop.Control = chkHideSingleTab
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 57
|
Top = 38
|
||||||
Width = 170
|
Width = 170
|
||||||
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
BorderSpacing.CellAlignHorizontal = ccaLeftTop
|
||||||
BorderSpacing.CellAlignVertical = ccaLeftTop
|
BorderSpacing.CellAlignVertical = ccaLeftTop
|
||||||
Caption = 'chkShowFileNameInCaption'
|
Caption = 'chkShowFileNameInCaption'
|
||||||
|
TabOrder = 6
|
||||||
|
end
|
||||||
|
object cgCloseOther: TCheckGroup
|
||||||
|
AnchorSideLeft.Control = pnlNBTabs
|
||||||
|
AnchorSideTop.Control = EditorTabPositionCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 5
|
||||||
|
Height = 51
|
||||||
|
Top = 86
|
||||||
|
Width = 134
|
||||||
|
AutoFill = True
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Left = 5
|
||||||
|
BorderSpacing.Top = 3
|
||||||
|
Caption = 'cgCloseOther'
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.TopBottomSpacing = 6
|
||||||
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
|
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||||
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 3
|
||||||
|
ClientHeight = 31
|
||||||
|
ClientWidth = 130
|
||||||
|
Columns = 3
|
||||||
|
Items.Strings = (
|
||||||
|
'Shift'
|
||||||
|
'Ctrl'
|
||||||
|
'Alt'
|
||||||
|
)
|
||||||
TabOrder = 7
|
TabOrder = 7
|
||||||
|
Data = {
|
||||||
|
03000000020202
|
||||||
|
}
|
||||||
|
end
|
||||||
|
object cgCloseRight: TCheckGroup
|
||||||
|
AnchorSideLeft.Control = chkMultiLine
|
||||||
|
AnchorSideTop.Control = EditorTabPositionCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 260
|
||||||
|
Height = 51
|
||||||
|
Top = 86
|
||||||
|
Width = 134
|
||||||
|
AutoFill = True
|
||||||
|
AutoSize = True
|
||||||
|
BorderSpacing.Left = 5
|
||||||
|
BorderSpacing.Top = 3
|
||||||
|
Caption = 'cgCloseRight'
|
||||||
|
ChildSizing.LeftRightSpacing = 6
|
||||||
|
ChildSizing.TopBottomSpacing = 6
|
||||||
|
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||||
|
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||||
|
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||||
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
|
ChildSizing.ControlsPerLine = 3
|
||||||
|
ClientHeight = 31
|
||||||
|
ClientWidth = 130
|
||||||
|
Columns = 3
|
||||||
|
Items.Strings = (
|
||||||
|
'Shift'
|
||||||
|
'Ctrl'
|
||||||
|
'Alt'
|
||||||
|
)
|
||||||
|
TabOrder = 8
|
||||||
|
Data = {
|
||||||
|
03000000020202
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -43,9 +43,10 @@ type
|
|||||||
Bevel2a: TBevel;
|
Bevel2a: TBevel;
|
||||||
Bevel2: TBevel;
|
Bevel2: TBevel;
|
||||||
CenterLabel: TLabel;
|
CenterLabel: TLabel;
|
||||||
|
cgCloseOther: TCheckGroup;
|
||||||
|
cgCloseRight: TCheckGroup;
|
||||||
chkShowFileNameInCaption: TCheckBox;
|
chkShowFileNameInCaption: TCheckBox;
|
||||||
chkMultiLine: TCheckBox;
|
chkMultiLine: TCheckBox;
|
||||||
chkCtrlMiddleCloseOthers: TCheckBox;
|
|
||||||
chkUseTabHistory: TCheckBox;
|
chkUseTabHistory: TCheckBox;
|
||||||
chkShowCloseBtn: TCheckBox;
|
chkShowCloseBtn: TCheckBox;
|
||||||
chkShowNumbers: TCheckBox;
|
chkShowNumbers: TCheckBox;
|
||||||
@ -148,7 +149,6 @@ begin
|
|||||||
chkShowNumbers.Caption := dlgTabNumbersNotebook;
|
chkShowNumbers.Caption := dlgTabNumbersNotebook;
|
||||||
chkShowCloseBtn.Caption := dlgCloseButtonsNotebook;
|
chkShowCloseBtn.Caption := dlgCloseButtonsNotebook;
|
||||||
chkUseTabHistory.Caption := dlgUseTabsHistory;
|
chkUseTabHistory.Caption := dlgUseTabsHistory;
|
||||||
chkCtrlMiddleCloseOthers.Caption := dlgCtrlMiddleTabCloseOtherPages;
|
|
||||||
chkShowFileNameInCaption.Caption := dlgShowFileNameInCaption;
|
chkShowFileNameInCaption.Caption := dlgShowFileNameInCaption;
|
||||||
chkMultiLine.Caption := dlgSourceEditTabMultiLine;
|
chkMultiLine.Caption := dlgSourceEditTabMultiLine;
|
||||||
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosTop);
|
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosTop);
|
||||||
@ -156,7 +156,8 @@ begin
|
|||||||
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosLeft);
|
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosLeft);
|
||||||
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosRight);
|
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosRight);
|
||||||
EditorTabPositionLabel.Caption := dlgNotebookTabPos;
|
EditorTabPositionLabel.Caption := dlgNotebookTabPos;
|
||||||
|
cgCloseOther.Caption := dlgMiddleTabCloseOtherPagesMod;
|
||||||
|
cgCloseRight.Caption := dlgMiddleTabCloseRightPagesMod;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorMultiWindowOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
procedure TEditorMultiWindowOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||||
@ -170,7 +171,13 @@ begin
|
|||||||
chkShowNumbers.Checked := ShowTabNumbers;
|
chkShowNumbers.Checked := ShowTabNumbers;
|
||||||
chkShowCloseBtn.Checked := ShowTabCloseButtons and chkShowCloseBtn.Enabled;
|
chkShowCloseBtn.Checked := ShowTabCloseButtons and chkShowCloseBtn.Enabled;
|
||||||
chkUseTabHistory.Checked := UseTabHistory;
|
chkUseTabHistory.Checked := UseTabHistory;
|
||||||
chkCtrlMiddleCloseOthers.Checked := CtrlMiddleTabClickClosesOthers;
|
cgCloseOther.Checked[0] := ssShift in MiddleTabClickClosesOthersModifier;
|
||||||
|
cgCloseOther.Checked[1] := ssCtrl in MiddleTabClickClosesOthersModifier;
|
||||||
|
cgCloseOther.Checked[2] := ssAlt in MiddleTabClickClosesOthersModifier;
|
||||||
|
cgCloseRight.Checked[0] := ssShift in MiddleTabClickClosesToRightModifier;
|
||||||
|
cgCloseRight.Checked[1] := ssCtrl in MiddleTabClickClosesToRightModifier;
|
||||||
|
cgCloseRight.Checked[2] := ssAlt in MiddleTabClickClosesToRightModifier;
|
||||||
|
|
||||||
chkShowFileNameInCaption.Checked := ShowFileNameInCaption;
|
chkShowFileNameInCaption.Checked := ShowFileNameInCaption;
|
||||||
chkMultiLine.Checked := MultiLineTab;
|
chkMultiLine.Checked := MultiLineTab;
|
||||||
EditorTabPositionCheckBox.ItemIndex := TabPosToIndex[TabPosition];
|
EditorTabPositionCheckBox.ItemIndex := TabPosToIndex[TabPosition];
|
||||||
@ -199,7 +206,16 @@ begin
|
|||||||
ShowTabNumbers := chkShowNumbers.Checked;
|
ShowTabNumbers := chkShowNumbers.Checked;
|
||||||
ShowTabCloseButtons := chkShowCloseBtn.Checked;
|
ShowTabCloseButtons := chkShowCloseBtn.Checked;
|
||||||
UseTabHistory := chkUseTabHistory.Checked;
|
UseTabHistory := chkUseTabHistory.Checked;
|
||||||
CtrlMiddleTabClickClosesOthers := chkCtrlMiddleCloseOthers.Checked;
|
|
||||||
|
MiddleTabClickClosesOthersModifier := [];
|
||||||
|
if cgCloseOther.Checked[0] then MiddleTabClickClosesOthersModifier := MiddleTabClickClosesOthersModifier + [ssShift];
|
||||||
|
if cgCloseOther.Checked[1] then MiddleTabClickClosesOthersModifier := MiddleTabClickClosesOthersModifier + [ssCtrl];
|
||||||
|
if cgCloseOther.Checked[2] then MiddleTabClickClosesOthersModifier := MiddleTabClickClosesOthersModifier + [ssAlt];
|
||||||
|
MiddleTabClickClosesToRightModifier := [];
|
||||||
|
if cgCloseRight.Checked[0] then MiddleTabClickClosesToRightModifier := MiddleTabClickClosesToRightModifier + [ssShift];
|
||||||
|
if cgCloseRight.Checked[1] then MiddleTabClickClosesToRightModifier := MiddleTabClickClosesToRightModifier + [ssCtrl];
|
||||||
|
if cgCloseRight.Checked[2] then MiddleTabClickClosesToRightModifier := MiddleTabClickClosesToRightModifier + [ssAlt];
|
||||||
|
|
||||||
ShowFileNameInCaption := chkShowFileNameInCaption.Checked;
|
ShowFileNameInCaption := chkShowFileNameInCaption.Checked;
|
||||||
MultiLineTab := chkMultiLine.Checked;
|
MultiLineTab := chkMultiLine.Checked;
|
||||||
TabPosition := TabIndexToPos[EditorTabPositionCheckBox.ItemIndex];
|
TabPosition := TabIndexToPos[EditorTabPositionCheckBox.ItemIndex];
|
||||||
|
@ -1636,7 +1636,8 @@ resourcestring
|
|||||||
dlgScrollHint = 'Show scroll hint';
|
dlgScrollHint = 'Show scroll hint';
|
||||||
lisShowSpecialCharacters = 'Show special characters';
|
lisShowSpecialCharacters = 'Show special characters';
|
||||||
dlgCloseButtonsNotebook = 'Show close buttons in notebook';
|
dlgCloseButtonsNotebook = 'Show close buttons in notebook';
|
||||||
dlgCtrlMiddleTabCloseOtherPages = 'Ctrl-middle-click on tab closes all others';
|
dlgMiddleTabCloseOtherPagesMod = 'Middle-click-modifier to close all other tabs';
|
||||||
|
dlgMiddleTabCloseRightPagesMod = 'Middle-click-modifier to close tabs on the right';
|
||||||
dlgShowFileNameInCaption = 'Show file name in caption';
|
dlgShowFileNameInCaption = 'Show file name in caption';
|
||||||
dlgSourceEditTabMultiLine = 'Multiline tabs';
|
dlgSourceEditTabMultiLine = 'Multiline tabs';
|
||||||
dlgHideSingleTabInNotebook = 'Hide tab in single page windows';
|
dlgHideSingleTabInNotebook = 'Hide tab in single page windows';
|
||||||
@ -2814,6 +2815,7 @@ resourcestring
|
|||||||
uemProcedureJump = 'Procedure Jump';
|
uemProcedureJump = 'Procedure Jump';
|
||||||
uemClosePage = '&Close Page';
|
uemClosePage = '&Close Page';
|
||||||
uemCloseOtherPages = 'Close All &Other Pages';
|
uemCloseOtherPages = 'Close All &Other Pages';
|
||||||
|
uemCloseOtherPagesRight = 'Close Pages on the &Right';
|
||||||
uemLockPage = '&Lock Page';
|
uemLockPage = '&Lock Page';
|
||||||
uemCopyToNewWindow = 'Clone to New Window';
|
uemCopyToNewWindow = 'Clone to New Window';
|
||||||
uemCopyToOtherWindow = 'Clone to Other Window';
|
uemCopyToOtherWindow = 'Clone to Other Window';
|
||||||
|
@ -475,7 +475,7 @@ type
|
|||||||
procedure SrcNotebookFileOpenAtCursor(Sender: TObject);
|
procedure SrcNotebookFileOpenAtCursor(Sender: TObject);
|
||||||
procedure SrcNotebookFileSave(Sender: TObject);
|
procedure SrcNotebookFileSave(Sender: TObject);
|
||||||
procedure SrcNotebookFileSaveAs(Sender: TObject);
|
procedure SrcNotebookFileSaveAs(Sender: TObject);
|
||||||
procedure SrcNotebookFileClose(Sender: TObject; InvertedClose: boolean);
|
procedure SrcNotebookFileClose(Sender: TObject; ACloseOptions: TCloseSrcEditorOptions);
|
||||||
procedure SrcNotebookFindDeclaration(Sender: TObject);
|
procedure SrcNotebookFindDeclaration(Sender: TObject);
|
||||||
procedure SrcNotebookInitIdentCompletion(Sender: TObject;
|
procedure SrcNotebookInitIdentCompletion(Sender: TObject;
|
||||||
JumpToError: boolean; out Handled, Abort: boolean);
|
JumpToError: boolean; out Handled, Abort: boolean);
|
||||||
@ -3146,12 +3146,13 @@ begin
|
|||||||
mnuNewFormClicked(Sender);
|
mnuNewFormClicked(Sender);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SrcNotebookFileClose(Sender: TObject; InvertedClose: boolean);
|
procedure TMainIDE.SrcNotebookFileClose(Sender: TObject;
|
||||||
|
ACloseOptions: TCloseSrcEditorOptions);
|
||||||
var
|
var
|
||||||
PageIndex: LongInt;
|
PageIndex: LongInt;
|
||||||
SrcNoteBook: TSourceNotebook;
|
SrcNoteBook: TSourceNotebook;
|
||||||
begin
|
begin
|
||||||
if InvertedClose then begin
|
if ACloseOptions * [ceoCloseOthers, ceoCloseOthersOnRightSide] <> [] then begin
|
||||||
if Sender is TTabSheet then begin
|
if Sender is TTabSheet then begin
|
||||||
SrcNoteBook := SourceEditorManager.SourceWindowWithPage(TTabSheet(Sender));
|
SrcNoteBook := SourceEditorManager.SourceWindowWithPage(TTabSheet(Sender));
|
||||||
if SrcNoteBook = nil then exit;
|
if SrcNoteBook = nil then exit;
|
||||||
@ -3162,7 +3163,7 @@ begin
|
|||||||
PageIndex := SrcNoteBook.PageIndex;
|
PageIndex := SrcNoteBook.PageIndex;
|
||||||
end;
|
end;
|
||||||
// Close all but the active editor
|
// Close all but the active editor
|
||||||
InvertedFileClose(PageIndex, SrcNoteBook);
|
InvertedFileClose(PageIndex, SrcNoteBook, ceoCloseOthersOnRightSide in ACloseOptions);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
mnuCloseClicked(Sender); // close only the clicked source editor
|
mnuCloseClicked(Sender); // close only the clicked source editor
|
||||||
|
@ -562,6 +562,8 @@ type
|
|||||||
{ TSourceNotebook }
|
{ TSourceNotebook }
|
||||||
|
|
||||||
TJumpHistoryAction = (jhaBack, jhaForward, jhaViewWindow);
|
TJumpHistoryAction = (jhaBack, jhaForward, jhaViewWindow);
|
||||||
|
TCloseSrcEditorOption = (ceoCloseOthers, ceoCloseOthersOnRightSide);
|
||||||
|
TCloseSrcEditorOptions = set of TCloseSrcEditorOption;
|
||||||
|
|
||||||
TOnJumpToHistoryPoint = procedure(out NewCaretXY: TPoint;
|
TOnJumpToHistoryPoint = procedure(out NewCaretXY: TPoint;
|
||||||
out NewTopLine: integer;
|
out NewTopLine: integer;
|
||||||
@ -571,7 +573,7 @@ type
|
|||||||
AEditor: TSourceEditor; DeleteForwardHistory: boolean) of object;
|
AEditor: TSourceEditor; DeleteForwardHistory: boolean) of object;
|
||||||
TOnMovingPage = procedure(Sender: TObject;
|
TOnMovingPage = procedure(Sender: TObject;
|
||||||
OldPageIndex, NewPageIndex: integer) of object;
|
OldPageIndex, NewPageIndex: integer) of object;
|
||||||
TOnCloseSrcEditor = procedure(Sender: TObject; InvertedClose: boolean) of object;
|
TOnCloseSrcEditor = procedure(Sender: TObject; ACloseOptions: TCloseSrcEditorOptions) of object;
|
||||||
TOnShowHintForSource = procedure(SrcEdit: TSourceEditor;
|
TOnShowHintForSource = procedure(SrcEdit: TSourceEditor;
|
||||||
CaretPos: TPoint; AutoShown: Boolean) of object;
|
CaretPos: TPoint; AutoShown: Boolean) of object;
|
||||||
TOnInitIdentCompletion = procedure(Sender: TObject; JumpToError: boolean;
|
TOnInitIdentCompletion = procedure(Sender: TObject; JumpToError: boolean;
|
||||||
@ -797,7 +799,7 @@ type
|
|||||||
procedure EndAutoFocusLock;
|
procedure EndAutoFocusLock;
|
||||||
protected
|
protected
|
||||||
procedure CloseTabClicked(Sender: TObject);
|
procedure CloseTabClicked(Sender: TObject);
|
||||||
procedure CloseClicked(Sender: TObject; CloseOthers: Boolean = False);
|
procedure CloseClicked(Sender: TObject; CloseOptions: TCloseSrcEditorOptions = []);
|
||||||
procedure ToggleFormUnitClicked(Sender: TObject);
|
procedure ToggleFormUnitClicked(Sender: TObject);
|
||||||
procedure ToggleObjectInspClicked(Sender: TObject);
|
procedure ToggleObjectInspClicked(Sender: TObject);
|
||||||
|
|
||||||
@ -1213,6 +1215,7 @@ type
|
|||||||
private
|
private
|
||||||
// Context-Menu
|
// Context-Menu
|
||||||
procedure CloseOtherPagesClicked(Sender: TObject);
|
procedure CloseOtherPagesClicked(Sender: TObject);
|
||||||
|
procedure CloseRightPagesClicked(Sender: TObject);
|
||||||
procedure ReadOnlyClicked(Sender: TObject);
|
procedure ReadOnlyClicked(Sender: TObject);
|
||||||
procedure ToggleLineNumbersClicked(Sender: TObject);
|
procedure ToggleLineNumbersClicked(Sender: TObject);
|
||||||
procedure ToggleI18NForLFMClicked(Sender: TObject);
|
procedure ToggleI18NForLFMClicked(Sender: TObject);
|
||||||
@ -1353,6 +1356,7 @@ var
|
|||||||
SrcEditMenuOpenFileAtCursor: TIDEMenuCommand;
|
SrcEditMenuOpenFileAtCursor: TIDEMenuCommand;
|
||||||
SrcEditMenuClosePage: TIDEMenuCommand;
|
SrcEditMenuClosePage: TIDEMenuCommand;
|
||||||
SrcEditMenuCloseOtherPages: TIDEMenuCommand;
|
SrcEditMenuCloseOtherPages: TIDEMenuCommand;
|
||||||
|
SrcEditMenuCloseOtherPagesToRight: TIDEMenuCommand;
|
||||||
// bookmarks
|
// bookmarks
|
||||||
SrcEditMenuNextBookmark: TIDEMenuCommand;
|
SrcEditMenuNextBookmark: TIDEMenuCommand;
|
||||||
SrcEditMenuPrevBookmark: TIDEMenuCommand;
|
SrcEditMenuPrevBookmark: TIDEMenuCommand;
|
||||||
@ -1535,6 +1539,8 @@ begin
|
|||||||
'Close Page', uemClosePage, nil, @ExecuteIdeMenuClick, nil, 'menu_close');
|
'Close Page', uemClosePage, nil, @ExecuteIdeMenuClick, nil, 'menu_close');
|
||||||
SrcEditMenuCloseOtherPages := RegisterIDEMenuCommand(AParent,
|
SrcEditMenuCloseOtherPages := RegisterIDEMenuCommand(AParent,
|
||||||
'Close All Other Pages',uemCloseOtherPages, nil, @ExecuteIdeMenuClick);
|
'Close All Other Pages',uemCloseOtherPages, nil, @ExecuteIdeMenuClick);
|
||||||
|
SrcEditMenuCloseOtherPagesToRight := RegisterIDEMenuCommand(AParent,
|
||||||
|
'Close Pages To the Right',uemCloseOtherPagesRight, nil, @ExecuteIdeMenuClick);
|
||||||
|
|
||||||
{$IFnDEF SingleSrcWindow}
|
{$IFnDEF SingleSrcWindow}
|
||||||
// Lock Editor
|
// Lock Editor
|
||||||
@ -8319,8 +8325,13 @@ end;
|
|||||||
|
|
||||||
procedure TSourceNotebook.CloseTabClicked(Sender: TObject);
|
procedure TSourceNotebook.CloseTabClicked(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CloseClicked(Sender,
|
if GetKeyShiftState * [ssShift, ssCtrl, ssAlt] = EditorOpts.MiddleTabClickClosesOthersModifier then
|
||||||
(GetKeyState(VK_CONTROL) < 0) and EditorOpts.CtrlMiddleTabClickClosesOthers);
|
CloseClicked(Sender, [ceoCloseOthers])
|
||||||
|
else
|
||||||
|
if GetKeyShiftState * [ssShift, ssCtrl, ssAlt] = EditorOpts.MiddleTabClickClosesToRightModifier then
|
||||||
|
CloseClicked(Sender, [ceoCloseOthersOnRightSide])
|
||||||
|
else
|
||||||
|
CloseClicked(Sender, []);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSourceNotebook.GetEditors(Index:integer):TSourceEditor;
|
function TSourceNotebook.GetEditors(Index:integer):TSourceEditor;
|
||||||
@ -8355,10 +8366,11 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.CloseClicked(Sender: TObject; CloseOthers: Boolean);
|
procedure TSourceNotebook.CloseClicked(Sender: TObject;
|
||||||
|
CloseOptions: TCloseSrcEditorOptions);
|
||||||
Begin
|
Begin
|
||||||
if assigned(Manager) and Assigned(Manager.OnCloseClicked) then
|
if assigned(Manager) and Assigned(Manager.OnCloseClicked) then
|
||||||
Manager.OnCloseClicked(Sender, CloseOthers);
|
Manager.OnCloseClicked(Sender, CloseOptions);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.ToggleFormUnitClicked(Sender: TObject);
|
procedure TSourceNotebook.ToggleFormUnitClicked(Sender: TObject);
|
||||||
@ -8598,9 +8610,15 @@ begin
|
|||||||
if (Button = mbMiddle) then
|
if (Button = mbMiddle) then
|
||||||
begin
|
begin
|
||||||
TabIndex:=FNotebook.IndexOfPageAt(X, Y);
|
TabIndex:=FNotebook.IndexOfPageAt(X, Y);
|
||||||
if TabIndex>=0 then
|
if TabIndex>=0 then begin
|
||||||
CloseClicked(NoteBookPage[TabIndex],
|
if GetKeyShiftState * [ssShift, ssCtrl, ssAlt] = EditorOpts.MiddleTabClickClosesOthersModifier then
|
||||||
(GetKeyState(VK_CONTROL) < 0) and EditorOpts.CtrlMiddleTabClickClosesOthers);
|
CloseClicked(NoteBookPage[TabIndex], [ceoCloseOthers])
|
||||||
|
else
|
||||||
|
if GetKeyShiftState * [ssShift, ssCtrl, ssAlt] = EditorOpts.MiddleTabClickClosesToRightModifier then
|
||||||
|
CloseClicked(NoteBookPage[TabIndex], [ceoCloseOthersOnRightSide])
|
||||||
|
else
|
||||||
|
CloseClicked(NoteBookPage[TabIndex], []);
|
||||||
|
end;
|
||||||
end else
|
end else
|
||||||
if (Button = mbRight) then
|
if (Button = mbRight) then
|
||||||
begin
|
begin
|
||||||
@ -10674,6 +10692,7 @@ begin
|
|||||||
{%region *** Pages section ***}
|
{%region *** Pages section ***}
|
||||||
SrcEditMenuClosePage.Command := GetCommand(ecClose);
|
SrcEditMenuClosePage.Command := GetCommand(ecClose);
|
||||||
SrcEditMenuCloseOtherPages.OnClick := @SourceEditorManager.CloseOtherPagesClicked;
|
SrcEditMenuCloseOtherPages.OnClick := @SourceEditorManager.CloseOtherPagesClicked;
|
||||||
|
SrcEditMenuCloseOtherPagesToRight.OnClick := @SourceEditorManager.CloseRightPagesClicked;
|
||||||
|
|
||||||
{$IFnDEF SingleSrcWindow}
|
{$IFnDEF SingleSrcWindow}
|
||||||
SrcEditMenuEditorLock.Command := GetCommand(ecLockEditor);
|
SrcEditMenuEditorLock.Command := GetCommand(ecLockEditor);
|
||||||
@ -11306,7 +11325,13 @@ end;
|
|||||||
procedure TSourceEditorManager.CloseOtherPagesClicked(Sender: TObject);
|
procedure TSourceEditorManager.CloseOtherPagesClicked(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if Assigned(OnCloseClicked) then
|
if Assigned(OnCloseClicked) then
|
||||||
OnCloseClicked(Sender, True);
|
OnCloseClicked(Sender, [ceoCloseOthers]);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TSourceEditorManager.CloseRightPagesClicked(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if Assigned(OnCloseClicked) then
|
||||||
|
OnCloseClicked(Sender, [ceoCloseOthersOnRightSide]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceEditorManager.ReadOnlyClicked(Sender: TObject);
|
procedure TSourceEditorManager.ReadOnlyClicked(Sender: TObject);
|
||||||
|
@ -229,7 +229,7 @@ function CloseProject: TModalResult;
|
|||||||
procedure OpenProject(aMenuItem: TIDEMenuItem);
|
procedure OpenProject(aMenuItem: TIDEMenuItem);
|
||||||
function CompleteLoadingProjectInfo: TModalResult;
|
function CompleteLoadingProjectInfo: TModalResult;
|
||||||
procedure CloseAll;
|
procedure CloseAll;
|
||||||
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook);
|
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook; CloseOnRightSideOnly: Boolean = False);
|
||||||
// designer
|
// designer
|
||||||
function DesignerUnitIsVirtual(aLookupRoot: TComponent): Boolean;
|
function DesignerUnitIsVirtual(aLookupRoot: TComponent): Boolean;
|
||||||
function CheckLFMInEditor(LFMUnitInfo: TUnitInfo; Quiet: boolean): TModalResult;
|
function CheckLFMInEditor(LFMUnitInfo: TUnitInfo; Quiet: boolean): TModalResult;
|
||||||
@ -4258,7 +4258,8 @@ begin
|
|||||||
PkgBoss.DoCloseAllPackageEditors;
|
PkgBoss.DoCloseAllPackageEditors;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook);
|
procedure InvertedFileClose(PageIndex: LongInt; SrcNoteBook: TSourceNotebook;
|
||||||
|
CloseOnRightSideOnly: Boolean);
|
||||||
// close all source editors except the clicked
|
// close all source editors except the clicked
|
||||||
var
|
var
|
||||||
Ed: TSourceEditor;
|
Ed: TSourceEditor;
|
||||||
@ -4270,7 +4271,11 @@ begin
|
|||||||
// Collect changed editors, except the active one, into a list and maybe save them.
|
// Collect changed editors, except the active one, into a list and maybe save them.
|
||||||
for i := 0 to SrcNoteBook.EditorCount - 1 do begin
|
for i := 0 to SrcNoteBook.EditorCount - 1 do begin
|
||||||
Ed := SrcNoteBook.Editors[i];
|
Ed := SrcNoteBook.Editors[i];
|
||||||
if (i <> PageIndex) and CheckEditorNeedsSave(Ed, True) then
|
if ( (i > PageIndex) or // to right
|
||||||
|
( (i <> PageIndex) and not CloseOnRightSideOnly )
|
||||||
|
) and
|
||||||
|
CheckEditorNeedsSave(Ed, True)
|
||||||
|
then
|
||||||
EditorList.Add(Ed);
|
EditorList.Add(Ed);
|
||||||
end;
|
end;
|
||||||
if AskToSaveEditors(EditorList) <> mrOK then Exit;
|
if AskToSaveEditors(EditorList) <> mrOK then Exit;
|
||||||
@ -4282,7 +4287,11 @@ begin
|
|||||||
try
|
try
|
||||||
repeat
|
repeat
|
||||||
i:=SrcNoteBook.PageCount-1;
|
i:=SrcNoteBook.PageCount-1;
|
||||||
if i=PageIndex then dec(i);
|
if i=PageIndex then
|
||||||
|
if CloseOnRightSideOnly then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
dec(i);
|
||||||
if i<0 then break;
|
if i<0 then break;
|
||||||
if CloseEditorFile(SrcNoteBook.FindSourceEditorWithPageIndex(i),[])<>mrOk then exit;
|
if CloseEditorFile(SrcNoteBook.FindSourceEditorWithPageIndex(i),[])<>mrOk then exit;
|
||||||
if i<PageIndex then PageIndex:=i;
|
if i<PageIndex then PageIndex:=i;
|
||||||
|
Loading…
Reference in New Issue
Block a user