📄 qimport3reg.pas
字号:
Result := EmptyStr;
end;
function TQWizardFileNameProperty.GetFilter: string;
begin
Result := QImportLoadStr(QIF_ALL);
end;
{ TQImportAboutProperty }
procedure TQImportAboutProperty.Edit;
begin
ShowAboutForm;
end;
function TQImportAboutProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paReadOnly, paDialog];
end;
function TQImportAboutProperty.GetValue: string;
begin
Result := QI_ABOUT;
end;
{ TQImportVersionProperty }
function TQImportVersionProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paReadOnly];
end;
function TQImportVersionProperty.GetValue: string;
begin
Result := QI_VERSION;
end;
{ TQImportDBFEditor }
function TQImportDBFEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportDBFEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportDBFEditor.ExecuteVerb(Index: integer);
begin
case Index of
0: RunQImportDBFEditor(Component as TQImport3DBF);
1: if RunFormatsEditor(Component as TQImport3) then Designer.Modified;
end;
end;
{ TQImportHTMLEditor }
{$IFDEF HTML}
{$IFDEF VCL6}
function TQImportHTMLEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportHTMLEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportHTMLEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := false;
case Index of
0: RunQImportHTMLEditor(Component as TQImport3HTML);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
{$ENDIF}
{$ENDIF}
{ TQImportXMLEditor }
function TQImportXMLEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportXMLEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportXMLEditor.ExecuteVerb(Index: integer);
begin
case Index of
0: RunQImportXMLEditor(Component as TQImport3XML);
1: if RunFormatsEditor(Component as TQImport3) then Designer.Modified;
end;
end;
{ TQImportDataSetEditor }
function TQImportDataSetEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportDataSetEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportDataSetEditor.ExecuteVerb(Index: integer);
begin
case Index of
0: RunQImportDataSetEditor(Component as TQImport3DataSet);
1: if RunFormatsEditor(Component as TQImport3) then Designer.Modified;
end;
end;
{ TQImportASCIIEditor }
function TQImportASCIIEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportASCIIEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportASCIIEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := false;
case Index of
0: if Component is TQImport3ASCII then
begin
if (Component as TQImport3ASCII).Comma = #0
then NeedModify := RunQImportTXTEditor(Component as TQImport3ASCII)
else NeedModify := RunQImportCSVEditor(Component as TQImport3ASCII);
end;
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then
Designer.Modified;
end;
{ TQImportXLSEditor }
function TQImportXLSEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportXLSEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportXLSEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := false;
case Index of
0: NeedModify := RunQImportXLSEditor(Component as TQImport3XLS);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
{ TQFieldNameProperty }
function TQFieldNameProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paValueList]
end;
procedure TQFieldNameProperty.GetValues(Proc: TGetStrProc);
var
WasInActive: Boolean;
Import: TQImport3;
Wizard: TQImport3Wizard;
i: Integer;
Component: TComponent;
DataSet: TDataSet;
begin
Import := nil;
Wizard := nil;
Component := (((GetComponent(0) as TQImportFieldFormat).Collection as
TQImportFieldFormats).Holder);
if Component is TQImport3 then
Import := Component as TQImport3
else if Component is TQImport3Wizard then
Wizard := Component as TQImport3Wizard;
if Assigned(Import) then
DataSet := Import.DataSet
else if Assigned(Wizard) then
DataSet := Wizard.DataSet
else
DataSet := nil;
if not Assigned(DataSet) then Exit;
WasInActive := not Dataset.Active;
if WasInActive then
try
Dataset.Open;
except
Exit;
end;
for I := 0 to DataSet.FieldCount - 1 do
begin
Proc(DataSet.Fields[I].FieldName);
end;
if WasInActive then
try
Dataset.Close;
except
end;
end;
{ TQImportWizardEditor }
procedure TQImportWizardEditor.ExecuteVerb(Index: integer);
begin
if RunFormatsEditor(Component as TComponent{TQImport3Wizard}) then
Designer.Modified;
end;
function TQImportWizardEditor.GetVerb(Index: integer): string;
begin
Result := 'Field formats...'
end;
function TQImportWizardEditor.GetVerbCount: integer;
begin
Result := 1;
end;
{ TQImportXMLDocEditor }
{$IFDEF XMLDOC}
{$IFDEF VCL6}
function TQImportXMLDocEditor.GetVerbCount: integer;
begin
Result := 2;
end;
function TQImportXMLDocEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
procedure TQImportXMLDocEditor.ExecuteVerb(Index: integer);
begin
case Index of
0: RunQImportXMLDocEditor(Component as TQImport3XMLDoc);
1: if RunFormatsEditor(Component as TQImport3) then Designer.Modified;
end;
end;
{$ENDIF}
{$ENDIF}
{$IFDEF ADO}
function TQAccessFileNameProperty.GetDefaultExt: string;
begin
Result := 'mdb';
end;
function TQAccessFileNameProperty.GetFilter: string;
begin
Result := QImportLoadStr(QIF_Access);
end;
{ TQAccessTableNameProperty }
function TQAccessTableNameProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paValueList, paSortList];
end;
procedure TQAccessTableNameProperty.GetValues(Proc: TGetStrProc);
var
Imp: TADO_QImport3Access;
List: TStrings;
i: integer;
begin
Imp := GetComponent(0) as TADO_QImport3Access;
List := TStringList.Create;
try
Imp.GetTableNames(List);
for i := 0 to List.Count - 1 do Proc(List[i]);
finally
List.Free;
end;
end;
{$ENDIF}
{ TQXlsxFileNameProperty }
{$IFDEF XLSX}
{$IFDEF VCL6}
function TQXlsxFileNameProperty.GetDefaultExt: string;
begin
Result := 'xlsx';
end;
function TQXlsxFileNameProperty.GetFilter: string;
begin
Result := 'Microsoft Excel 2007 files (*.xlsx)|*.xlsx';
end;
{$ENDIF}
{$ENDIF}
{ TQDocxFileNameProperty }
{$IFDEF DOCX}
{$IFDEF VCL6}
function TQDocxFileNameProperty.GetDefaultExt: string;
begin
Result := 'docx';
end;
function TQDocxFileNameProperty.GetFilter: string;
begin
Result := 'Microsoft Word 2007 files (*.docx)|*.docx';
end;
{$ENDIF}
{$ENDIF}
{ TQODSFileNameProperty }
{$IFDEF ODS}
{$IFDEF VCL6}
function TQODSFileNameProperty.GetDefaultExt: string;
begin
Result := 'ods';
end;
function TQODSFileNameProperty.GetFilter: string;
begin
Result := 'Open Document Spreadsheet files (*.ods)|*.ods';
end;
{$ENDIF}
{$ENDIF}
{ TQODTFileNameProperty }
{$IFDEF ODT}
{$IFDEF VCL6}
function TQODTFileNameProperty.GetDefaultExt: string;
begin
Result := 'odt';
end;
function TQODTFileNameProperty.GetFilter: string;
begin
Result := 'Open Document Text files (*.odt)|*.odt';
end;
{$ENDIF}
{$ENDIF}
{ TQImportXlsxEditor }
{$IFDEF XLSX}
{$IFDEF VCL6}
procedure TQImportXlsxEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := False;
case Index of
0: RunQImportXlsxEditor(Component as TQImport3Xlsx);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
function TQImportXlsxEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
function TQImportXlsxEditor.GetVerbCount: integer;
begin
Result := 2;
end;
{$ENDIF}
{$ENDIF}
{ TQImportDocxEditor }
{$IFDEF DOCX}
{$IFDEF VCL6}
procedure TQImportDocxEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := False;
case Index of
0: RunQImportDocxEditor(Component as TQImport3Docx);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
function TQImportDocxEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
function TQImportDocxEditor.GetVerbCount: integer;
begin
Result := 2;
end;
{$ENDIF}
{$ENDIF}
{ TQImportODSEditor }
{$IFDEF ODS}
{$IFDEF VCL6}
procedure TQImportODSEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := False;
case Index of
0: RunQImportODSEditor(Component as TQImport3ODS);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
function TQImportODSEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
function TQImportODSEditor.GetVerbCount: integer;
begin
Result := 2;
end;
{$ENDIF}
{$ENDIF}
{ TQImportODTEditor }
{$IFDEF ODT}
{$IFDEF VCL6}
procedure TQImportODTEditor.ExecuteVerb(Index: integer);
var
NeedModify: boolean;
begin
NeedModify := False;
case Index of
0: RunQImportODTEditor(Component as TQImport3ODT);
1: NeedModify := RunFormatsEditor(Component as TQImport3);
end;
if NeedModify then Designer.Modified;
end;
function TQImportODTEditor.GetVerb(Index: integer): string;
begin
case Index of
0: Result := 'Map...';
1: Result := 'Field formats...';
end;
end;
function TQImportODTEditor.GetVerbCount: integer;
begin
Result := 2;
end;
{$ENDIF}
{$ENDIF}
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -