📄 frxsdaceditor.pas
字号:
{******************************************}
{ }
{ FastReport v3.0 }
{ SDAC components design editors }
{ }
// Created by: CoreLab
// E-mail: sdac@crlab.com
{ }
{******************************************}
unit frxSDACEditor;
interface
{$I frx.inc}
implementation
uses
Windows, Classes, SysUtils, Forms, Dialogs, frxSDACComponents, frxCustomDB,
frxDsgnIntf, frxRes, MSAccess, OLEDBAccess, OLEDBC, SdacVcl
{$IFDEF Delphi6}
, Variants
{$ENDIF};
type
TfrxDatabaseProperty = class(TfrxComponentProperty)
public
function GetValue: String; override;
end;
TfrxTableNameProperty = class(TfrxStringProperty)
public
function GetAttributes: TfrxPropertyAttributes; override;
procedure GetValues; override;
end;
{ TfrxDatabaseProperty }
function TfrxDatabaseProperty.GetValue: String;
var
db: TfrxSDACDatabase;
begin
db := TfrxSDACDatabase(GetOrdValue);
if db = nil then
begin
if (SDACComponents <> nil) and (SDACComponents.DefaultDatabase <> nil) then
Result := SDACComponents.DefaultDatabase.Name
else
Result := frxResources.Get('prNotAssigned');
end
else
Result := inherited GetValue;
end;
{ TfrxTableNameProperty }
function TfrxTableNameProperty.GetAttributes: TfrxPropertyAttributes;
begin
Result := [paMultiSelect, paValueList];
end;
procedure TfrxTableNameProperty.GetValues;
begin
inherited;
with TfrxSDACTable(Component).Table do
if Connection <> nil then
Connection.GetTableNames(Values);
end;
initialization
frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACTable, 'Database',
TfrxDatabaseProperty);
frxPropertyEditors.Register(TypeInfo(TfrxSDACDatabase), TfrxSDACQuery, 'Database',
TfrxDatabaseProperty);
frxPropertyEditors.Register(TypeInfo(String), TfrxSDACTable, 'TableName',
TfrxTableNameProperty);
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -