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

View File

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

View File

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