mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 21:20:46 +02:00
Converter: Another revamp of settings GUI
git-svn-id: trunk@29377 -
This commit is contained in:
parent
23f651e8ad
commit
4f8d7a9757
@ -238,7 +238,7 @@ begin
|
|||||||
ReadNextAtom; // name
|
ReadNextAtom; // name
|
||||||
ReadNextAtom; // semicolon
|
ReadNextAtom; // semicolon
|
||||||
InsertPos:=CurPos.EndPos;
|
InsertPos:=CurPos.EndPos;
|
||||||
if fCTLink.Settings.Target in [ctLazarusDelphi, ctLazarusDelphiSameDfm] then
|
if fCTLink.Settings.SupportDelphi then
|
||||||
s:='{$IFDEF FPC}'+LineEnding+' {$MODE Delphi}'+LineEnding+'{$ENDIF}'
|
s:='{$IFDEF FPC}'+LineEnding+' {$MODE Delphi}'+LineEnding+'{$ENDIF}'
|
||||||
else
|
else
|
||||||
s:='{$MODE Delphi}';
|
s:='{$MODE Delphi}';
|
||||||
@ -278,9 +278,9 @@ begin
|
|||||||
LowKey:=LowerCase(Key);
|
LowKey:=LowerCase(Key);
|
||||||
// Form file resource rename or lowercase:
|
// Form file resource rename or lowercase:
|
||||||
if (LowKey='dfm') or (LowKey='xfm') then begin
|
if (LowKey='dfm') or (LowKey='xfm') then begin
|
||||||
if fCTLink.Settings.Target in [ctLazarusDelphi, ctLazarusDelphiSameDfm] then begin
|
if fCTLink.Settings.SupportDelphi then begin
|
||||||
// Use the same dfm file. Lowercase existing key.
|
// Use the same dfm file. Lowercase existing key.
|
||||||
if (fCTLink.Settings.Target=ctLazarusDelphiSameDfm) and (Key<>LowKey) then
|
if fCTLink.Settings.SameDfmFile and (Key<>LowKey) then
|
||||||
NewKey:=LowKey;
|
NewKey:=LowKey;
|
||||||
// Later IFDEF will be added so that Delphi can still use .dfm.
|
// Later IFDEF will be added so that Delphi can still use .dfm.
|
||||||
fDfmDirectiveStart:=ACleanPos;
|
fDfmDirectiveStart:=ACleanPos;
|
||||||
@ -302,7 +302,7 @@ begin
|
|||||||
ACleanPos:=FindCommentEnd(Src, ACleanPos, Scanner.NestedComments);
|
ACleanPos:=FindCommentEnd(Src, ACleanPos, Scanner.NestedComments);
|
||||||
until false;
|
until false;
|
||||||
// if there is already .lfm file, don't add IFDEF for .dfm / .lfm.
|
// if there is already .lfm file, don't add IFDEF for .dfm / .lfm.
|
||||||
if (fCTLink.Settings.Target=ctLazarusDelphi) and (fDfmDirectiveStart<>-1)
|
if fCTLink.Settings.SupportDelphi and (fDfmDirectiveStart<>-1)
|
||||||
and not AlreadyIsLfm then begin
|
and not AlreadyIsLfm then begin
|
||||||
// Add IFDEF for .lfm and .dfm allowing Delphi to use .dfm.
|
// Add IFDEF for .lfm and .dfm allowing Delphi to use .dfm.
|
||||||
s:='{$IFNDEF FPC}'+LineEnding+
|
s:='{$IFNDEF FPC}'+LineEnding+
|
||||||
|
@ -543,7 +543,7 @@ begin
|
|||||||
Result:=LazarusIDE.DoCloseEditorFile(ADfmFilename,[cfSaveFirst]);
|
Result:=LazarusIDE.DoCloseEditorFile(ADfmFilename,[cfSaveFirst]);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
end;
|
end;
|
||||||
if fSettings.Target=ctLazarusDelphiSameDfm then
|
if fSettings.SameDfmFile then
|
||||||
LfmFilename:=ADfmFilename
|
LfmFilename:=ADfmFilename
|
||||||
else begin
|
else begin
|
||||||
// Create a form file name based on the unit file name.
|
// Create a form file name based on the unit file name.
|
||||||
@ -555,7 +555,7 @@ begin
|
|||||||
DeleteFileUTF8(LfmFilename); // .lfm is older than .dfm -> remove .lfm
|
DeleteFileUTF8(LfmFilename); // .lfm is older than .dfm -> remove .lfm
|
||||||
if not FileExistsUTF8(LfmFilename) then begin
|
if not FileExistsUTF8(LfmFilename) then begin
|
||||||
// TODO: update project
|
// TODO: update project
|
||||||
if fSettings.Target=ctLazarusDelphi then
|
if fSettings.SupportDelphi and not fSettings.SameDfmFile then
|
||||||
Result:=CopyFileWithErrorDialogs(ADfmFilename,LfmFilename,[mbAbort])
|
Result:=CopyFileWithErrorDialogs(ADfmFilename,LfmFilename,[mbAbort])
|
||||||
else
|
else
|
||||||
Result:=fSettings.RenameFile(ADfmFilename,LfmFilename);
|
Result:=fSettings.RenameFile(ADfmFilename,LfmFilename);
|
||||||
@ -568,7 +568,7 @@ begin
|
|||||||
Result:=ConvertDfmToLfm(LfmFilename);
|
Result:=ConvertDfmToLfm(LfmFilename);
|
||||||
if Result<>mrOk then exit;
|
if Result<>mrOk then exit;
|
||||||
// Read form file code in.
|
// Read form file code in.
|
||||||
if fSettings.Target<>ctLazarusDelphiSameDfm then begin
|
if not fSettings.SameDfmFile then begin
|
||||||
Result:=LoadCodeBuffer(fLFMBuffer,LfmFilename,
|
Result:=LoadCodeBuffer(fLFMBuffer,LfmFilename,
|
||||||
[lbfCheckIfText,lbfUpdateFromDisk],true);
|
[lbfCheckIfText,lbfUpdateFromDisk],true);
|
||||||
end;
|
end;
|
||||||
@ -692,8 +692,7 @@ begin
|
|||||||
repeat
|
repeat
|
||||||
TryAgain:=False;
|
TryAgain:=False;
|
||||||
Result:=AskMissingUnits(MainUsedUnits.MissingUnits, ImplUsedUnits.MissingUnits,
|
Result:=AskMissingUnits(MainUsedUnits.MissingUnits, ImplUsedUnits.MissingUnits,
|
||||||
ExtractFileName(fLazUnitFilename),
|
ExtractFileName(fLazUnitFilename), fSettings.SupportDelphi);
|
||||||
fSettings.Target in [ctLazarusDelphi, ctLazarusDelphiSameDfm]);
|
|
||||||
case Result of
|
case Result of
|
||||||
// mrOK means: comment out.
|
// mrOK means: comment out.
|
||||||
mrOK: begin
|
mrOK: begin
|
||||||
@ -1270,7 +1269,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// Converter for main LPR file.
|
// Converter for main LPR file.
|
||||||
fMainUnitConverter:=TConvertDelphiUnit.Create(Self,fOrigPFilename,[]);
|
fMainUnitConverter:=TConvertDelphiUnit.Create(Self,fOrigPFilename,[]);
|
||||||
if fSettings.Target in [ctLazarusDelphi, ctLazarusDelphiSameDfm] then
|
if fSettings.SupportDelphi then
|
||||||
fMainUnitConverter.LazFileExt:=ExtractFileExt(fOrigPFilename)
|
fMainUnitConverter.LazFileExt:=ExtractFileExt(fOrigPFilename)
|
||||||
else
|
else
|
||||||
fMainUnitConverter.LazFileExt:='.lpr';
|
fMainUnitConverter.LazFileExt:='.lpr';
|
||||||
|
@ -1,24 +1,26 @@
|
|||||||
object ConvertSettingsForm: TConvertSettingsForm
|
object ConvertSettingsForm: TConvertSettingsForm
|
||||||
Left = 267
|
Left = 315
|
||||||
Height = 580
|
Height = 341
|
||||||
Top = 113
|
Top = 127
|
||||||
Width = 528
|
Width = 561
|
||||||
ActiveControl = ProjectPathEdit
|
ActiveControl = ProjectPathEdit
|
||||||
Caption = 'Convert Delphi unit, project or package '
|
Caption = 'Convert Delphi unit, project or package '
|
||||||
ClientHeight = 580
|
ClientHeight = 341
|
||||||
ClientWidth = 528
|
ClientWidth = 561
|
||||||
Constraints.MinHeight = 400
|
Constraints.MinHeight = 300
|
||||||
|
Constraints.MinWidth = 400
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '0.9.29'
|
LCLVersion = '0.9.31'
|
||||||
object ProjectPathEdit: TLabeledEdit
|
object ProjectPathEdit: TLabeledEdit
|
||||||
Left = 112
|
AnchorSideLeft.Control = Owner
|
||||||
Height = 21
|
Left = 9
|
||||||
|
Height = 17
|
||||||
Hint = 'Directory where project''s main file must be'
|
Hint = 'Directory where project''s main file must be'
|
||||||
Top = 15
|
Top = 32
|
||||||
Width = 372
|
Width = 287
|
||||||
Anchors = [akTop, akLeft, akRight]
|
BorderSpacing.Left = 9
|
||||||
BorderStyle = bsNone
|
BorderStyle = bsNone
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
EditLabel.AnchorSideLeft.Control = ProjectPathEdit
|
EditLabel.AnchorSideLeft.Control = ProjectPathEdit
|
||||||
@ -26,13 +28,12 @@ object ConvertSettingsForm: TConvertSettingsForm
|
|||||||
EditLabel.AnchorSideTop.Side = asrCenter
|
EditLabel.AnchorSideTop.Side = asrCenter
|
||||||
EditLabel.AnchorSideRight.Control = ProjectPathEdit
|
EditLabel.AnchorSideRight.Control = ProjectPathEdit
|
||||||
EditLabel.AnchorSideBottom.Control = ProjectPathEdit
|
EditLabel.AnchorSideBottom.Control = ProjectPathEdit
|
||||||
EditLabel.Left = 27
|
EditLabel.Left = 9
|
||||||
EditLabel.Height = 16
|
EditLabel.Height = 16
|
||||||
EditLabel.Top = 17
|
EditLabel.Top = 9
|
||||||
EditLabel.Width = 78
|
EditLabel.Width = 78
|
||||||
EditLabel.Caption = 'Project Path:'
|
EditLabel.Caption = 'Project Path:'
|
||||||
EditLabel.ParentColor = False
|
EditLabel.ParentColor = False
|
||||||
LabelPosition = lpLeft
|
|
||||||
LabelSpacing = 7
|
LabelSpacing = 7
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
@ -40,14 +41,15 @@ object ConvertSettingsForm: TConvertSettingsForm
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object BackupCheckBox: TCheckBox
|
object BackupCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = ProjectPathEdit
|
AnchorSideLeft.Control = TargetGroupBox
|
||||||
AnchorSideTop.Control = ProjectPathEdit
|
AnchorSideTop.Control = TargetGroupBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 112
|
Left = 12
|
||||||
Height = 21
|
Height = 20
|
||||||
Hint = 'Creates a Backup directory under project directory'
|
Hint = 'Creates a Backup directory under project directory'
|
||||||
Top = 45
|
Top = 165
|
||||||
Width = 208
|
Width = 208
|
||||||
|
BorderSpacing.Left = 3
|
||||||
BorderSpacing.Top = 9
|
BorderSpacing.Top = 9
|
||||||
Caption = 'Make backup of changed files'
|
Caption = 'Make backup of changed files'
|
||||||
Checked = True
|
Checked = True
|
||||||
@ -58,9 +60,9 @@ object ConvertSettingsForm: TConvertSettingsForm
|
|||||||
end
|
end
|
||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 39
|
Height = 40
|
||||||
Top = 535
|
Top = 295
|
||||||
Width = 516
|
Width = 549
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.Caption = '&OK'
|
OKButton.Caption = '&OK'
|
||||||
HelpButton.Name = 'HelpButton'
|
HelpButton.Name = 'HelpButton'
|
||||||
@ -73,297 +75,304 @@ object ConvertSettingsForm: TConvertSettingsForm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
ShowButtons = [pbOK, pbCancel, pbHelp]
|
ShowButtons = [pbOK, pbCancel, pbHelp]
|
||||||
end
|
end
|
||||||
object TargetRadioGroup: TRadioGroup
|
|
||||||
Left = 12
|
|
||||||
Height = 80
|
|
||||||
Hint = 'Converter adds conditional compilation to support different targets'
|
|
||||||
Top = 96
|
|
||||||
Width = 507
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
|
||||||
AutoFill = True
|
|
||||||
Caption = 'Target'
|
|
||||||
ChildSizing.LeftRightSpacing = 6
|
|
||||||
ChildSizing.TopBottomSpacing = 6
|
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
|
||||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
|
||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 2
|
|
||||||
ClientHeight = 61
|
|
||||||
ClientWidth = 503
|
|
||||||
Columns = 2
|
|
||||||
ItemIndex = 0
|
|
||||||
Items.Strings = (
|
|
||||||
'Lazarus'
|
|
||||||
'Lazarus and Delphi'
|
|
||||||
'Lazarus for Windows only'
|
|
||||||
'Lazarus and Delphi with same DFM file'
|
|
||||||
)
|
|
||||||
OnClick = TargetRadioGroupClick
|
|
||||||
ParentFont = False
|
|
||||||
ParentShowHint = False
|
|
||||||
ShowHint = True
|
|
||||||
TabOrder = 3
|
|
||||||
end
|
|
||||||
object KeepFileOpenCheckBox: TCheckBox
|
object KeepFileOpenCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = BackupCheckBox
|
AnchorSideLeft.Control = BackupCheckBox
|
||||||
AnchorSideTop.Control = BackupCheckBox
|
AnchorSideTop.Control = BackupCheckBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 112
|
Left = 12
|
||||||
Height = 21
|
Height = 20
|
||||||
Hint = 'Separate form files allow different properties'
|
Hint = 'Separate form files allow different properties'
|
||||||
Top = 69
|
Top = 190
|
||||||
Width = 241
|
Width = 241
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 5
|
||||||
Caption = 'Keep converted files open in editor'
|
Caption = 'Keep converted files open in editor'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 4
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object UnitReplaceDivider: TDividerBevel
|
object UnitReplaceDivider: TDividerBevel
|
||||||
AnchorSideTop.Control = TargetRadioGroup
|
AnchorSideTop.Control = Owner
|
||||||
AnchorSideTop.Side = asrBottom
|
Left = 296
|
||||||
Left = 0
|
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 189
|
Top = 9
|
||||||
Width = 523
|
Width = 239
|
||||||
Caption = 'Unit Replacements'
|
Caption = 'Unit Replacements'
|
||||||
Anchors = [akTop, akLeft, akRight]
|
BorderSpacing.Top = 9
|
||||||
BorderSpacing.Top = 13
|
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
LeftIndent = 30
|
||||||
end
|
end
|
||||||
object UnknownPropsDivider: TDividerBevel
|
object UnknownPropsDivider: TDividerBevel
|
||||||
|
AnchorSideLeft.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Control = UnitReplaceDivider
|
AnchorSideTop.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
AnchorSideRight.Control = UnitReplaceDivider
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 296
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 256
|
Top = 65
|
||||||
Width = 523
|
Width = 239
|
||||||
Caption = 'Unknown properties'
|
Caption = 'Unknown properties'
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 50
|
BorderSpacing.Top = 39
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
LeftIndent = 30
|
||||||
end
|
end
|
||||||
object UnitReplaceButton: TBitBtn
|
object UnitReplaceButton: TBitBtn
|
||||||
|
AnchorSideLeft.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Control = UnitReplaceDivider
|
AnchorSideTop.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 12
|
Left = 297
|
||||||
Height = 30
|
Height = 25
|
||||||
Hint = 'Unit names in uses section of a source unit'
|
Hint = 'Unit names in uses section of a source unit'
|
||||||
Top = 213
|
Top = 27
|
||||||
Width = 92
|
Width = 75
|
||||||
BorderSpacing.Top = 7
|
BorderSpacing.Left = 1
|
||||||
|
BorderSpacing.Top = 1
|
||||||
Caption = 'Edit'
|
Caption = 'Edit'
|
||||||
OnClick = UnitReplaceButtonClick
|
OnClick = UnitReplaceButtonClick
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 5
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object TypeReplaceDivider: TDividerBevel
|
object TypeReplaceDivider: TDividerBevel
|
||||||
|
AnchorSideLeft.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Control = UnknownPropsDivider
|
AnchorSideTop.Control = UnknownPropsDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
AnchorSideRight.Control = UnitReplaceDivider
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 296
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 323
|
Top = 121
|
||||||
Width = 523
|
Width = 239
|
||||||
Caption = 'Type Replacements'
|
Caption = 'Type Replacements'
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 50
|
BorderSpacing.Top = 39
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
LeftIndent = 30
|
||||||
end
|
end
|
||||||
object TypeReplaceButton: TBitBtn
|
object TypeReplaceButton: TBitBtn
|
||||||
|
AnchorSideLeft.Control = TypeReplaceDivider
|
||||||
AnchorSideTop.Control = TypeReplaceDivider
|
AnchorSideTop.Control = TypeReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 12
|
Left = 297
|
||||||
Height = 30
|
Height = 25
|
||||||
Hint = 'Unknown types in form file (DFM/LFM)'
|
Hint = 'Unknown types in form file (DFM/LFM)'
|
||||||
Top = 347
|
Top = 139
|
||||||
Width = 92
|
Width = 75
|
||||||
BorderSpacing.Top = 7
|
BorderSpacing.Left = 1
|
||||||
|
BorderSpacing.Top = 1
|
||||||
Caption = 'Edit'
|
Caption = 'Edit'
|
||||||
OnClick = TypeReplaceButtonClick
|
OnClick = TypeReplaceButtonClick
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 6
|
TabOrder = 5
|
||||||
end
|
end
|
||||||
object TypeReplaceInfoLabel: TLabel
|
object TypeReplaceInfoLabel: TLabel
|
||||||
|
AnchorSideLeft.Control = TypeReplaceButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = TypeReplaceButton
|
AnchorSideTop.Control = TypeReplaceButton
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 144
|
Left = 395
|
||||||
Height = 16
|
Height = 16
|
||||||
Top = 354
|
Top = 143
|
||||||
Width = 67
|
Width = 67
|
||||||
|
BorderSpacing.Left = 23
|
||||||
Caption = 'Interactive'
|
Caption = 'Interactive'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object FuncReplaceDivider: TDividerBevel
|
object FuncReplaceDivider: TDividerBevel
|
||||||
|
AnchorSideLeft.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Control = TypeReplaceDivider
|
AnchorSideTop.Control = TypeReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
AnchorSideRight.Control = UnitReplaceDivider
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 296
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 390
|
Top = 177
|
||||||
Width = 523
|
Width = 239
|
||||||
Caption = 'Function Replacements'
|
Caption = 'Function Replacements'
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 50
|
BorderSpacing.Top = 39
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
LeftIndent = 30
|
||||||
end
|
end
|
||||||
object CoordOffsDivider: TDividerBevel
|
object CoordOffsDivider: TDividerBevel
|
||||||
|
AnchorSideLeft.Control = UnitReplaceDivider
|
||||||
AnchorSideTop.Control = FuncReplaceDivider
|
AnchorSideTop.Control = FuncReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 0
|
AnchorSideRight.Control = UnitReplaceDivider
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
|
Left = 296
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 457
|
Top = 233
|
||||||
Width = 523
|
Width = 239
|
||||||
Caption = 'Coordinate Offsets'
|
Caption = 'Coordinate Offsets'
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 50
|
BorderSpacing.Top = 39
|
||||||
Font.Style = [fsBold]
|
Font.Style = [fsBold]
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
LeftIndent = 30
|
||||||
end
|
end
|
||||||
object FuncReplaceButton: TBitBtn
|
object FuncReplaceButton: TBitBtn
|
||||||
|
AnchorSideLeft.Control = FuncReplaceDivider
|
||||||
AnchorSideTop.Control = FuncReplaceDivider
|
AnchorSideTop.Control = FuncReplaceDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 12
|
Left = 297
|
||||||
Height = 30
|
Height = 25
|
||||||
Hint = 'Some Delphi functions can be replaced with a LCL function'
|
Hint = 'Some Delphi functions can be replaced with a LCL function'
|
||||||
Top = 414
|
Top = 195
|
||||||
Width = 92
|
Width = 75
|
||||||
BorderSpacing.Top = 7
|
BorderSpacing.Left = 1
|
||||||
|
BorderSpacing.Top = 1
|
||||||
Caption = 'Edit'
|
Caption = 'Edit'
|
||||||
OnClick = FuncReplaceButtonClick
|
OnClick = FuncReplaceButtonClick
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 7
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object CoordOffsButton: TBitBtn
|
object CoordOffsButton: TBitBtn
|
||||||
|
AnchorSideLeft.Control = CoordOffsDivider
|
||||||
AnchorSideTop.Control = CoordOffsDivider
|
AnchorSideTop.Control = CoordOffsDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 12
|
Left = 297
|
||||||
Height = 30
|
Height = 25
|
||||||
Hint = 'Some Delphi functions can be replaced with a LCL function'
|
Hint = 'Some Delphi functions can be replaced with a LCL function'
|
||||||
Top = 481
|
Top = 251
|
||||||
Width = 92
|
Width = 75
|
||||||
BorderSpacing.Top = 7
|
BorderSpacing.Left = 1
|
||||||
|
BorderSpacing.Top = 1
|
||||||
Caption = 'Edit'
|
Caption = 'Edit'
|
||||||
OnClick = CoordOffsButtonClick
|
OnClick = CoordOffsButtonClick
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 8
|
TabOrder = 7
|
||||||
end
|
end
|
||||||
object UnitReplaceRadioGroup: TRadioGroup
|
object TargetGroupBox: TGroupBox
|
||||||
AnchorSideTop.Control = UnitReplaceDivider
|
AnchorSideLeft.Control = ProjectPathEdit
|
||||||
|
AnchorSideTop.Control = ProjectPathEdit
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 144
|
Left = 9
|
||||||
Height = 36
|
Height = 96
|
||||||
Top = 207
|
Hint = 'xxx'
|
||||||
Width = 340
|
Top = 60
|
||||||
AutoFill = True
|
Width = 228
|
||||||
BorderSpacing.Top = 1
|
BorderSpacing.Top = 11
|
||||||
ChildSizing.LeftRightSpacing = 6
|
Caption = 'Target'
|
||||||
ChildSizing.TopBottomSpacing = 6
|
ClientHeight = 77
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
ClientWidth = 224
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
ParentShowHint = False
|
||||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
ShowHint = True
|
||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
TabOrder = 8
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
object SupportDelphiCheckBox: TCheckBox
|
||||||
ChildSizing.ControlsPerLine = 3
|
AnchorSideLeft.Control = MultiPlatformCheckBox
|
||||||
ClientHeight = 17
|
AnchorSideTop.Control = MultiPlatformCheckBox
|
||||||
ClientWidth = 336
|
AnchorSideTop.Side = asrBottom
|
||||||
Columns = 3
|
Left = 10
|
||||||
ItemIndex = 0
|
Height = 20
|
||||||
Items.Strings = (
|
Top = 29
|
||||||
'Disabled'
|
Width = 115
|
||||||
'Interactive'
|
BorderSpacing.Top = 5
|
||||||
'Automatic'
|
Caption = 'Support Delphi'
|
||||||
)
|
OnChange = SupportDelphiCheckBoxChange
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object SameDfmCheckBox: TCheckBox
|
||||||
|
AnchorSideLeft.Control = SupportDelphiCheckBox
|
||||||
|
AnchorSideTop.Control = SupportDelphiCheckBox
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 10
|
||||||
|
Height = 20
|
||||||
|
Top = 54
|
||||||
|
Width = 194
|
||||||
|
BorderSpacing.Top = 5
|
||||||
|
Caption = 'Use the same DFM form file'
|
||||||
|
OnChange = SameDfmCheckBoxChange
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object MultiPlatformCheckBox: TCheckBox
|
||||||
|
AnchorSideTop.Control = TargetGroupBox
|
||||||
|
Left = 10
|
||||||
|
Height = 20
|
||||||
|
Top = 4
|
||||||
|
Width = 108
|
||||||
|
BorderSpacing.Top = 4
|
||||||
|
Caption = 'Multi-Platform'
|
||||||
|
ParentShowHint = False
|
||||||
|
ShowHint = True
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object UnitReplaceComboBox: TComboBox
|
||||||
|
AnchorSideLeft.Control = UnitReplaceButton
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
|
AnchorSideTop.Control = UnitReplaceButton
|
||||||
|
AnchorSideTop.Side = asrCenter
|
||||||
|
Left = 395
|
||||||
|
Height = 21
|
||||||
|
Top = 29
|
||||||
|
Width = 136
|
||||||
|
BorderSpacing.Left = 23
|
||||||
|
ItemHeight = 0
|
||||||
|
Style = csDropDownList
|
||||||
TabOrder = 9
|
TabOrder = 9
|
||||||
end
|
end
|
||||||
object UnknownPropsRadioGroup: TRadioGroup
|
object UnknownPropsComboBox: TComboBox
|
||||||
|
AnchorSideLeft.Control = UnitReplaceComboBox
|
||||||
AnchorSideTop.Control = UnknownPropsDivider
|
AnchorSideTop.Control = UnknownPropsDivider
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 144
|
Left = 395
|
||||||
Height = 36
|
Height = 21
|
||||||
Top = 274
|
Top = 84
|
||||||
Width = 340
|
Width = 136
|
||||||
AutoFill = True
|
BorderSpacing.Top = 2
|
||||||
BorderSpacing.Top = 1
|
ItemHeight = 0
|
||||||
ChildSizing.LeftRightSpacing = 6
|
Style = csDropDownList
|
||||||
ChildSizing.TopBottomSpacing = 6
|
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
|
||||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
|
||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 3
|
|
||||||
ClientHeight = 17
|
|
||||||
ClientWidth = 336
|
|
||||||
Columns = 3
|
|
||||||
ItemIndex = 0
|
|
||||||
Items.Strings = (
|
|
||||||
'Disabled'
|
|
||||||
'Interactive'
|
|
||||||
'Automatic'
|
|
||||||
)
|
|
||||||
TabOrder = 10
|
TabOrder = 10
|
||||||
end
|
end
|
||||||
object FuncReplaceRadioGroup: TRadioGroup
|
object FuncReplaceComboBox: TComboBox
|
||||||
AnchorSideTop.Control = FuncReplaceDivider
|
AnchorSideLeft.Control = FuncReplaceButton
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 144
|
AnchorSideTop.Control = FuncReplaceButton
|
||||||
Height = 36
|
AnchorSideTop.Side = asrCenter
|
||||||
Top = 408
|
Left = 395
|
||||||
Width = 340
|
Height = 21
|
||||||
AutoFill = True
|
Top = 197
|
||||||
BorderSpacing.Top = 1
|
Width = 136
|
||||||
ChildSizing.LeftRightSpacing = 6
|
BorderSpacing.Left = 23
|
||||||
ChildSizing.TopBottomSpacing = 6
|
ItemHeight = 0
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
Style = csDropDownList
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
|
||||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
|
||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 2
|
|
||||||
ClientHeight = 17
|
|
||||||
ClientWidth = 336
|
|
||||||
Columns = 2
|
|
||||||
ItemIndex = 0
|
|
||||||
Items.Strings = (
|
|
||||||
'Disabled'
|
|
||||||
'Enabled'
|
|
||||||
)
|
|
||||||
TabOrder = 11
|
TabOrder = 11
|
||||||
end
|
end
|
||||||
object CoordOffsRadioGroup: TRadioGroup
|
object CoordOffsComboBox: TComboBox
|
||||||
AnchorSideTop.Control = CoordOffsDivider
|
AnchorSideLeft.Control = CoordOffsButton
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
Left = 144
|
AnchorSideTop.Control = CoordOffsButton
|
||||||
Height = 36
|
AnchorSideTop.Side = asrCenter
|
||||||
Top = 475
|
Left = 395
|
||||||
Width = 340
|
Height = 21
|
||||||
AutoFill = True
|
Top = 253
|
||||||
BorderSpacing.Top = 1
|
Width = 136
|
||||||
ChildSizing.LeftRightSpacing = 6
|
BorderSpacing.Left = 23
|
||||||
ChildSizing.TopBottomSpacing = 6
|
ItemHeight = 0
|
||||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
Style = csDropDownList
|
||||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
|
||||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
|
||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
|
||||||
ChildSizing.ControlsPerLine = 2
|
|
||||||
ClientHeight = 17
|
|
||||||
ClientWidth = 336
|
|
||||||
Columns = 2
|
|
||||||
ItemIndex = 0
|
|
||||||
Items.Strings = (
|
|
||||||
'Disabled'
|
|
||||||
'Enabled'
|
|
||||||
)
|
|
||||||
TabOrder = 12
|
TabOrder = 12
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,7 +37,6 @@ uses
|
|||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
TConvertTarget = (ctLazarus, ctLazarusDelphi, ctLazarusWin, ctLazarusDelphiSameDfm);
|
|
||||||
TReplaceModeLong = (rlDisabled, rlInteractive, rlAutomatic);
|
TReplaceModeLong = (rlDisabled, rlInteractive, rlAutomatic);
|
||||||
TReplaceModeShort = (rsDisabled, rsEnabled);
|
TReplaceModeShort = (rsDisabled, rsEnabled);
|
||||||
|
|
||||||
@ -58,7 +57,9 @@ type
|
|||||||
// Actual user settings.
|
// Actual user settings.
|
||||||
fBackupFiles: boolean;
|
fBackupFiles: boolean;
|
||||||
fKeepFileOpen: boolean;
|
fKeepFileOpen: boolean;
|
||||||
fTarget: TConvertTarget;
|
fMultiPlatform: boolean;
|
||||||
|
fSupportDelphi: boolean;
|
||||||
|
fSameDfmFile: boolean;
|
||||||
// Modes for replacements:
|
// Modes for replacements:
|
||||||
fUnitsReplaceMode: TReplaceModeLong;
|
fUnitsReplaceMode: TReplaceModeLong;
|
||||||
fUnknownPropsMode: TReplaceModeLong;
|
fUnknownPropsMode: TReplaceModeLong;
|
||||||
@ -104,7 +105,9 @@ type
|
|||||||
|
|
||||||
property BackupFiles: boolean read fBackupFiles;
|
property BackupFiles: boolean read fBackupFiles;
|
||||||
property KeepFileOpen: boolean read fKeepFileOpen;
|
property KeepFileOpen: boolean read fKeepFileOpen;
|
||||||
property Target: TConvertTarget read fTarget;
|
property MultiPlatform: boolean read fMultiPlatform;
|
||||||
|
property SupportDelphi: boolean read fSupportDelphi;
|
||||||
|
property SameDfmFile: boolean read fSameDfmFile;
|
||||||
property UnitsReplaceMode: TReplaceModeLong read fUnitsReplaceMode;
|
property UnitsReplaceMode: TReplaceModeLong read fUnitsReplaceMode;
|
||||||
property UnknownPropsMode: TReplaceModeLong read fUnknownPropsMode;
|
property UnknownPropsMode: TReplaceModeLong read fUnknownPropsMode;
|
||||||
property FuncReplaceMode: TReplaceModeShort read fFuncReplaceMode;
|
property FuncReplaceMode: TReplaceModeShort read fFuncReplaceMode;
|
||||||
@ -119,9 +122,14 @@ type
|
|||||||
{ TConvertSettingsForm }
|
{ TConvertSettingsForm }
|
||||||
|
|
||||||
TConvertSettingsForm = class(TForm)
|
TConvertSettingsForm = class(TForm)
|
||||||
CoordOffsRadioGroup: TRadioGroup;
|
CoordOffsComboBox: TComboBox;
|
||||||
UnitReplaceRadioGroup: TRadioGroup;
|
UnitReplaceComboBox: TComboBox;
|
||||||
UnknownPropsRadioGroup: TRadioGroup;
|
MultiPlatformCheckBox: TCheckBox;
|
||||||
|
SameDfmCheckBox: TCheckBox;
|
||||||
|
SupportDelphiCheckBox: TCheckBox;
|
||||||
|
TargetGroupBox: TGroupBox;
|
||||||
|
FuncReplaceComboBox: TComboBox;
|
||||||
|
UnknownPropsComboBox: TComboBox;
|
||||||
UnknownPropsDivider: TDividerBevel;
|
UnknownPropsDivider: TDividerBevel;
|
||||||
UnitReplaceDivider: TDividerBevel;
|
UnitReplaceDivider: TDividerBevel;
|
||||||
TypeReplaceDivider: TDividerBevel;
|
TypeReplaceDivider: TDividerBevel;
|
||||||
@ -129,7 +137,6 @@ type
|
|||||||
CoordOffsDivider: TDividerBevel;
|
CoordOffsDivider: TDividerBevel;
|
||||||
FuncReplaceButton: TBitBtn;
|
FuncReplaceButton: TBitBtn;
|
||||||
KeepFileOpenCheckBox: TCheckBox;
|
KeepFileOpenCheckBox: TCheckBox;
|
||||||
TargetRadioGroup: TRadioGroup;
|
|
||||||
BackupCheckBox: TCheckBox;
|
BackupCheckBox: TCheckBox;
|
||||||
ButtonPanel1: TButtonPanel;
|
ButtonPanel1: TButtonPanel;
|
||||||
TypeReplaceButton: TBitBtn;
|
TypeReplaceButton: TBitBtn;
|
||||||
@ -137,14 +144,14 @@ type
|
|||||||
UnitReplaceButton: TBitBtn;
|
UnitReplaceButton: TBitBtn;
|
||||||
ProjectPathEdit: TLabeledEdit;
|
ProjectPathEdit: TLabeledEdit;
|
||||||
CoordOffsButton: TBitBtn;
|
CoordOffsButton: TBitBtn;
|
||||||
FuncReplaceRadioGroup: TRadioGroup;
|
procedure SameDfmCheckBoxChange(Sender: TObject);
|
||||||
|
procedure SupportDelphiCheckBoxChange(Sender: TObject);
|
||||||
procedure TypeReplaceButtonClick(Sender: TObject);
|
procedure TypeReplaceButtonClick(Sender: TObject);
|
||||||
procedure FuncReplaceButtonClick(Sender: TObject);
|
procedure FuncReplaceButtonClick(Sender: TObject);
|
||||||
procedure CoordOffsButtonClick(Sender: TObject);
|
procedure CoordOffsButtonClick(Sender: TObject);
|
||||||
procedure UnitReplaceButtonClick(Sender: TObject);
|
procedure UnitReplaceButtonClick(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
procedure TargetRadioGroupClick(Sender: TObject);
|
|
||||||
private
|
private
|
||||||
fSettings: TConvertSettings;
|
fSettings: TConvertSettings;
|
||||||
public
|
public
|
||||||
@ -356,7 +363,9 @@ begin
|
|||||||
fConfigStorage:=GetIDEConfigStorage('delphiconverter.xml', true);
|
fConfigStorage:=GetIDEConfigStorage('delphiconverter.xml', true);
|
||||||
fBackupFiles :=fConfigStorage.GetValue('BackupFiles', true);
|
fBackupFiles :=fConfigStorage.GetValue('BackupFiles', true);
|
||||||
fKeepFileOpen :=fConfigStorage.GetValue('KeepFileOpen', false);
|
fKeepFileOpen :=fConfigStorage.GetValue('KeepFileOpen', false);
|
||||||
fTarget :=TConvertTarget(fConfigStorage.GetValue('ConvertTarget', 0));
|
fMultiPlatform :=fConfigStorage.GetValue('MultiPlatform', true);
|
||||||
|
fSupportDelphi :=fConfigStorage.GetValue('SupportDelphi', false);
|
||||||
|
fSameDfmFile :=fConfigStorage.GetValue('SameDfmFile', false);
|
||||||
fUnitsReplaceMode:=TReplaceModeLong(fConfigStorage.GetValue('UnitsReplaceMode', 2));
|
fUnitsReplaceMode:=TReplaceModeLong(fConfigStorage.GetValue('UnitsReplaceMode', 2));
|
||||||
fUnknownPropsMode:=TReplaceModeLong(fConfigStorage.GetValue('UnknownPropsMode', 2));
|
fUnknownPropsMode:=TReplaceModeLong(fConfigStorage.GetValue('UnknownPropsMode', 2));
|
||||||
fFuncReplaceMode:=TReplaceModeShort(fConfigStorage.GetValue('FuncReplaceMode', 1));
|
fFuncReplaceMode:=TReplaceModeShort(fConfigStorage.GetValue('FuncReplaceMode', 1));
|
||||||
@ -480,7 +489,9 @@ begin
|
|||||||
// Save possibly modified settings to ConfigStorage.
|
// Save possibly modified settings to ConfigStorage.
|
||||||
fConfigStorage.SetDeleteValue('BackupFiles', fBackupFiles, true);
|
fConfigStorage.SetDeleteValue('BackupFiles', fBackupFiles, true);
|
||||||
fConfigStorage.SetDeleteValue('KeepFileOpen', fKeepFileOpen, false);
|
fConfigStorage.SetDeleteValue('KeepFileOpen', fKeepFileOpen, false);
|
||||||
fConfigStorage.SetDeleteValue('ConvertTarget', integer(fTarget), 0);
|
fConfigStorage.SetDeleteValue('MultiPlatform', fMultiPlatform, true);
|
||||||
|
fConfigStorage.SetDeleteValue('SupportDelphi', fSupportDelphi, false);
|
||||||
|
fConfigStorage.SetDeleteValue('SameDfmFile', fSameDfmFile, false);
|
||||||
fConfigStorage.SetDeleteValue('UnitsReplaceMode', integer(fUnitsReplaceMode), 2);
|
fConfigStorage.SetDeleteValue('UnitsReplaceMode', integer(fUnitsReplaceMode), 2);
|
||||||
fConfigStorage.SetDeleteValue('UnknownPropsMode', integer(fUnknownPropsMode), 2);
|
fConfigStorage.SetDeleteValue('UnknownPropsMode', integer(fUnknownPropsMode), 2);
|
||||||
fConfigStorage.SetDeleteValue('FuncReplaceMode', integer(fFuncReplaceMode), 1);
|
fConfigStorage.SetDeleteValue('FuncReplaceMode', integer(fFuncReplaceMode), 1);
|
||||||
@ -509,22 +520,27 @@ begin
|
|||||||
// Settings --> UI. Loaded from ConfigSettings earlier.
|
// Settings --> UI. Loaded from ConfigSettings earlier.
|
||||||
BackupCheckBox.Checked :=fBackupFiles;
|
BackupCheckBox.Checked :=fBackupFiles;
|
||||||
KeepFileOpenCheckBox.Checked :=fKeepFileOpen;
|
KeepFileOpenCheckBox.Checked :=fKeepFileOpen;
|
||||||
TargetRadioGroup.ItemIndex :=integer(fTarget);
|
MultiPlatformCheckBox.Checked :=fMultiPlatform;
|
||||||
UnitReplaceRadioGroup.ItemIndex :=integer(fUnitsReplaceMode);
|
SupportDelphiCheckBox.Checked :=fSupportDelphi;
|
||||||
UnknownPropsRadioGroup.ItemIndex:=integer(fUnknownPropsMode);
|
SameDfmCheckBox.Checked :=fSameDfmFile;
|
||||||
FuncReplaceRadioGroup.ItemIndex :=integer(fFuncReplaceMode);
|
UnitReplaceComboBox.ItemIndex :=integer(fUnitsReplaceMode);
|
||||||
CoordOffsRadioGroup.ItemIndex :=integer(fCoordOffsMode);
|
UnknownPropsComboBox.ItemIndex :=integer(fUnknownPropsMode);
|
||||||
TargetRadioGroupClick(TargetRadioGroup);
|
FuncReplaceComboBox.ItemIndex :=integer(fFuncReplaceMode);
|
||||||
|
CoordOffsComboBox.ItemIndex :=integer(fCoordOffsMode);
|
||||||
|
SupportDelphiCheckBoxChange(SupportDelphiCheckBox);
|
||||||
|
SameDfmCheckBoxChange(SameDfmCheckBox);
|
||||||
Result:=ShowModal; // Let the user change settings in a form.
|
Result:=ShowModal; // Let the user change settings in a form.
|
||||||
if Result=mrOK then begin
|
if Result=mrOK then begin
|
||||||
// UI --> Settings. Will be saved to ConfigSettings later.
|
// UI --> Settings. Will be saved to ConfigSettings later.
|
||||||
fBackupFiles :=BackupCheckBox.Checked;
|
fBackupFiles :=BackupCheckBox.Checked;
|
||||||
fKeepFileOpen :=KeepFileOpenCheckBox.Checked;
|
fKeepFileOpen :=KeepFileOpenCheckBox.Checked;
|
||||||
fTarget :=TConvertTarget(TargetRadioGroup.ItemIndex);
|
fMultiPlatform :=MultiPlatformCheckBox.Checked;
|
||||||
fUnitsReplaceMode:=TReplaceModeLong(UnitReplaceRadioGroup.ItemIndex);
|
fSupportDelphi :=SupportDelphiCheckBox.Checked;
|
||||||
fUnknownPropsMode:=TReplaceModeLong(UnknownPropsRadioGroup.ItemIndex);
|
fSameDfmFile :=SameDfmCheckBox.Checked;
|
||||||
fFuncReplaceMode :=TReplaceModeShort(FuncReplaceRadioGroup.ItemIndex);
|
fUnitsReplaceMode:=TReplaceModeLong(UnitReplaceComboBox.ItemIndex);
|
||||||
fCoordOffsMode :=TReplaceModeShort(CoordOffsRadioGroup.ItemIndex);
|
fUnknownPropsMode:=TReplaceModeLong(UnknownPropsComboBox.ItemIndex);
|
||||||
|
fFuncReplaceMode :=TReplaceModeShort(FuncReplaceComboBox.ItemIndex);
|
||||||
|
fCoordOffsMode :=TReplaceModeShort(CoordOffsComboBox.ItemIndex);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
@ -645,57 +661,51 @@ begin
|
|||||||
ProjectPathEdit.Text:='';
|
ProjectPathEdit.Text:='';
|
||||||
ProjectPathEdit.EditLabel.Caption:=lisProjectPath;
|
ProjectPathEdit.EditLabel.Caption:=lisProjectPath;
|
||||||
ProjectPathEdit.Hint:=lisProjectPathHint;
|
ProjectPathEdit.Hint:=lisProjectPathHint;
|
||||||
|
|
||||||
BackupCheckBox.Caption:=lisBackupChangedFiles;
|
BackupCheckBox.Caption:=lisBackupChangedFiles;
|
||||||
BackupCheckBox.Hint:=lisBackupHint;
|
BackupCheckBox.Hint:=lisBackupHint;
|
||||||
|
|
||||||
KeepFileOpenCheckBox.Caption:=lisKeepFileOpen;
|
KeepFileOpenCheckBox.Caption:=lisKeepFileOpen;
|
||||||
KeepFileOpenCheckBox.Hint:=lisKeepFileOpenHint;
|
KeepFileOpenCheckBox.Hint:=lisKeepFileOpenHint;
|
||||||
|
// Target
|
||||||
TargetRadioGroup.Items.Clear;
|
MultiPlatformCheckBox.Caption:=lisConvertTargetMultiPlatform;
|
||||||
TargetRadioGroup.Items.Add(lisConvertTargetLaz);
|
MultiPlatformCheckBox.Hint:=lisConvertTargetMultiPlatformHint;
|
||||||
TargetRadioGroup.Items.Add(lisConvertTargetLazAndDelphi);
|
SupportDelphiCheckBox.Caption:=lisConvertTargetSupportDelphi;
|
||||||
TargetRadioGroup.Items.Add(lisConvertTargetLazWinOnly);
|
SupportDelphiCheckBox.Hint:=lisConvertTargetSupportDelphiHint;
|
||||||
TargetRadioGroup.Items.Add(lisConvertTargetLazAndDelphiSameDfm);
|
SameDfmCheckBox.Caption:=lisConvertTargetSameDfmFile;
|
||||||
TargetRadioGroup.ItemIndex:=0;
|
SameDfmCheckBox.Hint:=lisConvertTargetSameDfmFileHint;
|
||||||
TargetRadioGroup.Hint:=lisConvertTargetHint;
|
TargetGroupBox.Hint:=lisConvertTargetHint;
|
||||||
|
// Unit Replacements
|
||||||
UnitReplaceDivider.Caption:=lisConvUnitReplacements;
|
UnitReplaceDivider.Caption:=lisConvUnitReplacements;
|
||||||
UnitReplaceButton.Caption:=lisCodeToolsDefsEdit; // Recycled string.
|
UnitReplaceButton.Caption:=lisCodeToolsDefsEdit; // Recycled string.
|
||||||
UnitReplaceDivider.Hint:=lisConvUnitReplHint;
|
UnitReplaceDivider.Hint:=lisConvUnitReplHint;
|
||||||
UnitReplaceButton.Hint:=lisConvUnitReplHint;
|
UnitReplaceButton.Hint:=lisConvUnitReplHint;
|
||||||
UnitReplaceRadioGroup.Items.Clear;
|
UnitReplaceComboBox.Items.Add(lisDisabled); // 'Disabled'
|
||||||
UnitReplaceRadioGroup.Items.Add(lisDisabled); // 'Disabled'
|
UnitReplaceComboBox.Items.Add(lisInteractive); // 'Interactive'
|
||||||
UnitReplaceRadioGroup.Items.Add(lisInteractive); // 'Interactive'
|
UnitReplaceComboBox.Items.Add(lisAutomatic); // 'Automatic'
|
||||||
UnitReplaceRadioGroup.Items.Add(lisAutomatic); // 'Automatic'
|
// Unknown Properties
|
||||||
|
|
||||||
UnknownPropsDivider.Caption:=lisConvUnknownProps;
|
UnknownPropsDivider.Caption:=lisConvUnknownProps;
|
||||||
UnknownPropsRadioGroup.Items.Clear;
|
UnknownPropsComboBox.Items.Add(lisDisabled);
|
||||||
UnknownPropsRadioGroup.Items.Add(lisDisabled);
|
UnknownPropsComboBox.Items.Add(lisInteractive);
|
||||||
UnknownPropsRadioGroup.Items.Add(lisInteractive);
|
UnknownPropsComboBox.Items.Add(lisAutomatic);
|
||||||
UnknownPropsRadioGroup.Items.Add(lisAutomatic);
|
// Type Replacements
|
||||||
|
|
||||||
TypeReplaceDivider.Caption:=lisConvTypeReplacements;
|
TypeReplaceDivider.Caption:=lisConvTypeReplacements;
|
||||||
TypeReplaceButton.Caption:=lisCodeToolsDefsEdit;
|
TypeReplaceButton.Caption:=lisCodeToolsDefsEdit;
|
||||||
TypeReplaceDivider.Hint:=lisConvTypeReplHint;
|
TypeReplaceDivider.Hint:=lisConvTypeReplHint;
|
||||||
TypeReplaceButton.Hint:=lisConvTypeReplHint;
|
TypeReplaceButton.Hint:=lisConvTypeReplHint;
|
||||||
TypeReplaceInfoLabel.Caption:=lisInteractive;
|
TypeReplaceInfoLabel.Caption:=lisInteractive;
|
||||||
|
// Func Replacements
|
||||||
FuncReplaceDivider.Caption:=lisConvFuncReplacements;
|
FuncReplaceDivider.Caption:=lisConvFuncReplacements;
|
||||||
FuncReplaceButton.Caption:=lisCodeToolsDefsEdit;
|
FuncReplaceButton.Caption:=lisCodeToolsDefsEdit;
|
||||||
FuncReplaceDivider.Hint:=lisConvFuncReplHint;
|
FuncReplaceDivider.Hint:=lisConvFuncReplHint;
|
||||||
FuncReplaceButton.Hint:=lisConvFuncReplHint;
|
FuncReplaceButton.Hint:=lisConvFuncReplHint;
|
||||||
FuncReplaceRadioGroup.Items.Clear;
|
FuncReplaceComboBox.Items.Add(lisDisabled); // 'Disabled'
|
||||||
FuncReplaceRadioGroup.Items.Add(lisDisabled); // 'Disabled'
|
FuncReplaceComboBox.Items.Add(lisEnabled); // 'Enabled'
|
||||||
FuncReplaceRadioGroup.Items.Add(lisEnabled); // 'Enabled'
|
// Coordinate Offsets
|
||||||
|
|
||||||
CoordOffsDivider.Caption:=lisConvCoordOffs;
|
CoordOffsDivider.Caption:=lisConvCoordOffs;
|
||||||
CoordOffsButton.Caption:=lisCodeToolsDefsEdit;
|
CoordOffsButton.Caption:=lisCodeToolsDefsEdit;
|
||||||
CoordOffsDivider.Hint:=lisConvCoordHint;
|
CoordOffsDivider.Hint:=lisConvCoordHint;
|
||||||
CoordOffsButton.Hint:=lisConvCoordHint;
|
CoordOffsButton.Hint:=lisConvCoordHint;
|
||||||
CoordOffsRadioGroup.Items.Clear;
|
CoordOffsComboBox.Items.Add(lisDisabled);
|
||||||
CoordOffsRadioGroup.Items.Add(lisDisabled);
|
CoordOffsComboBox.Items.Add(lisEnabled);
|
||||||
CoordOffsRadioGroup.Items.Add(lisEnabled);
|
|
||||||
|
|
||||||
ButtonPanel1.OKButton.Caption:=lisStartConversion;
|
ButtonPanel1.OKButton.Caption:=lisStartConversion;
|
||||||
ButtonPanel1.HelpButton.Caption:=lisMenuHelp;
|
ButtonPanel1.HelpButton.Caption:=lisMenuHelp;
|
||||||
@ -707,20 +717,24 @@ begin
|
|||||||
;
|
;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TConvertSettingsForm.TargetRadioGroupClick(Sender: TObject);
|
procedure TConvertSettingsForm.SupportDelphiCheckBoxChange(Sender: TObject);
|
||||||
// Delphi compatibility doesn't allow renaming the form file.
|
|
||||||
var
|
var
|
||||||
Trg: TConvertTarget;
|
Chk: boolean;
|
||||||
begin
|
begin
|
||||||
Trg:=TConvertTarget((Sender as TRadioGroup).ItemIndex);
|
Chk:=(Sender as TCheckBox).Checked;
|
||||||
// Function names are not replaced for Windows only target.
|
SameDfmCheckBox.Enabled:=Chk;
|
||||||
if Trg=ctLazarusWin then
|
if not Chk then
|
||||||
FuncReplaceRadioGroup.ItemIndex:=integer(rsDisabled);
|
SameDfmCheckBox.Checked:=Chk;
|
||||||
FuncReplaceRadioGroup.Enabled:=Trg<>ctLazarusWin;
|
end;
|
||||||
// Coordinates are not adjusted when the same DFM form file is used.
|
|
||||||
if Trg=ctLazarusDelphiSameDfm then
|
procedure TConvertSettingsForm.SameDfmCheckBoxChange(Sender: TObject);
|
||||||
CoordOffsRadioGroup.ItemIndex:=integer(rsDisabled);
|
var
|
||||||
CoordOffsRadioGroup.Enabled:=Trg<>ctLazarusDelphiSameDfm;
|
Chk: boolean;
|
||||||
|
begin
|
||||||
|
Chk:=(Sender as TCheckBox).Checked;
|
||||||
|
if Chk then
|
||||||
|
CoordOffsComboBox.ItemIndex:=integer(rsDisabled);
|
||||||
|
CoordOffsComboBox.Enabled:=not Chk;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Edit replacements in grids
|
// Edit replacements in grids
|
||||||
|
@ -225,7 +225,7 @@ begin
|
|||||||
// Omit Windows specific units from the list if target is "Windows only",
|
// Omit Windows specific units from the list if target is "Windows only",
|
||||||
// needed if work-platform is different from Windows (kind of a hack).
|
// needed if work-platform is different from Windows (kind of a hack).
|
||||||
slo:=LowerCase(NewUnitName);
|
slo:=LowerCase(NewUnitName);
|
||||||
if (Settings.Target<>ctLazarusWin) or
|
if Settings.MultiPlatform or
|
||||||
((slo<>'windows') and (slo<>'variants') and (slo<>'shellapi')) then
|
((slo<>'windows') and (slo<>'variants') and (slo<>'shellapi')) then
|
||||||
fMissingUnits.Add(s); // unit not found
|
fMissingUnits.Add(s); // unit not found
|
||||||
end;
|
end;
|
||||||
@ -563,7 +563,7 @@ begin
|
|||||||
if not CodeTool.AddUnitToSpecificUsesSection(
|
if not CodeTool.AddUnitToSpecificUsesSection(
|
||||||
fUsesSection, fUnitsToAdd[i], '', SrcCache) then exit;
|
fUsesSection, fUnitsToAdd[i], '', SrcCache) then exit;
|
||||||
end;
|
end;
|
||||||
if Settings.Target=ctLazarus then begin
|
if Settings.MultiPlatform and not Settings.SupportDelphi then begin
|
||||||
// One way conversion -> remove and rename units.
|
// One way conversion -> remove and rename units.
|
||||||
if not fMainUsedUnits.RemoveUnits then exit; // Remove
|
if not fMainUsedUnits.RemoveUnits then exit; // Remove
|
||||||
if not fImplUsedUnits.RemoveUnits then exit;
|
if not fImplUsedUnits.RemoveUnits then exit;
|
||||||
@ -571,12 +571,12 @@ begin
|
|||||||
if not CodeTool.ReplaceUsedUnits(fMainUsedUnits.fUnitsToRename, SrcCache) then exit;
|
if not CodeTool.ReplaceUsedUnits(fMainUsedUnits.fUnitsToRename, SrcCache) then exit;
|
||||||
if not CodeTool.ReplaceUsedUnits(fImplUsedUnits.fUnitsToRename, SrcCache) then exit;
|
if not CodeTool.ReplaceUsedUnits(fImplUsedUnits.fUnitsToRename, SrcCache) then exit;
|
||||||
end;
|
end;
|
||||||
if Settings.Target in [ctLazarusDelphi, ctLazarusDelphiSameDfm] then begin
|
if Settings.SupportDelphi then begin
|
||||||
// Support Delphi. Add IFDEF blocks for units.
|
// Support Delphi. Add IFDEF blocks for units.
|
||||||
if not fMainUsedUnits.AddDelphiAndLCLSections then exit;
|
if not fMainUsedUnits.AddDelphiAndLCLSections then exit;
|
||||||
if not fImplUsedUnits.AddDelphiAndLCLSections then exit;
|
if not fImplUsedUnits.AddDelphiAndLCLSections then exit;
|
||||||
end
|
end
|
||||||
else begin // [ctLazarus, ctLazarusWin] -> comment out units if needed.
|
else begin // Lazarus only -> comment out units if needed.
|
||||||
if not CodeTool.CommentUnitsInUsesSections(fMainUsedUnits.fUnitsToComment,
|
if not CodeTool.CommentUnitsInUsesSections(fMainUsedUnits.fUnitsToComment,
|
||||||
SrcCache) then exit;
|
SrcCache) then exit;
|
||||||
if not CodeTool.CommentUnitsInUsesSections(fImplUsedUnits.fUnitsToComment,
|
if not CodeTool.CommentUnitsInUsesSections(fImplUsedUnits.fUnitsToComment,
|
||||||
|
@ -477,18 +477,19 @@ resourcestring
|
|||||||
lisUnableToConvertLfmToLrsAndWriteLrsFile = 'Unable to convert lfm to lrs '
|
lisUnableToConvertLfmToLrsAndWriteLrsFile = 'Unable to convert lfm to lrs '
|
||||||
+'and write lrs file.';
|
+'and write lrs file.';
|
||||||
lisNotADelphiProject = 'Not a Delphi project';
|
lisNotADelphiProject = 'Not a Delphi project';
|
||||||
lisTheFileIsNotADelphiProjectDpr = 'The file %s%s%s is not a Delphi '
|
lisTheFileIsNotADelphiProjectDpr = 'The file %s%s%s is not a Delphi project (.dpr)';
|
||||||
+'project (.dpr)';
|
|
||||||
lisProjectPath = 'Project Path:';
|
lisProjectPath = 'Project Path:';
|
||||||
lisProjectPathHint = 'Directory where project''s main file must be';
|
lisProjectPathHint = 'Directory where project''s main file must be';
|
||||||
lisBackupChangedFiles = 'Make backup of changed files';
|
lisBackupChangedFiles = 'Make backup of changed files';
|
||||||
lisBackupHint = 'Creates a Backup directory under project directory';
|
lisBackupHint = 'Creates a Backup directory under project directory';
|
||||||
lisStartConversion = 'Start Conversion';
|
lisStartConversion = 'Start Conversion';
|
||||||
lisConvertTargetLaz = 'Lazarus';
|
|
||||||
lisConvertTargetLazWinOnly = 'Lazarus for Windows only';
|
|
||||||
lisConvertTargetLazAndDelphi = 'Lazarus and Delphi';
|
|
||||||
lisConvertTargetLazAndDelphiSameDfm = 'Lazarus and Delphi with same DFM file';
|
|
||||||
lisConvertTargetHint = 'Converter adds conditional compilation to support different targets';
|
lisConvertTargetHint = 'Converter adds conditional compilation to support different targets';
|
||||||
|
lisConvertTargetMultiPlatform = 'Multi-Platform';
|
||||||
|
lisConvertTargetMultiPlatformHint = 'Multi-Platform versus Windows-only';
|
||||||
|
lisConvertTargetSupportDelphi = 'Support Delphi';
|
||||||
|
lisConvertTargetSupportDelphiHint = 'Use conditional compilation to support Delphi';
|
||||||
|
lisConvertTargetSameDfmFile = 'Use the same DFM form file';
|
||||||
|
lisConvertTargetSameDfmFileHint = 'Same DFM file for Lazarus and Delphi instead of copying it to LFM';
|
||||||
lisKeepFileOpen = 'Keep converted files open in editor';
|
lisKeepFileOpen = 'Keep converted files open in editor';
|
||||||
lisKeepFileOpenHint = 'All project files will be open in editor after conversion';
|
lisKeepFileOpenHint = 'All project files will be open in editor after conversion';
|
||||||
lisConvUnknownProps = 'Unknown properties';
|
lisConvUnknownProps = 'Unknown properties';
|
||||||
|
Loading…
Reference in New Issue
Block a user