编辑器

优化调试工具栏
This commit is contained in:
JianjunLiu 2022-09-19 11:13:33 +08:00
parent 54ef7e59f1
commit ab4811d834
1 changed files with 34 additions and 23 deletions

View File

@ -435,7 +435,12 @@ type TTslDebuga=class(TCustomControl)
begin begin
v.onClick := thisfunction(Dbgtooldo); v.onClick := thisfunction(Dbgtooldo);
if v.Caption="添加/删除断点F5" then continue; if v.Caption="添加/删除断点F5" then continue;
if v.Caption="继续" then continue; if v.Caption="继续" then
begin
v.onClick := thisfunction(dbgtooldorun);
v.Caption := "运行";
continue;
end
v.Visible := false; v.Visible := false;
end end
end end
@ -560,12 +565,15 @@ type TTslDebuga=class(TCustomControl)
end end
function debugrunredo(); function debugrunredo();
begin begin
return dbgtooldorun(nil,nil);
if FBtns["终止"].Visible then if FBtns["终止"].Visible then
begin begin
Dbgtooldo(new ttempclass("继续"),nil); //Dbgtooldo(new ttempclass("继续"),nil);
dbgtooldorun(nil,nil);
end else end else
begin begin
Dbgtooldo(new ttempclass("暂停"),nil); //echo "\r\n 执行run";
//Dbgtooldo(new ttempclass("暂停"),nil);
end end
end end
function Debuglocal(item); //调试脚本 function Debuglocal(item); //调试脚本
@ -748,6 +756,26 @@ type TTslDebuga=class(TCustomControl)
end end
return 0; return 0;
end end
function dbgtooldorun(o,e);
begin
if not(FConnectchannel or FRemoteWait) then
begin
return CallMessgeFunction(frunbtncall,nil,nil);
end
//if not( FBtns["终止"].Visible) then return ;
toolbtnState("继续");
if FCurrentgotoitem and FCurrentgotoitem.FEditer then FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil);
ExecuteCommand("dbgrun");
{$ifdef linux}
{$else}
if not Fdebugedwhandle then
Fdebugedwhandle := GetWindowHandleByPID(_wapi.GetProcessId(FDebughandle),_wapi);
if Fdebugedwhandle then
begin
_wapi.SetForegroundWindow(Fdebugedwhandle);
end
{$endif}
end
function Dbgtooldo(o,e) function Dbgtooldo(o,e)
begin begin
cp := o.Caption; cp := o.Caption;
@ -792,24 +820,7 @@ type TTslDebuga=class(TCustomControl)
end end
"继续": "继续":
begin begin
if not(FConnectchannel or FRemoteWait) then dbgtooldorun(o,e);
begin
//return MessageboxA("正在调试中","提示",0,self.Handle);
return CallMessgeFunction(frunbtncall,nil,nil);
end
toolbtnState("继续");
if FCurrentgotoitem and FCurrentgotoitem.FEditer then FCurrentgotoitem.FEditer.ExecuteCommand("ecruningto",nil);
ExecuteCommand("dbgrun");
{$ifdef linux}
{$else}
if not Fdebugedwhandle then
Fdebugedwhandle := GetWindowHandleByPID(_wapi.GetProcessId(FDebughandle),_wapi);
if Fdebugedwhandle then
begin
_wapi.SetForegroundWindow(Fdebugedwhandle);
end
{$endif}
end end
"终止": "终止":
begin begin
@ -1498,8 +1509,8 @@ type TTslDebuga=class(TCustomControl)
begin begin
for i,v in FBtns do for i,v in FBtns do
begin begin
if v.Caption="添加/删除断点F5" then continue; if i="添加/删除断点F5" then continue;
if v.Caption="继续" then continue; if i="继续" then continue;
v.Visible := false; v.Visible := false;
end end
//FToolbar.Visible := false; //FToolbar.Visible := false;