界面库

优化调试
This commit is contained in:
JianjunLiu 2022-11-10 11:19:47 +08:00
parent 73102c6d46
commit 6d2e542ed7
4 changed files with 107 additions and 95 deletions

View File

@ -1047,7 +1047,7 @@ type TVclDesigner = class(tvcform)
it.Imgs := fdimagelist.GetImageId("tdcreateform"); it.Imgs := fdimagelist.GetImageId("tdcreateform");
end end
comp := it.ComponentCreater(node,wr); comp := it.ComponentCreater(node,wr);
//if first then comp.Cwnd.visible := false; if first then comp.Cwnd.Handle;
comp.isinherited := d["inherited"]; comp.isinherited := d["inherited"];
comp.inheritedparent := d["parent"]; comp.inheritedparent := d["parent"];
comp.name := d["name"]; comp.name := d["name"];
@ -1089,10 +1089,6 @@ type TVclDesigner = class(tvcform)
lazy[length(lazy)] := array(n,setddpv,pp); lazy[length(lazy)] := array(n,setddpv,pp);
continue; continue;
end end
if first and n="visible" then
begin
firstvisible := array(comp,setddpv,pp);
end else
comp.SetComponentProperties(n,setddpv,pp); comp.SetComponentProperties(n,setddpv,pp);
end end
for i,v in d["object"] do for i,v in d["object"] do
@ -1103,14 +1099,6 @@ type TVclDesigner = class(tvcform)
begin begin
comp.SetComponentProperties(v[0],v[1],v[2]); comp.SetComponentProperties(v[0],v[1],v[2]);
end end
if firstvisible then
begin
comp.SetComponentProperties("visible",firstvisible[1],firstvisible[2]);
end
if first then
begin
comp.Cwnd.Handle;
end
BindCwndMessage(comp.Cwnd); BindCwndMessage(comp.Cwnd);
//comp.DoControlAlign(); //comp.DoControlAlign();
end end

View File

@ -90,6 +90,28 @@ type TDComponent = class()
begin begin
return feventnametable[FDefaultEvent]; return feventnametable[FDefaultEvent];
end end
function OpenClass(o,e);
begin
cp:=o.Component;
if not cp then exit;
nd := cp.TreeNode;
if nd then d := nd.owner.Designer;
if d then
begin
d.openclassfile();
end
end
function opentfm(o,e);
begin
cp:=o.Component;
if not cp then exit;
nd := cp.TreeNode;
if nd then d := nd.owner.Designer;
if d then
begin
d.opentfm();
end
end
public public
function libs();virtual; function libs();virtual;
begin begin
@ -366,6 +388,8 @@ type TDComponent = class()
function menus();virtual; //菜单项 function menus();virtual; //菜单项
begin begin
r := array( r := array(
("type":"menu","caption":"打开tsf文件","onclick":thisfunction(OpenClass)),
("type":"menu","caption":"打开tfm文件","onclick":thisfunction(opentfm)),
("type":"menu","caption":"删除","id":"delete","onclick":thisfunction(deleteclick)), ("type":"menu","caption":"删除","id":"delete","onclick":thisfunction(deleteclick)),
("type":"menu","caption":"复制","id":"copy","onclick":thisfunction(copyclick)), ("type":"menu","caption":"复制","id":"copy","onclick":thisfunction(copyclick)),
("type":"menu","caption":"剪切","id":"cut","onclick":thisfunction(cutclick)), ("type":"menu","caption":"剪切","id":"cut","onclick":thisfunction(cutclick)),
@ -886,39 +910,17 @@ type TDForm = class(TDComponent)
d.saveCurrentForm(); d.saveCurrentForm();
end end
end end
function OpenClass(o,e);
begin
cp:=o.Component;
if not cp then exit;
nd := cp.TreeNode;
if nd then d := nd.owner.Designer;
if d then
begin
d.openclassfile();
end
end
function opentfm(o,e);
begin
cp:=o.Component;
if not cp then exit;
nd := cp.TreeNode;
if nd then d := nd.owner.Designer;
if d then
begin
d.opentfm();
end
end
public public
function menus();override; function menus();override;
begin begin
r := array(); r := array();
//r[0] := array("type":"menu","caption":"保存窗口"); r := inherited;
idx := 0; r := select * from r where ["caption"] in array("打开tfm文件","打开tsf文件","粘贴") end;
r[idx++] := array("type":"menu","caption":"打开tsf文件","onclick":thisfunction(OpenClass)); idx := length(r);
r[idx++] := array("type":"menu","caption":"打开tfm文件","onclick":thisfunction(opentfm)); //r[idx++] := array("type":"menu","caption":"打开tsf文件","onclick":thisfunction(OpenClass));
r[idx++] := array("type":"menu","caption":"关闭窗口","onclick":thisfunction(closecurrentform)); r[idx++] := array("type":"menu","caption":"关闭窗口","onclick":thisfunction(closecurrentform));
r[idx++] := array("type":"menu","caption":"保存窗口","onclick":thisfunction(savecurrentform)); r[idx++] := array("type":"menu","caption":"保存窗口","onclick":thisfunction(savecurrentform));
r[idx++] := array("type":"menu","caption":"粘贴","onclick":thisfunction(pasteclick));
//r[2] := array("type":"menu","caption":"打开工程目录","onclick":thisfunction(openProjectDir)); //r[2] := array("type":"menu","caption":"打开工程目录","onclick":thisfunction(openProjectDir));
return r; return r;
end end
@ -3406,7 +3408,7 @@ type TDPairSplitterSide = class(TDComponent)
function menus();override; function menus();override;
begin begin
r := inherited; r := inherited;
return select * from r where ["caption"] in array("删除","粘贴","剪切") end ; return select * from r where ["caption"] in array("删除","粘贴","剪切","打开tsf文件","打开tfm文件") end ;
end end
function InToolBar();override; function InToolBar();override;
begin begin

View File

@ -271,6 +271,8 @@ type TTslDebuga=class(TCustomControl)
FDebugtsfs; //当前工程对应的tsf文件 FDebugtsfs; //当前工程对应的tsf文件
FBtns; FBtns;
FAttchedid; FAttchedid;
fremotedbugstart;
fscriptbrks;//¼Ç¼½Å±¾µÄ¶Ïµã
FDebugtype; FDebugtype;
fdbgselwnd; fdbgselwnd;
FRemoteWait; //远程调试等待 FRemoteWait; //远程调试等待
@ -603,6 +605,8 @@ type TTslDebuga=class(TCustomControl)
getdebuger(pms); getdebuger(pms);
exestr := format('"%s" "%s" -DEBUGSERVER -DEBUGLOGIN 0 -WAITATTACH -DEBUGPORT %d -libpath "%s" ',FDebugExe,FRuningfile,FDebugport,dirs); exestr := format('"%s" "%s" -DEBUGSERVER -DEBUGLOGIN 0 -WAITATTACH -DEBUGPORT %d -libpath "%s" ',FDebugExe,FRuningfile,FDebugport,dirs);
exestr += pms; exestr += pms;
fremotedbugstart := true;
fscriptbrks := array();
{$ifdef linux} {$ifdef linux}
// //
sp := ioFileseparator(); sp := ioFileseparator();
@ -890,10 +894,18 @@ type TTslDebuga=class(TCustomControl)
"DebugInfo": //调试信息 "DebugInfo": //调试信息
begin begin
if "dbgdetach"=remotewaitinit(d)then return; if "dbgdetach"=remotewaitinit(d)then return;
toolbtnState("ÔÝÍ£");
stk := magicgetarray(d,array("result","CmdData","CallStack")); //深度 stk := magicgetarray(d,array("result","CmdData","CallStack")); //深度
if fremotedbugstart then
begin
fremotedbugstart := false;
if ifnil(fscriptbrks[stk[0,"LINE"]-1]) then
begin
return debugrunredo();
end
end
sybs := magicgetarray(d,array("result","CmdData","SymbolInfo")); //符号 sybs := magicgetarray(d,array("result","CmdData","SymbolInfo")); //符号
ssybs := magicgetarray(d,array("result","CmdData","EnvInfo")); //系统参数 ssybs := magicgetarray(d,array("result","CmdData","EnvInfo")); //系统参数
toolbtnState("ÔÝÍ£");
{if (ssybs = Fdbgssybs) and (sybs = Fdbgsybs) and (stk=Fdbgstack) then //值没变 {if (ssybs = Fdbgssybs) and (sybs = Fdbgsybs) and (stk=Fdbgstack) then //值没变
begin begin
return ; return ;
@ -1582,7 +1594,11 @@ type TTslDebuga=class(TCustomControl)
lines := FRuningItem.FEditer.Lines; lines := FRuningItem.FEditer.Lines;
for idx := 0 to Lines.Length()-1 do for idx := 0 to Lines.Length()-1 do
begin begin
if Lines[idx].FMarked then addbreak(FRuningItem,idx,"__main__"); if Lines[idx].FMarked then
begin
addbreak(FRuningItem,idx,"__main__");
fscriptbrks[idx]:= true;
end
end end
end end
end end

View File

@ -142,7 +142,7 @@ type TTmfParserToken = class(TTmfParserbase)
ct := ""; ct := "";
end else end else
begin begin
if not(ct) then return ; if ct="" then return ;
if n=TT_NUM then if n=TT_NUM then
begin begin
if pos(".",ct)then ct := strtofloat(ct); if pos(".",ct)then ct := strtofloat(ct);
@ -152,18 +152,6 @@ type TTmfParserToken = class(TTmfParserbase)
r[len++]:= array(ct,n); r[len++]:= array(ct,n);
ct := ""; ct := "";
end end
return ;
if ct or(n=TT_STR)then
begin
if n=TT_NUM then
begin
if pos(".",ct)then ct := strtofloat(ct);
else ct := strtoint(ct);
end
if n=TT_SYM then ct := lowercase(ct);
r[len++]:= array(ct,n);
ct := "";
end
end end
function GetNumber(len);//½âÎöÊý×Ö function GetNumber(len);//½âÎöÊý×Ö
begin begin
@ -263,14 +251,28 @@ type TTmfParserToken = class(TTmfParserbase)
r := array(); r := array();
len := 0; len := 0;
ct := ""; //µ±Ç°×Ö·û ct := ""; //µ±Ç°×Ö·û
pnumber := true;
kb := array(" ":1,"\t":1,"\r":1,"\n":1); kb := array(" ":1,"\t":1,"\r":1,"\n":1);
fgf := array(' ':1,'\t':1,"\r":1,"\n":1,";":1,",":1); fgf := array(' ':1,'\t':1,"\r":1,"\n":1,";":1,",":1);
sns := array("=":1,":":1,"(":1,")":1,"<":1,">":1,"[":1,"]":1); sns := array("=":1,":":1,"(":1,")":1,"<":1,">":1,"[":1,"]":1);
while whileok() do while whileok() do
begin begin
c := cchar(); c := cchar();
if c="0" and pnumber and(not ct)then if fgf[c] then // in array(' ','\t',"\r","\n",";",",")
begin
if ct="0" then delct(r,ct,len,TT_NUM);
else delct(r,ct,len,TT_SYM);
end else
if sns[c]then
begin
delct(r,ct,len,TT_SYM);
delct(r,c,len,TT_SIG);
end else
if c='"' or c="'" then
begin
delct(r,ct,len,TT_SYM);
delct(r,Pstring(c),len,TT_STR);
end else
if c="0" and (not ct)then
begin begin
tv := PHexNumber(); tv := PHexNumber();
if tv="d" then if tv="d" then
@ -279,19 +281,14 @@ type TTmfParserToken = class(TTmfParserbase)
end else end else
delct(r,tv,len,TT_HEX); delct(r,tv,len,TT_HEX);
end else end else
if c='"' or c="'" then if(FNumbers[c]) and(not(ct))then
begin begin
delct(r,ct,len,TT_SYM); //delct(r,ct,len,TT_SYM);
delct(r,Pstring(c),len,TT_STR); v := c+Pnumber();
end else delct(r,v,len,TT_NUM);
if fgf[c] then // in array(' ','\t',"\r","\n",";",",")
begin
if ct="0" and pnumber then delct(r,ct,len,TT_NUM);
else delct(r,ct,len,TT_SYM);
end else end else
if c="{" then if c="{" then
begin begin
//pnumber := false;
delct(r,ct,len,TT_SYM); delct(r,ct,len,TT_SYM);
delct(r,c,len,TT_SIG); delct(r,c,len,TT_SIG);
ct:=""; ct:="";
@ -310,33 +307,11 @@ type TTmfParserToken = class(TTmfParserbase)
end end
end end
end else end else
// if c="}" then
// begin
// delct(r,ct,len,TT_SYM);
// delct(r,c,len,TT_SIG);
// pnumber := true;
// end else
if sns[c]then
begin
delct(r,ct,len,TT_SYM);
delct(r,c,len,TT_SIG);
end else
{if c ="." then
begin
delct(r,ct,len,TT_SYM);
delct(r,c,len,TT_POI);
end else }
if c="-" then if c="-" then
begin begin
delct(r,ct,len,TT_SYM); delct(r,ct,len,TT_SYM);
delct(r,c+Pnumber(),len,TT_NUM); delct(r,c+Pnumber(),len,TT_NUM);
end else end else
if(FNumbers[c])and pnumber and(not(ct)) {(not(ct)) and (r[len][0]="=")}then
begin
delct(r,ct,len,TT_SYM);
v := c+Pnumber();
delct(r,v,len,TT_NUM);
end else
begin begin
ct += c; ct += c;
end end
@ -380,6 +355,34 @@ type TTmfParserToken = class(TTmfParserbase)
c := lowercase(c); c := lowercase(c);
//its := inttostr(0 -> 9)union array("a","b","c","d","e","f"); //its := inttostr(0 -> 9)union array("a","b","c","d","e","f");
r := ""; r := "";
case c of
"x":
begin
while whileok() do
begin
c := cchar();
if not(FHexnumbers[c])then
begin
cback();
break;
end
r += c;
end
if r then return eval(&("0x"+r));
return 0;
end
"l":
begin
return 0;
end
else
begin
cback();
return "d";
end
end;
if c="x" then if c="x" then
begin begin
while whileok() do while whileok() do
@ -483,11 +486,14 @@ type TTmfParser = class(TTmfParserbase)
if (fs <> s) and ifstring(s) then if (fs <> s) and ifstring(s) then
begin begin
FParsers.Script := s; FParsers.Script := s;
//setprofiler(1+2+4+8);
FTokens := FParsers.gettokens(); FTokens := FParsers.gettokens();
FTokenlen := length(FTokens); FTokenlen := length(FTokens);
FCurrent := 0; FCurrent := 0;
FTree := nil; FTree := nil;
ftreeobj := nil; ftreeobj := nil;
//d := getprofilerinfo();
//exportfile(ftstream(),"","d:\\tst\\abc.stm",d);
end end
end end
public public