Options / Editor: Allow multiline tab, move tab related options to correct frame

git-svn-id: trunk@48126 -
This commit is contained in:
martin 2015-03-04 13:50:08 +00:00
parent 880871e653
commit e636205034
7 changed files with 96 additions and 73 deletions

View File

@ -1299,6 +1299,7 @@ type
// general options
fFindTextAtCursor: Boolean;
fShowTabCloseButtons: Boolean;
FMultiLineTab: Boolean;
fShowTabNumbers: Boolean;
fUseTabHistory: Boolean;
fTabPosition: TTabPosition;
@ -1453,6 +1454,10 @@ type
read fSynEditOptions2 write fSynEditOptions2 default SynEditDefaultOptions2;
property ShowTabCloseButtons: Boolean
read fShowTabCloseButtons write fShowTabCloseButtons;
published
property MultiLineTab: Boolean
read FMultiLineTab write FMultiLineTab default False;
public
property HideSingleTabInWindow: Boolean
read FHideSingleTabInWindow write FHideSingleTabInWindow;
property ShowTabNumbers: Boolean read fShowTabNumbers write fShowTabNumbers;
@ -4380,6 +4385,7 @@ procedure TEditorOptions.Init;
begin
// General options
fShowTabCloseButtons := True;
FMultiLineTab := False;
FHideSingleTabInWindow := False;
fTabPosition := tpTop;
FCopyWordAtCursorOnCopyNone := True;

View File

@ -15,9 +15,9 @@ object EditorGeneralMiscOptionsFrame: TEditorGeneralMiscOptionsFrame
AnchorSideTop.Control = EditorTrimSpaceTypeCheckBox
AnchorSideTop.Side = asrCenter
Left = 156
Height = 16
Top = 161
Width = 142
Height = 15
Top = 29
Width = 141
BorderSpacing.Left = 6
Caption = 'EditorTrimSpaceTypeLabel'
ParentColor = False
@ -30,7 +30,7 @@ object EditorGeneralMiscOptionsFrame: TEditorGeneralMiscOptionsFrame
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 0
Height = 152
Height = 19
Top = 0
Width = 460
Anchors = [akTop, akLeft, akRight]
@ -56,37 +56,11 @@ object EditorGeneralMiscOptionsFrame: TEditorGeneralMiscOptionsFrame
AnchorSideTop.Side = asrBottom
Left = 0
Height = 23
Top = 158
Top = 25
Width = 150
BorderSpacing.Top = 6
ItemHeight = 15
Style = csDropDownList
TabOrder = 1
end
object EditorTabPositionCheckBox: TComboBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = EditorTrimSpaceTypeCheckBox
AnchorSideTop.Side = asrBottom
Left = 0
Height = 23
Top = 187
Width = 150
BorderSpacing.Top = 6
ItemHeight = 15
Style = csDropDownList
TabOrder = 2
end
object EditorTabPositionLabel: TLabel
AnchorSideLeft.Control = EditorTrimSpaceTypeCheckBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = EditorTabPositionCheckBox
AnchorSideTop.Side = asrCenter
Left = 156
Height = 16
Top = 190
Width = 142
BorderSpacing.Left = 6
Caption = 'EditorTrimSpaceTypeLabel'
ParentColor = False
end
end

View File

@ -41,9 +41,7 @@ type
TEditorGeneralMiscOptionsFrame = class(TAbstractIDEOptionsEditor)
EditorTrimSpaceTypeCheckBox: TComboBox;
EditorOptionsGroupBox: TCheckGroup;
EditorTabPositionCheckBox: TComboBox;
EditorTrimSpaceTypeLabel: TLabel;
EditorTabPositionLabel: TLabel;
procedure EditorOptionsGroupBoxItemClick(Sender: TObject; Index: integer);
private
FDialog: TAbstractOptionsEditorDialog;
@ -94,16 +92,9 @@ begin
EditorTrimSpaceTypeCheckBox.Items.Add(dlgTrimSpaceTypeCaretMove);
EditorTrimSpaceTypeCheckBox.Items.Add(dlgTrimSpaceTypePosOnly);
EditorTrimSpaceTypeLabel.Caption := dlgTrimSpaceTypeCaption;
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosTop);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosBottom);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosLeft);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosRight);
EditorTabPositionLabel.Caption := dlgNotebookTabPos;
end;
procedure TEditorGeneralMiscOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
const
TabPosToIndex : Array [TTabPosition] of Integer = (0, 1, 2, 3);
begin
with AOptions as TEditorOptions do
begin
@ -120,7 +111,6 @@ begin
{$ENDIF}
end;
EditorTrimSpaceTypeCheckBox.ItemIndex := ord(TrimSpaceType);
EditorTabPositionCheckBox.ItemIndex := TabPosToIndex[TabPosition];
end;
end;
@ -134,8 +124,6 @@ procedure TEditorGeneralMiscOptionsFrame.WriteSettings(AOptions: TAbstractIDEOpt
TEditorOptions(AOptions).SynEditOptions := TEditorOptions(AOptions).SynEditOptions - [AnOption];
end;
const
TabIndexToPos : Array [0..3] of TTabPosition = (tpTop, tpBottom, tpLeft, tpRight);
begin
with AOptions as TEditorOptions do
begin
@ -149,7 +137,6 @@ begin
else
SynEditOptions2 := SynEditOptions2 - [eoFoldedCopyPaste];
TrimSpaceType := TSynEditStringTrimmingType(EditorTrimSpaceTypeCheckBox.ItemIndex);
TabPosition := TabIndexToPos[EditorTabPositionCheckBox.ItemIndex];
{$IFDEF WinIME}
UseMinimumIme := EditorOptionsGroupBox.Checked[5];
{$ENDIF}

View File

@ -1,4 +1,4 @@
inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
object EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
Left = 0
Height = 415
Top = 0
@ -21,15 +21,15 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 214
Top = 201
Height = 192
Top = 223
Width = 509
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BevelOuter = bvNone
ClientHeight = 214
ClientHeight = 192
ClientWidth = 509
TabOrder = 0
object listAccessType: TCheckListBox
@ -62,7 +62,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
TabOrder = 1
object lblAccessTypeDesc: TLabel
Left = 0
Height = 16
Height = 15
Top = 0
Width = 509
Align = alTop
@ -89,7 +89,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 3
Top = 92
Top = 116
Width = 60
BorderSpacing.Bottom = 6
end
@ -99,9 +99,9 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideTop.Control = pnlNBTabs
AnchorSideTop.Side = asrBottom
Left = 70
Height = 16
Top = 85
Width = 167
Height = 15
Top = 110
Width = 166
BorderSpacing.Left = 10
BorderSpacing.Bottom = 6
Caption = 'lblEditActivationOrderSection'
@ -116,10 +116,10 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 247
Left = 246
Height = 3
Top = 92
Width = 274
Top = 116
Width = 275
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 10
end
@ -130,8 +130,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 66
Top = 107
Height = 65
Top = 131
Width = 509
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -139,12 +139,12 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
BevelOuter = bvNone
ClientHeight = 66
ClientHeight = 65
ClientWidth = 509
TabOrder = 1
object lblAccessOrder: TLabel
Left = 0
Height = 16
Height = 15
Top = 0
Width = 509
Align = alTop
@ -161,7 +161,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 22
Top = 21
Width = 509
Anchors = [akTop, akLeft, akRight]
Caption = 'radioAccessOrderEdit'
@ -178,7 +178,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 19
Top = 41
Top = 40
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -194,8 +194,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 16
Top = 179
Height = 15
Top = 202
Width = 521
Anchors = [akTop, akLeft, akRight]
Caption = 'lblAccessType'
@ -209,7 +209,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Side = asrBottom
Left = 0
Height = 3
Top = 7
Top = 6
Width = 60
BorderSpacing.Bottom = 6
end
@ -218,9 +218,9 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
Left = 70
Height = 16
Height = 15
Top = 0
Width = 127
Width = 126
BorderSpacing.Left = 10
BorderSpacing.Bottom = 6
Caption = 'lblMultiWinTabSection'
@ -235,10 +235,10 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 207
Left = 206
Height = 3
Top = 7
Width = 314
Top = 6
Width = 315
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 10
end
@ -249,8 +249,8 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 57
Top = 22
Height = 83
Top = 21
Width = 509
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -259,7 +259,7 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
BorderSpacing.Bottom = 6
BevelOuter = bvNone
ChildSizing.ControlsPerLine = 2
ClientHeight = 57
ClientHeight = 83
ClientWidth = 509
TabOrder = 2
object chkShowCloseBtn: TCheckBox
@ -338,5 +338,41 @@ inherited EditorMultiWindowOptionsFrame: TEditorMultiWindowOptionsFrame
Width = 1
ParentColor = False
end
object chkMultiLine: TCheckBox
AnchorSideLeft.Control = CenterLabel
AnchorSideTop.Control = chkUseTabHistory
AnchorSideTop.Side = asrBottom
Left = 254
Height = 19
Top = 38
Width = 89
Caption = 'chkMultiLine'
TabOrder = 5
end
object EditorTabPositionLabel: TLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = EditorTabPositionCheckBox
AnchorSideTop.Side = asrCenter
Left = 156
Height = 15
Top = 64
Width = 122
BorderSpacing.Left = 6
Caption = 'EditorTabPositionLabel'
ParentColor = False
end
object EditorTabPositionCheckBox: TComboBox
AnchorSideLeft.Control = pnlNBTabs
AnchorSideTop.Control = chkCtrlMiddleCloseOthers
AnchorSideTop.Side = asrBottom
Left = 0
Height = 23
Top = 60
Width = 150
BorderSpacing.Top = 3
ItemHeight = 15
Style = csDropDownList
TabOrder = 6
end
end
end

View File

@ -38,11 +38,14 @@ type
Bevel2a: TBevel;
Bevel2: TBevel;
CenterLabel: TLabel;
chkMultiLine: TCheckBox;
chkCtrlMiddleCloseOthers: TCheckBox;
chkUseTabHistory: TCheckBox;
chkShowCloseBtn: TCheckBox;
chkShowNumbers: TCheckBox;
chkHideSingleTab: TCheckBox;
EditorTabPositionCheckBox: TComboBox;
EditorTabPositionLabel: TLabel;
lblAccessTypeDesc: TLabel;
lblMultiWinTabSection: TLabel;
listAccessType: TCheckListBox;
@ -140,11 +143,19 @@ begin
chkShowCloseBtn.Caption := dlgCloseButtonsNotebook;
chkUseTabHistory.Caption := dlgUseTabsHistory;
chkCtrlMiddleCloseOthers.Caption := dlgCtrlMiddleTabCloseOtherPages;
chkMultiLine.Caption := dlgSourceEditTabMultiLine;
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosTop);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosBottom);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosLeft);
EditorTabPositionCheckBox.Items.Add(lisNotebookTabPosRight);
EditorTabPositionLabel.Caption := dlgNotebookTabPos;
end;
procedure TEditorMultiWindowOptionsFrame.ReadSettings(
AOptions: TAbstractIDEOptions);
const
TabPosToIndex : Array [TTabPosition] of Integer = (0, 1, 2, 3);
var
i: Integer;
begin
@ -154,6 +165,8 @@ begin
chkShowCloseBtn.Checked := ShowTabCloseButtons and chkShowCloseBtn.Enabled;
chkUseTabHistory.Checked := UseTabHistory;
chkCtrlMiddleCloseOthers.Checked := CtrlMiddleTabClickClosesOthers;
chkMultiLine.Checked := MultiLineTab;
EditorTabPositionCheckBox.ItemIndex := TabPosToIndex[TabPosition];
end;
FMultiWinEditAccessOrder.Assign(TEditorOptions(AOptions).MultiWinEditAccessOrder);
@ -171,6 +184,8 @@ end;
procedure TEditorMultiWindowOptionsFrame.WriteSettings(
AOptions: TAbstractIDEOptions);
const
TabIndexToPos : Array [0..3] of TTabPosition = (tpTop, tpBottom, tpLeft, tpRight);
begin
TEditorOptions(AOptions).MultiWinEditAccessOrder.Assign(FMultiWinEditAccessOrder);
with TEditorOptions(AOptions) do begin
@ -179,6 +194,8 @@ begin
ShowTabCloseButtons := chkShowCloseBtn.Checked;
UseTabHistory := chkUseTabHistory.Checked;
CtrlMiddleTabClickClosesOthers := chkCtrlMiddleCloseOthers.Checked;
MultiLineTab := chkMultiLine.Checked;
TabPosition := TabIndexToPos[EditorTabPositionCheckBox.ItemIndex];
end;
end;

View File

@ -1490,6 +1490,7 @@ resourcestring
lisShowSpecialCharacters = 'Show special characters';
dlgCloseButtonsNotebook = 'Show close buttons in notebook';
dlgCtrlMiddleTabCloseOtherPages = 'Ctrl-middle-click on tab closes all others';
dlgSourceEditTabMultiLine = 'Multiline tabs';
dlgHideSingleTabInNotebook = 'Hide tab in single page windows';
dlgTabNumbersNotebook = 'Show tab numbers in notebook';
dlgNotebookTabPos = 'Source notebook tabs position';

View File

@ -5783,6 +5783,7 @@ Begin
Options:=Options+[nboShowCloseButtons]
else
Options:=Options-[nboShowCloseButtons];
MultiLine := EditorOpts.MultiLineTab;
TabPosition := EditorOpts.TabPosition;
OnChange := @NotebookPageChanged;
OnCloseTabClicked := @CloseTabClicked;
@ -8152,6 +8153,7 @@ Begin
FNoteBook.Options:=FNoteBook.Options+[nboShowCloseButtons]
else
FNoteBook.Options:=FNoteBook.Options-[nboShowCloseButtons];
FNoteBook.MultiLine := EditorOpts.MultiLineTab;
FNotebook.TabPosition := EditorOpts.TabPosition;
Exclude(States,snWarnedFont);