⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frxodaceditor.pas

📁 ODAC 6 最新版的﹐網上找了好久才找到﹐不太好找啊﹐大家一起共享
💻 PAS
字号:

{******************************************}
{                                          }
{             FastReport v3.0              }
{      ODAC components design editors       }
{                                          }

// Created by: CoreLab
// E-mail: odac@crlab.com

{                                          }
{******************************************}

unit frxODACEditor;

interface

{$I frx.inc}

implementation

uses
  Windows, Classes, SysUtils, Forms, Dialogs, frxODACComponents, frxCustomDB,
  frxDsgnIntf, frxRes, Ora
{$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: TfrxODACDatabase;
begin
  db := TfrxODACDatabase(GetOrdValue);
  if db = nil then
  begin
    if (ODACComponents <> nil) and (ODACComponents.DefaultDatabase <> nil) then
      Result := ODACComponents.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 TfrxODACTable(Component).Table do
    if Session <> nil then
      Session.GetTableNames(Values, False);
end;

initialization
  frxPropertyEditors.Register(TypeInfo(TfrxODACDatabase), TfrxODACTable, 'Database',
    TfrxDatabaseProperty);
  frxPropertyEditors.Register(TypeInfo(TfrxODACDatabase), TfrxODACQuery, 'Database',
    TfrxDatabaseProperty);
  frxPropertyEditors.Register(TypeInfo(String), TfrxODACTable, 'TableName',
    TfrxTableNameProperty);

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -