diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index 8ebc99c..ffb1a4d 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -2729,14 +2729,14 @@ type TEditer=class(TCustomcontrol) // p := it.ScriptPath; if FileExists("",p)then begin - for i := length(p)downto 3 do + {for i := length(p)downto 3 do begin if p[i]="\\" then begin p := p[1:i]; break; end - end + end} //_wapi.WinExec('cmd.exe /C start "" "'+p,1); _wapi.openresourcemanager(p); end @@ -2975,7 +2975,7 @@ type TEditer=class(TCustomcontrol) // fl := FileList("",n); if not(length(fl)=1)then return false; nn := fl[0,"FileName"]; - if(POS("d",fl[0,"Attr"]))then return false; + if(POS("D",fl[0,"Attr"]))then return false; it := new TPageEditerItem(FPageEditer); oit := GetCurrentEditer(); if oit then diff --git a/editor-install.exe b/editor-install.exe index c00b0f9..285909e 100644 Binary files a/editor-install.exe and b/editor-install.exe differ diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index 8ee8eb2..c00a429 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -3787,18 +3787,34 @@ type tgtkapis = class(t_cairo_api) //gtk begin if ifstring(p) then begin + if fileexists("","/usr/bin/nautilus") then + begin + tsl_gtk_exec_system(format('nautilus --select "%s" &',p)); + return 1;// + end else + if fileexists("","/usr/bin/caja") then + begin + tsl_gtk_exec_system(format('caja --select "%s" &',p)); + return 1; + end else + if fileexists("","/usr/bin/xdg-open") then + begin + cmd := format(%% +target_dir="%s" +if [ -d $target_dir ]; then + xdg-open $target_dir +else + xdg-open $(dirname "$target_dir") +fi +%%,p); + tsl_gtk_exec_system(cmd); + return 1;// + end else if fileexists("","/usr/bin/zenity") then begin tsl_gtk_exec_system(format('zenity --file-selection --filename="%s" --file-selection --multiple &',p)); return 1;// - end - if fileexists("","/usr/bin/caja") then - begin - tsl_gtk_exec_system(format('caja "%s" &',p)); - return 1; - end - tsl_gtk_exec_system(format('nautilus "%s" &',p)); - return 1; + end end end function tsl_gtk_exec_system(cmd) ; diff --git a/funcext/tvclib/utslvcl_com.tsf b/funcext/tvclib/utslvcl_com.tsf index cb93969..2a108ff 100644 --- a/funcext/tvclib/utslvcl_com.tsf +++ b/funcext/tvclib/utslvcl_com.tsf @@ -1332,8 +1332,7 @@ type idispatch=class(iunkown) IID_IDispatch.readstr("{00020400-0000-0000-C000-000000000046}"); end if not ptr then - begin - + begin fvtable._setvalue_("GetTypeInfoCount",makeinstance_com(thisfunction(GetTypeInfoCount))); fvtable._setvalue_("GetTypeInfo",makeinstance_com(thisfunction(GetTypeInfo))); fvtable._setvalue_("GetIDsOfNames",makeinstance_com(thisfunction(GetIDsOfNames))); @@ -1344,8 +1343,8 @@ type idispatch=class(iunkown) end function GetTypeInfoCount(s:pointer;var pctinfo:integer):integer;stdcall;virtual; begin - return E_NOTIMPL; - echo "\r\n>>>>>>idispatch:",functionname(1); + echo "\r\n>>>>>>idispatch:",functionname(1); + return E_NOTIMPL; pctinfo := 0; ns := fcom_mgr.method_names(); if ifarray(ns) and ns then @@ -1364,7 +1363,7 @@ type idispatch=class(iunkown) end function GetTypeInfo(s:pointer;iTInfo:integer;lcid:integer;var ppTInfo:pointer):integer;stdcall;virtual; begin - //echo "\r\n>>>>>>idispatch:",functionname(1),iTInfo," ",lcid," ",ppTInfo; + echo "\r\n>>>>>>idispatch:",functionname(1),iTInfo," ",lcid," ",ppTInfo; ppTInfo := 0; return E_NOTIMPL; if not fcom_mgr.method_names() then return E_NOTIMPL; @@ -1379,7 +1378,7 @@ type idispatch=class(iunkown) end function GetIDsOfNames(s:pointer;riid:pointer;rgszNames:pointer;cNames:integer;lcid:integer;var rgDispId:integer):integer;stdcall;virtual; begin - //echo "\r\n>>>>>>idispatch:",functionname(1)," ",riid," ",lcid," ",cNames; + echo "\r\n>>>>>>idispatch:",functionname(1)," ",riid," ",lcid," ",cNames; //return E_NOTIMPL; if cnames>1 then return E_INVALIDARG; ostr := new tptrarray(rgszNames); @@ -1390,7 +1389,7 @@ type idispatch=class(iunkown) function Invoke_(s:pointer;dispIdMember:integer;riid:pointer;lcid:integer;wFlags:short;pDispParams:pointer; pVarResult:pointer;pExcepInfo:pointer;var puArgErr:integer):integer;stdcall;virtual; begin - //echo "\r\n>>>>>>idispatch:",functionname(1)," ",dispIdMember," ",wFlags," ",pVarResult," err:",pExcepInfo; + echo "\r\n>>>>>>idispatch:",functionname(1)," ",dispIdMember," ",wFlags," ",pVarResult," err:",pExcepInfo; fname := get_func_id_str(dispIdMember); if wFlags=2 then begin @@ -2101,7 +2100,9 @@ begin global g_func_handles; if not ifarray(g_func_handles) then g_func_handles := array(); idx := inttostr( int64(f)); - r := makeinstance(makeweakref(f)); + if g_func_handles[idx] then return g_func_handles[idx]; + //r := makeinstance(makeweakref(f)); + r := makeinstance(f); g_func_handles[idx] := r; return r; end diff --git a/funcext/tvclib/uwindowsinterface.tsf b/funcext/tvclib/uwindowsinterface.tsf index d9beb87..62fd2ac 100644 --- a/funcext/tvclib/uwindowsinterface.tsf +++ b/funcext/tvclib/uwindowsinterface.tsf @@ -12,7 +12,8 @@ type twindowsapi = class() function openresourcemanager(p); //打开资源管理器 begin if ifstring(p) then - return WinExec('cmd.exe /C start "" "'+p,1); + //return WinExec('cmd.exe /C start "" "'+p,1); + return WinExec(format('cmd.exe /C start explorer.exe /select, "%s"',p),1); end function getclipboardtext(clpd); begin diff --git a/tsleditor.exe b/tsleditor.exe index 676b187..57b9a78 100644 Binary files a/tsleditor.exe and b/tsleditor.exe differ diff --git a/tslvcltool.exe b/tslvcltool.exe index 4cce098..1f47dbe 100644 Binary files a/tslvcltool.exe and b/tslvcltool.exe differ