mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 10:50:53 +02:00
IDE: compiler options: show options dlg: option to split params into multiple lines
git-svn-id: trunk@58062 -
This commit is contained in:
parent
359470d503
commit
a035226c5e
@ -5288,6 +5288,7 @@ resourcestring
|
||||
lisFPCMessagesAppendix = 'FPC messages: Appendix';
|
||||
lisRelativePaths = 'Relative paths';
|
||||
lisInheritedParameters = 'Inherited parameters';
|
||||
lisShowMultipleLines = 'Show multiple lines';
|
||||
lisShowRelativePaths = 'Show relative paths';
|
||||
lisCommandLineParameters = 'Command line parameters';
|
||||
liswlWatchList = 'Watches';
|
||||
|
@ -95,6 +95,7 @@ type
|
||||
FFindRenameIdentifierOptions: TFindRenameIdentifierOptions;
|
||||
FMakeResourceStringInsertPolicy: TResourcestringInsertPolicy;
|
||||
FShowCompOptFullFilenames: boolean;
|
||||
FShowCompOptMultiLine: boolean;
|
||||
FSortSelDirection: TSortDirection;
|
||||
FSortSelDomain: TSortDomain;
|
||||
fSavedStamp: integer;
|
||||
@ -106,6 +107,7 @@ type
|
||||
AValue: TResourcestringInsertPolicy);
|
||||
procedure SetModified(AValue: boolean);
|
||||
procedure SetShowCompOptFullFilenames(AValue: boolean);
|
||||
procedure SetShowCompOptMultiLine(const AValue: boolean);
|
||||
procedure SetSortSelDirection(AValue: TSortDirection);
|
||||
public
|
||||
constructor Create;
|
||||
@ -130,6 +132,8 @@ type
|
||||
read FFindRenameIdentifierOptions;
|
||||
property ShowCompOptFullFilenames: boolean read FShowCompOptFullFilenames
|
||||
write SetShowCompOptFullFilenames;
|
||||
property ShowCompOptMultiLine: boolean read FShowCompOptMultiLine
|
||||
write SetShowCompOptMultiLine;
|
||||
end;
|
||||
|
||||
const
|
||||
@ -269,6 +273,13 @@ begin
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TMiscellaneousOptions.SetShowCompOptMultiLine(const AValue: boolean);
|
||||
begin
|
||||
if FShowCompOptMultiLine=AValue then Exit;
|
||||
FShowCompOptMultiLine:=AValue;
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TMiscellaneousOptions.SetSortSelDirection(AValue: TSortDirection);
|
||||
begin
|
||||
if FSortSelDirection=AValue then Exit;
|
||||
@ -308,6 +319,7 @@ begin
|
||||
FindRenameIdentifierOptions.LoadFromXMLConfig(XMLConfig,
|
||||
Path+'FindRenameIdentifier/');
|
||||
ShowCompOptFullFilenames:=XMLConfig.GetValue(Path+'ShowCompOpts/Filenames/Full',false);
|
||||
ShowCompOptMultiLine:=XMLConfig.GetValue(Path+'ShowCompOpts/MultiLine',true);
|
||||
finally
|
||||
XMLConfig.Free;
|
||||
end;
|
||||
@ -352,7 +364,7 @@ begin
|
||||
'NewProc');
|
||||
FindRenameIdentifierOptions.SaveToXMLConfig(XMLConfig,
|
||||
Path+'FindRenameIdentifier/');
|
||||
XMLConfig.SetDeleteValue(Path+'ShowCompOpts/Filenames/Full',ShowCompOptFullFilenames,false);
|
||||
XMLConfig.SetDeleteValue(Path+'ShowCompOpts/MultLine',ShowCompOptMultiLine,true);
|
||||
XMLConfig.Flush;
|
||||
finally
|
||||
XMLConfig.Free;
|
||||
|
@ -13,17 +13,17 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
Position = poOwnerFormCenter
|
||||
LCLVersion = '1.3'
|
||||
LCLVersion = '1.9.0.0'
|
||||
object CloseButton: TBitBtn
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
AnchorSideBottom.Control = Owner
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 392
|
||||
Height = 22
|
||||
Top = 392
|
||||
Width = 83
|
||||
Left = 400
|
||||
Height = 28
|
||||
Top = 386
|
||||
Width = 75
|
||||
Anchors = [akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
@ -36,22 +36,22 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
object PageControl1: TPageControl
|
||||
AnchorSideBottom.Control = CloseButton
|
||||
Left = 0
|
||||
Height = 386
|
||||
Height = 380
|
||||
Top = 0
|
||||
Width = 481
|
||||
ActivePage = InheritedParamsTabSheet
|
||||
ActivePage = CmdLineParamsTabSheet
|
||||
Align = alTop
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
TabIndex = 1
|
||||
TabIndex = 0
|
||||
TabOrder = 1
|
||||
object CmdLineParamsTabSheet: TTabSheet
|
||||
Caption = 'CmdLineParams'
|
||||
ClientHeight = 351
|
||||
ClientHeight = 353
|
||||
ClientWidth = 477
|
||||
object CmdLineMemo: TMemo
|
||||
AnchorSideBottom.Control = RelativePathsCheckBox
|
||||
Left = 6
|
||||
Height = 252
|
||||
Height = 317
|
||||
Top = 6
|
||||
Width = 465
|
||||
Align = alTop
|
||||
@ -69,8 +69,8 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 24
|
||||
Top = 264
|
||||
Width = 154
|
||||
Top = 329
|
||||
Width = 155
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = 'RelativePathsCheckBox'
|
||||
Checked = True
|
||||
@ -78,18 +78,33 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
State = cbChecked
|
||||
TabOrder = 1
|
||||
end
|
||||
object MultilineCheckBox: TCheckBox
|
||||
AnchorSideLeft.Control = RelativePathsCheckBox
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = RelativePathsCheckBox
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 176
|
||||
Height = 24
|
||||
Top = 329
|
||||
Width = 128
|
||||
BorderSpacing.Left = 15
|
||||
Caption = 'MultilineCheckBox'
|
||||
Checked = True
|
||||
OnChange = MultilineCheckBoxChange
|
||||
State = cbChecked
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object InheritedParamsTabSheet: TTabSheet
|
||||
Caption = 'InheritedParams'
|
||||
ClientHeight = 347
|
||||
ClientWidth = 475
|
||||
ClientHeight = 353
|
||||
ClientWidth = 477
|
||||
object InhTreeView: TTreeView
|
||||
Left = 0
|
||||
Height = 281
|
||||
Height = 287
|
||||
Top = 0
|
||||
Width = 475
|
||||
Width = 477
|
||||
Align = alClient
|
||||
DefaultItemHeight = 18
|
||||
ReadOnly = True
|
||||
RightClickSelect = True
|
||||
TabOrder = 0
|
||||
@ -99,8 +114,8 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
object InhItemMemo: TMemo
|
||||
Left = 0
|
||||
Height = 61
|
||||
Top = 286
|
||||
Width = 475
|
||||
Top = 292
|
||||
Width = 477
|
||||
Align = alBottom
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoVertical
|
||||
@ -110,8 +125,8 @@ object ShowCompilerOptionsDlg: TShowCompilerOptionsDlg
|
||||
Cursor = crVSplit
|
||||
Left = 0
|
||||
Height = 5
|
||||
Top = 281
|
||||
Width = 475
|
||||
Top = 287
|
||||
Width = 477
|
||||
Align = alBottom
|
||||
ResizeAnchor = akBottom
|
||||
end
|
||||
|
@ -60,12 +60,14 @@ type
|
||||
InhItemMemo: TMemo;
|
||||
InhSplitter: TSplitter;
|
||||
InhTreeView: TTreeView;
|
||||
MultilineCheckBox: TCheckBox;
|
||||
PageControl1: TPageControl;
|
||||
RelativePathsCheckBox: TCheckBox;
|
||||
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure InhTreeViewSelectionChanged(Sender: TObject);
|
||||
procedure MultilineCheckBoxChange(Sender: TObject);
|
||||
procedure RelativePathsCheckBoxChange(Sender: TObject);
|
||||
private
|
||||
FCompilerOpts: TBaseCompilerOptions;
|
||||
@ -166,6 +168,11 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TShowCompilerOptionsDlg.MultilineCheckBoxChange(Sender: TObject);
|
||||
begin
|
||||
UpdateMemo;
|
||||
end;
|
||||
|
||||
procedure TShowCompilerOptionsDlg.FormCreate(Sender: TObject);
|
||||
begin
|
||||
ImageIndexPackage := IDEImages.LoadImage('item_package');
|
||||
@ -178,6 +185,8 @@ begin
|
||||
CmdLineParamsTabSheet.Caption:=lisCommandLineParameters;
|
||||
RelativePathsCheckBox.Caption:=lisShowRelativePaths;
|
||||
RelativePathsCheckBox.Checked:=not MiscellaneousOptions.ShowCompOptFullFilenames;
|
||||
MultilineCheckBox.Caption:=lisShowMultipleLines;
|
||||
MultilineCheckBox.Checked:=not MiscellaneousOptions.ShowCompOptMultiLine;
|
||||
|
||||
InheritedParamsTabSheet.Caption:=lisInheritedParameters;
|
||||
InhTreeView.Images := IDEImages.Images_16;
|
||||
@ -190,6 +199,7 @@ procedure TShowCompilerOptionsDlg.FormClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
begin
|
||||
MiscellaneousOptions.ShowCompOptFullFilenames:=not RelativePathsCheckBox.Checked;
|
||||
MiscellaneousOptions.ShowCompOptMultiLine:=MultilineCheckBox.Checked;
|
||||
MiscellaneousOptions.Save;
|
||||
end;
|
||||
|
||||
@ -211,12 +221,24 @@ procedure TShowCompilerOptionsDlg.UpdateMemo;
|
||||
var
|
||||
Flags: TCompilerCmdLineOptions;
|
||||
CurOptions: String;
|
||||
ParamList: TStrings;
|
||||
begin
|
||||
if CompilerOpts=nil then exit;
|
||||
Flags:=CompilerOpts.DefaultMakeOptionsFlags;
|
||||
if not RelativePathsCheckBox.Checked then
|
||||
Include(Flags,ccloAbsolutePaths);
|
||||
CurOptions := CompilerOpts.MakeOptionsString(Flags);
|
||||
if MultilineCheckBox.Checked then begin
|
||||
ParamList:=TStringList.Create;
|
||||
try
|
||||
SplitCmdLineParams(CurOptions,ParamList);
|
||||
CurOptions:=ParamList.Text;
|
||||
finally
|
||||
ParamList.Free;
|
||||
end;
|
||||
CmdLineMemo.ScrollBars:=ssAutoBoth;
|
||||
end else
|
||||
CmdLineMemo.ScrollBars:=ssAutoVertical;
|
||||
CmdLineMemo.Lines.Text:=CurOptions;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user