编辑器

优化调试时候编辑器 前端显示的 问题
This commit is contained in:
JianjunLiu 2023-04-24 11:54:23 +08:00
parent 2e6a766d09
commit a60b46689f
2 changed files with 42 additions and 3 deletions

View File

@ -3218,6 +3218,18 @@ type tgtkapis = class() //gtk
begin
if ifstring(p) then
begin
if fileexists("","/usr/bin/zenity") then
begin
for i := length(p) downto 1 do
begin
if p[i]="/" then
begin
tsl_gtk_execsystem(format('zenity --file-selection --filename="%s" &',p[1:i]));
break;
end
end
return ;//
end
if fileexists("","/usr/bin/caja") then
begin
for i := length(p) downto 1 do
@ -5147,7 +5159,7 @@ type tgtkapis = class() //gtk
_f_ := static function(var e:string;f:integer;ptr:pointer):pointer;cdecl;external getfuncptrbyname("libc",functionname());
return ##_f_(e,f,ptr);
end
function exec_command_line(cmd)
function exec_command_line(cmd) //执行linux命令
begin
len := 1024;
buf_ps := "";
@ -5172,6 +5184,32 @@ type tgtkapis = class() //gtk
end
return result;
end
function get_proc_comand(); //获得进程命令行
begin
tempdir := sysgetenv("HOME")+"/.tslvcl/proc/"+inttostr(datetoint(date()))+"-"+inttostr(integer(time()*24*60*60));
f := tempdir+"/1.txt";
CreateDirWithFileName(f);
dir := %% /proc/%%;
d := filelist("",dir+"*");
f2b := tempdir+"/";
r := array();
for i,v in d do
begin
n := v["FileName"];
if n="." or n=".." then continue;
f := dir+n+"/cmdline";
if not fileexists("",f) then continue;
//sz := filesize("",f);
f2 := f2b+n;
filecopy("",f,"",f2);
ri := readfile(rwraw(),"",f2,0,filesize("",f2),fd);
if ri=1 and fd then
begin
r[n] := replacetext(fd,"\0"," ");
end
end
return r;
end
end

View File

@ -271,7 +271,8 @@ type twindowsapi = class()
function ForegroundWindow(wnd_);
begin
if not (wnd_>0 or wnd_<0) then return 0;
ShowWindow(wnd_,1);
if GetForegroundWindow()=wnd_ then return 1;
ShowWindow(wnd_,8);
SetWindowPos(wnd_, 0xFFFFFFFF, 0, 0, 0, 0, 1 .| 2);
SetWindowPos(wnd_, 0xFFFFFFFE, 0, 0, 0, 0, 1 .| 2);
return 1;