设计器

更新
This commit is contained in:
JianjunLiu 2023-08-07 17:26:05 +08:00
parent 21c0b7a250
commit 1b9d50c5a4
3 changed files with 50 additions and 42 deletions

Binary file not shown.

View File

@ -3122,6 +3122,7 @@ r := format(%% type %s=class(tdcreateform)
ci := self.classinfo(); //将成员变量赋值为nil避免循环引用
for i,v in ci["members"] do
begin
if v["const"] then continue;
if v["static"] then continue;
invoke(self,v["name"],nil);
end
@ -3151,6 +3152,7 @@ r := format(%% type %s=class(tdcreatepanel)
ci := self.classinfo();
for i,v in ci["members"] do
begin
if v["const"] then continue;
if v["static"] then continue;
invoke(self,v["name"],nil);
end

View File

@ -1132,43 +1132,15 @@ end
type trefarray = class() //数组成员引用模拟
function create(d); //构造函数
begin
if ifarray(d) or (d is class(trefarray)) then
begin
FData := d;
end else
begin
FData := array();
end
FData := d;
end
function mgset(idxs,v); //根据下标设置值
begin
if not ifarray(idxs) then return nil;
if ifarray(FData) then
begin
if ifarrayidx(idxs) then
begin
fsettemp := v;
s := "FData"+formatarrayidx(idxs)+":=fsettemp;";
r := eval(&(s));
fsettemp := nil;
return r;
end
return magicsetarray(FData, idxs,v);
end
return FData.mgset(idxs,v);
return domgset(FData,idxs,v);
end
function mgget(idxs); //根据获得值
begin
if not ifarray(idxs) then return nil;
if ifarray(FData) then
begin
if ifarrayidx(idxs) then
begin
return eval(&("FData"+formatarrayidx(idxs)));
end
return magicgetarray(FData,idxs);
end
return FData.mgget(idxs,v);
return domgget(fdata,idxs);
end
function operator[0](idx,v); //获取值
begin
@ -1188,10 +1160,46 @@ type trefarray = class() //
end
published
property data read FData write setdata;
private //³ÉÔ±±äÁ¿
FData;
fsettemp;
private
protected
function setdata(d);virtual;
begin
if FData<>d then
begin
FData := d;
return true;
end
end
function domgget(d,idxs);virtual; //根据获得值
begin
if not ifarray(idxs) then return nil;
if ifarray(d) then
begin
if ifarrayidx(idxs) then
begin
return eval(&("d"+formatarrayidx(idxs)));
end
return magicgetarray(d,idxs);
end
if d is class(trefarray) then return d.mgget(idxs,v);
end
function domgset(d,idxs,v);virtual; //根据下标设置值
begin
if not ifarray(idxs) then return nil;
if ifarray(d) then
begin
if ifarrayidx(idxs) then
begin
fsettemp := v;
s := "d"+formatarrayidx(idxs)+":=fsettemp;";
r := eval(&(s));
fsettemp := nil;
return r;
end
return magicsetarray(d, idxs,v);
end
if d is class(trefarray) then return d.mgset(idxs,v);
return nil;
end
function ifarrayidx(idx);
begin
for i,v in idx do
@ -1215,13 +1223,11 @@ type trefarray = class() //
r+="]";
return r;
end
function setdata(d);
begin
if FData<>d and ifarray(d) then
begin
FData := d;
end
end
FData; //原始数据
private //成员变量
fsettemp;
private
private //中间对象
type trefsgter = class()
function create(a,idx);