I have a solution: (I get idea from Delphi_XE2/IDE/source/Property Editors/DBReg.pas)

type
  TFieldProperty = class(TStringPropertyEditor)
  public
     function Get_DataSource_Name: string; virtual;
...........
function TFieldProperty.Get_DataSource_Name: string;
begin
    Result := 'DataSource';//Default name
end;

procedure TFieldProperty.FillValues(const Values: TStringList);
var
  DataSource: TDataSource;
begin
DataSource := GetObjectProp(GetComponent(0), *Get_DataSource_Name * ) as TDataSource;
  LoadDataSourceFields(DataSource, Values);
end;


Who wana use different datasource name, add just this codes own source(s).

  TMyFieldProperty = class(TFieldProperty)
  public
    function Get_DataSource_Name: string; override;
  end;
implementation
function TMyFieldProperty.Get_DataSource_Name: string;
begin
    Result := 'Rock_Data_Roll_Source';// :) what you want
end;
initialization
RegisterPropertyEditor(TypeInfo(string), TExLookUp, 'LookInThisField', TMyFieldProperty);

I wantto make patch for this, but I saw TFieldProperty class used other codes, so best way is lazarus team add this.
I hope lazarus team answer to my soulution accept or not.
Thank you

28-02-2014 19:13 tarihinde, Martin Frb yazdı:
I am no expert on this, so I cant give you much more help. But it looks you need to write your own property editor.



--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to