[Lazarus] Is this bug ? or how to do?
FreeMan
freeman35 at delphiturkiye.com
Sat Mar 1 11:52:52 CET 2014
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.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140301/6965cd81/attachment-0002.html>
More information about the Lazarus
mailing list