设计器

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

View File

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