diff --git a/TSLInterp.dll b/TSLInterp.dll index 784b704..72d791e 100644 Binary files a/TSLInterp.dll and b/TSLInterp.dll differ diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index a30a667..e1d1e3b 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -2797,6 +2797,11 @@ type TEditer=class(TCustomcontrol) // nn := fl[0,"FileName"]; if(POS("d",fl[0,"Attr"]))then return false; it := new TPageEditerItem(FPageEditer); + oit := GetCurrentEditer(); + if oit then + begin + it.FEditer.font := oit.font;//font; + end it.FDebuger := FTslDebug; it.FEditer.OnCaretChanged := thisfunction(EditerCaretChanged); it.FEditer.Parent := FPageEditer; diff --git a/funcext/tvclib/tcontrol.tsf b/funcext/tvclib/tcontrol.tsf index 1eff539..04584cf 100644 --- a/funcext/tvclib/tcontrol.tsf +++ b/funcext/tvclib/tcontrol.tsf @@ -361,7 +361,8 @@ type tcontrol = class(tcomponent) begin FFont.SetValues(v); end else - if v is class(tfont)then + //if v is class(tfont)then + if v is class(Tcustomfont)then begin FFont.copyfont(v); end diff --git a/funcext/tvclib/ugtkinterface.tsf b/funcext/tvclib/ugtkinterface.tsf index 0c4dc58..7f106aa 100644 --- a/funcext/tvclib/ugtkinterface.tsf +++ b/funcext/tvclib/ugtkinterface.tsf @@ -791,12 +791,13 @@ type tsgtkapi = class(tgtkapis) if fto then fto := fto[0]; if fto then //文字处理 begin - fc := fto._getvalue_("facename"); - ht := fto._getvalue_("height"); - wd := fto._getvalue_("width"); - it := fto._getvalue_("italic"); - wt := fto._getvalue_("weight")=700; - udl := fto._getvalue_("underline"); + ftod := fto._getdata_(); + fc := ftod["facename"]; + ht := ftod["height"]; + wd := ftod["width"]; + it := ftod["italic"]; + wt := ftod["weight"]=700; + udl := ftod["underline"]; fnotset := false; {fns := static pango_font_family_get_names(); for i,v in fns do @@ -2605,7 +2606,7 @@ type tsgtkapi = class(tgtkapis) begin Fscrolltimedo := makeinstance(thisfunction(docarettime)); g_gtk_caret_cache_timer:= new ttmstruct(nil); - rt := g_timeout_add(500,Fscrolltimedo,g_gtk_caret_cache_timer._getptr_() ); + rt := g_timeout_add(800,Fscrolltimedo,g_gtk_caret_cache_timer._getptr_() ); g_gtk_caret_cache_timer._setvalue_(0,rt); end h := g_object_get_data(hwnd,"gtk_window_caret"); //获得caret @@ -5170,22 +5171,22 @@ type tgtkapis = class() //gtk ptr:=popen(cmd, "r"); if((ptr)<>0) then begin - while(fgets(buf_ps, len, ptr)<>0) do + while(fgets(buf_ps, len-1, ptr)<>0) do begin - for i:= 1 to len do + for i:= 1 to len-1 do begin vi := buf_ps[i]; if vi="\0" then begin break; end - result += buf_ps[i]; - end + end + if i>1 then result += buf_ps[1:(i-1)]; end pclose(ptr); end return result; - end + end function get_proc_comand(); //获得进程命令行 begin tempdir := sysgetenv("HOME")+"/.tslvcl/proc/"+inttostr(datetoint(date()))+"-"+inttostr(integer(time()*24*60*60)); diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index b50616e..c6f8919 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -7140,7 +7140,7 @@ end function uinit(); begin {$ifdef linux} -class(tUIglobalData).uisetdata("G_T_TTIMER_",class(TCustomTimer)); +//class(tUIglobalData).uisetdata("G_T_TTIMER_",class(TCustomTimer)); {$endif} class(tUIglobalData).uisetdata("G_T_TOOLBAR_",class(tcustomtoolbar)); end diff --git a/funcext/tvclib/uwindowsinterface.tsf b/funcext/tvclib/uwindowsinterface.tsf index c807a51..c6b18cb 100644 --- a/funcext/tvclib/uwindowsinterface.tsf +++ b/funcext/tvclib/uwindowsinterface.tsf @@ -4,7 +4,7 @@ interface @explan(说明) windows平台相关接口 %% @date(20220509) %% **} -uses cstructurelib,utslvclauxiliary; +uses cstructurelib,utslvclauxiliary,utslvclmemstruct; type twindowsapi = class() private static fdefaultwinprochandle; @@ -381,6 +381,40 @@ type twindowsapi = class() function memcpy(dst:pointer;src:string;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; function memcpy2(var dst:string;src:pointer;size_t:integer):pointer;cdecl;external "msvcrt.dll" name "memcpy"; function fopen(filename:string; mode:string):pointer;cdecl;external "msvcrt.dll" name "fopen"; + function exec_command_line(cmd:string); //执行cmd 并获得打印结果 + begin + if not(cmd and ifstring(cmd)) then return ""; + r := ""; + FBufSize := 1024; + si := new T_startupinfoa(); + sa := new T_security_attributes(); + pi := new T_process_information(); + sa.bInheritHandle := TRUE; //必须为TRUE,父进程的读写句柄可以被子进程继承 + sa.nLength := sa._size_; + //创建匿名管道 + bRet := CreatePipe(hRead, hWrite, sa._getptr_, 0); + if not bRet then return r; + GetStartupInfoA(si._getptr_); + si.dwflags := 0x100; + si.hStdOutput := hWrite; + si.hStdError := hwrite; + p := CreateProcessA(nil,cmd, 0,0,true,0,0,nil,si._getptr_,pi._getptr_); + CloseHandle(hWrite); //关闭写管道 + if p then //读取 + begin + szReadBuf := ""; + setlength(szReadBuf,FBufSize); + nReadNum :=0; + while (ReadFile__(hRead, szReadBuf, FBufSize-1,nReadNum,nil )) do + begin + r+= szreadbuf[1:nreadnum]; + nReadNum := 0; + end + end + //GetExitCodeProcess(pi.hProcess,0); + CloseHandle(hRead); //关闭读管道 + return r; + end function fclose(f:pointer):integer;cdecl;external "msvcrt.dll" name "fclose"; function GetProcessId(h:pointer):integer;stdcall;external "Kernel32.dll" name "GetProcessId"; function LockFile(hFile:pointer; dwFileOffsetLow:integer; dwFileOffsetHigh:integer;nNumberOfBytesToLockLow:integer;nNumberOfBytesToLockHigh:integer):integer;stdcall;external "Kernel32.dll" name "LockFile";