📄 asgsqlite3dsg.pas
字号:
Unit ASGSQLite3Dsg;
Interface
Uses
{$I asqlite_def.inc}
{$IFDEF ASQLITE_D6PLUS}
DesignIntf, DesignEditors,
{$ELSE}
DsgnIntf,
{$ENDIF}
FileCtrl, Classes, Controls, AMDSqlite3;
Type
TASQLiteEditor = Class(TComponentEditor)
Function GetVerbCount: integer; Override;
Function GetVerb(Index: integer): String; Override;
Procedure ExecuteVerb(Index: integer); Override;
End;
TDatabasePropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteTable }
TASQLite3DatabaseProperty = Class(TDatabasePropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TTablePropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteTableNames }
TASQLite3TableNameProperty = Class(TTablePropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TMasterDetailPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteMasterDetail fields }
TASQLite3MasterDetailProperty = Class(TMasterDetailPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TStoragePropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteStorage fields }
TASQLite3StorageProperty = Class(TStoragePropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TSyncPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteStorage fields }
TASQLite3SyncProperty = Class(TSyncPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TDirPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteStorage fields }
TASQLite3DirProperty = Class(TDirPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TDLLDirPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for DLL directory}
TASQLite3DLLDirProperty = Class(TDLLDirPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TFileTypePropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteOutputtype fields }
TASQLite3FileTypeProperty = Class(TFileTypePropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TTransactionPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteOutputtype fields }
TASQLite3TransactionProperty = Class(TTransactionPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
TCharEncPropertyEditor = Class(TPropertyEditor)
Public
Function GetAttributes: TPropertyAttributes; Override;
Function GetValue: String; Override;
Procedure GetValues(Proc: TGetStrProc); Override;
Procedure SetValue(Const Value: String); Override;
End;
{ Property editor for TASQLiteOutputtype fields }
TASQLite3CharEncProperty = Class(TCharEncPropertyEditor)
// procedure GetValueList(Values: TStringList);
End;
Procedure Register;
Implementation
Uses ASGSQLite3, SysUtils, Forms, Dialogs;
// *************************************************************************************
// ** GetVerbCount
// *************************************************************************************
Function TASQLiteEditor.GetVerbCount: integer;
Begin
Result := 0;
End;
// *************************************************************************************
// ** GetVerb
// *************************************************************************************
Function TASQLiteEditor.GetVerb(Index: integer): String;
Begin
Case Index Of
0: Result := '';
End;
End;
// *************************************************************************************
// ** ExecuteVerb
// *************************************************************************************
Procedure TASQLiteEditor.ExecuteVerb(Index: integer);
Begin
Case Index Of
0: ; //ShowAboutBox( 'Max''s WebUpdate Component' );
End;
End;
Function TDatabasePropertyEditor.GetAttributes: TPropertyAttributes;
Begin
Result := [paMultiSelect, paDialog, paValueList, paRevertable];
End;
Procedure TDatabasePropertyEditor.GetValues(Proc: TGetStrProc);
Var
sr: TSearchRec;
Begin
With GetComponent(0) As TASQLite3DB Do Begin
If DefaultExt = '' Then DefaultExt := '.sqb';
If DefaultExt[1] <> '.' Then DefaultExt := '.' + DefaultExt;
If DefaultDir <> '' Then
If DefaultDir[Length(DefaultDir)] <> '\' Then
DefaultDir := DefaultDir + '\';
If FindFirst(DefaultDir + '*' + DefaultExt, faAnyFile, sr) = 0 Then Begin
Repeat
Proc(sr.Name);
Until FindNext(sr) <> 0;
FindClose(sr);
End;
End;
Proc(':memory:');
End;
Function TDatabasePropertyEditor.GetValue: String;
Begin
Result := GetStrValue;
End;
Procedure TDatabasePropertyEditor.SetValue(Const Value: String);
Begin
SetStrValue(Value);
End;
//procedure TASQLiteTableNameProperty.GetValueList(Values: TStringList);
//begin
//end;
Function TTablePropertyEditor.GetAttributes: TPropertyAttributes;
Begin
Result := [paMultiSelect, paDialog, paValueList, paRevertable];
End;
Procedure TTablePropertyEditor.GetValues(Proc: TGetStrProc);
Var MyList: TStringList;
i: integer;
Begin
With GetComponent(0) As TASQLite3Table Do Begin
If Connection = Nil Then Begin // check to see if a valid database
Raise AsgError.Create('no database connection'); // object is linked
Exit;
End;
MyList := TStringList.Create;
Connection.GetTableNames(MyList, true);
If MyList.Count > 0 Then // marc 20040222
For i := 0 To MyList.Count - 1 Do Proc(MyList[i]);
MyList.Free;
End;
End;
Function TTablePropertyEditor.GetValue: String;
Begin
Result := GetStrValue;
End;
Procedure TTablePropertyEditor.SetValue(Const Value: String);
Begin
SetStrValue(Value);
End;
Function TMasterDetailPropertyEditor.GetAttributes: TPropertyAttributes;
Begin
Result := [paDialog, paRevertable];
End;
Procedure TMasterDetailPropertyEditor.GetValues(Proc: TGetStrProc);
Var
i, p: integer;
r: String;
oldr: String;
Begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -