1
0
mirror of synced 2024-12-22 09:03:08 +01:00

remove JEDI dependency

This commit is contained in:
Philipp Winkel 2021-03-19 17:51:09 +01:00
parent 4e5eb693cb
commit 4b677e782a
3 changed files with 53 additions and 33 deletions

View File

@ -63,15 +63,12 @@ object MainForm: TMainForm
Top = 68 Top = 68
Width = 416 Width = 416
Height = 93 Height = 93
ActivePage = spFolder ActivePage = spFile
Anchors = [akLeft, akTop, akRight] Anchors = [akLeft, akTop, akRight]
Style = tsButtons Style = tsButtons
TabOrder = 2 TabOrder = 2
object spFile: TTabSheet object spFile: TTabSheet
TabVisible = False TabVisible = False
DesignSize = (
408
83)
object lblFile: TLabel object lblFile: TLabel
Left = 4 Left = 4
Top = 7 Top = 7
@ -79,15 +76,21 @@ object MainForm: TMainForm
Height = 13 Height = 13
Caption = 'Output file:' Caption = 'Output file:'
end end
object feFile: TJvFilenameEdit object feFile: TEdit
Left = 89 Left = 65
Top = 3 Top = 4
Width = 316 Width = 269
Height = 21 Height = 21
DialogOptions = [ofHideReadOnly, ofCreatePrompt]
Anchors = [akLeft, akTop, akRight]
TabOrder = 0 TabOrder = 0
Text = '' end
object ButtonOutputFileBrowseButton: TButton
Left = 340
Top = 4
Width = 65
Height = 21
Caption = 'Browse'
TabOrder = 1
OnClick = ButtonOutputFileBrowseButtonClick
end end
end end
object spFolder: TTabSheet object spFolder: TTabSheet
@ -201,15 +204,21 @@ object MainForm: TMainForm
TabOrder = 1 TabOrder = 1
OnClick = btnHintsClick OnClick = btnHintsClick
end end
object feSchema: TJvFilenameEdit object feSchema: TEdit
Left = 104 Left = 72
Top = 8 Top = 8
Width = 316 Width = 289
Height = 21 Height = 21
OnAfterDialog = feSchemaAfterDialog
DialogOptions = [ofHideReadOnly, ofFileMustExist]
TabOrder = 4 TabOrder = 4
Text = '' end
object SchmeFileBrowseButton: TButton
Left = 367
Top = 8
Width = 65
Height = 21
Caption = 'Browse'
TabOrder = 5
OnClick = SchmeFileBrowseButtonClick
end end
object dlgSchema: TOpenDialog object dlgSchema: TOpenDialog
Filter = 'W3C XML Schema files (*.xsd)|*.xsd|All files (*.*)|*.*' Filter = 'W3C XML Schema files (*.xsd)|*.xsd|All files (*.*)|*.*'

View File

@ -51,9 +51,11 @@ type
edtFolderPrefix: TEdit; edtFolderPrefix: TEdit;
edtFolderPostfix: TEdit; edtFolderPostfix: TEdit;
deFolder: TEdit; deFolder: TEdit;
feSchema: TJvFilenameEdit;
deFolderPropertiesButton: TButton; deFolderPropertiesButton: TButton;
feFile: TJvFilenameEdit; feSchema: TEdit;
SchmeFileBrowseButton: TButton;
feFile: TEdit;
ButtonOutputFileBrowseButton: TButton;
procedure btnCloseClick(Sender: TObject); procedure btnCloseClick(Sender: TObject);
procedure btnGenerateClick(Sender: TObject); procedure btnGenerateClick(Sender: TObject);
@ -64,8 +66,8 @@ type
procedure feSchemaPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure feSchemaPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure feSchemaPropertiesChange(Sender: TObject); procedure feSchemaPropertiesChange(Sender: TObject);
procedure btnHintsClick(Sender: TObject); procedure btnHintsClick(Sender: TObject);
procedure feSchemaAfterDialog(Sender: TObject; var AName: string; procedure SchmeFileBrowseButtonClick(Sender: TObject);
var AAction: Boolean); procedure ButtonOutputFileBrowseButtonClick(Sender: TObject);
private private
function CheckValidSchemaFile: Boolean; function CheckValidSchemaFile: Boolean;
function CheckReadOnly(const AFileName: String): Boolean; function CheckReadOnly(const AFileName: String): Boolean;
@ -176,11 +178,11 @@ begin
if rbFile.Checked then if rbFile.Checked then
begin begin
if not CheckReadOnly(feFile.FileName) then if not CheckReadOnly(feFile.Text) then
Exit; Exit;
generator.OutputType := otSingle; generator.OutputType := otSingle;
generator.OutputPath := feFile.FileName; generator.OutputPath := feFile.Text;
end else if rbFolder.Checked then end else if rbFolder.Checked then
begin begin
generator.OutputType := otMultiple; generator.OutputType := otMultiple;
@ -190,9 +192,9 @@ begin
generator.HasChecksEmpty := cbHasChecksEmpty.Checked; generator.HasChecksEmpty := cbHasChecksEmpty.Checked;
generator.HasGenerateGetOptionalOrDefault := cbGenerateGetOptionalOrDefault.Checked; generator.HasGenerateGetOptionalOrDefault := cbGenerateGetOptionalOrDefault.Checked;
generator.OnGetFileName := GetFileName; generator.OnGetFileName := GetFileName;
generator.Execute(feSchema.Filename); generator.Execute(feSchema.Text);
SaveSettings(feSchema.FileName); SaveSettings(feSchema.Text);
ShowMessage('The data binding has been generated.'); ShowMessage('The data binding has been generated.');
finally finally
@ -235,12 +237,6 @@ begin
end; end;
procedure TMainForm.feSchemaAfterDialog(Sender: TObject; var AName: string;
var AAction: Boolean);
begin
feFile.FileName := ChangeFileExt(AName, '.pas');
end;
procedure TMainForm.feSchemaPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); procedure TMainForm.feSchemaPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
begin begin
if dlgSchema.Execute then if dlgSchema.Execute then
@ -337,9 +333,17 @@ begin
end; end;
procedure TMainForm.SchmeFileBrowseButtonClick(Sender: TObject);
begin
if dlgSchema.Execute then
begin
feSchema.Text := dlgSchema.FileName;
end;
end;
function TMainForm.CheckValidSchemaFile: Boolean; function TMainForm.CheckValidSchemaFile: Boolean;
begin begin
Result := FileExists(feSchema.FileName); Result := FileExists(feSchema.Text);
if not Result then if not Result then
begin begin
@ -392,6 +396,14 @@ begin
end; end;
procedure TMainForm.ButtonOutputFileBrowseButtonClick(Sender: TObject);
begin
if dlgOutputFile.Execute then
begin
feFile.Text := dlgOutputFile.FileName;
end;
end;
{ THintsDelphiXMLDataBindingGenerator } { THintsDelphiXMLDataBindingGenerator }
procedure THintsDelphiXMLDataBindingGenerator.GenerateDataBinding; procedure THintsDelphiXMLDataBindingGenerator.GenerateDataBinding;
begin begin

View File

@ -15,7 +15,6 @@
- Influence the generator by using a Hints file - Influence the generator by using a Hints file
## Dependencies ## Dependencies
- JEDI Component Library (jcl /jvcl)
- x2utils (https://github.com/MvRens/x2utils.git) (git submodule) - x2utils (https://github.com/MvRens/x2utils.git) (git submodule)
- x2log (https://github.com/MvRens/x2log.git) (git submodule) - x2log (https://github.com/MvRens/x2log.git) (git submodule)