分析DFM文件生成程序界面[3]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 linzhengqun 的 blog

     if (pos('end',ss[curp])>0) then  inc(curp);
  end;
end;

procedure tform1.correctts(ts: tstrings);
var cout,i:integer; temps:string;
begin
 cout:=pos('object',ts[0]);//如果是tform的子类,将其换成tform类
 if cout=1 then
 begin
   i:=pos(':',ts[0]);
   temps:=copy(ts[0],1,i);
   temps:=temps+' tform';
   ts[0]:=temps;
   exit;
 end;
 delprop(ts,'(',')');//消掉tstrings属性
 delprop(ts,'<','>');//消掉items属性
end;

function tform1.checkevent: boolean;
var tstr:string;
begin
   result:=false;
  tstr:=trim(ss[curp]);
  if (tstr[1]='o') and (tstr[2]='n') then
    result:=true;
end;

function tform1.iscontrol(com:tcomponent): boolean;
begin
   result:=false;
 if com.inheritsfrom(tcontrol) then
   result:=true;
end;

procedure tform1.testshow(ts: tstrings);
var i:integer;
begin
  for i:=0 to ts.count-1 do
    memo1.lines.add(ts.strings[i]);
end;

procedure tform1.delprop(ts: tstrings; bchar, echar: char);
var i:integer; temps:string;
begin
  i:=0;
 while (i<ts.count-1)do
 begin
   temps:=ts[i];
   if temps[length(temps)]= bchar then
     break;
   inc(i);
 end;
 while(temps[length(temps)]<>echar)and (i<ts.count-1)do
   ts.delete(i);
 if (i<ts.count-1) then
   ts.delete(i);
end;

end.
//////////////////////////////////////////////////////////////////////////////////////////////////////
程序功能并不强大,但有很多可以增强的地方,因为我去掉了其中的一些属性,这些属性在流化中不能读出来,如果那位有兴趣,可以
根据rtti来还原这些属性的值。

本文关键:分析DFM文件生成程序界面
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top