From fc0eb3e1cdff02a06b77b6eb34fe78c7b215730e Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Mon, 6 Feb 2023 17:21:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化编辑器 --- designer/utslvcldebuger.tsf | 12 +++++-- funcext/tvclib/cstructurelib.tsf | 62 ++++++++++++++++++++++++++------ funcext/tvclib/tslvcl.tsf | 2 ++ 3 files changed, 64 insertions(+), 12 deletions(-) diff --git a/designer/utslvcldebuger.tsf b/designer/utslvcldebuger.tsf index 206aa79..9ec1b26 100644 --- a/designer/utslvcldebuger.tsf +++ b/designer/utslvcldebuger.tsf @@ -421,14 +421,22 @@ type TTslDebuga=class(TCustomControl) if FCmdHistoryid <= 0 then return o.text := ""; FCmdHistoryid--; txt := FCmdHistory[FCmdHistoryid]; - if ifstring(txt)and txt then o.text := txt; + if ifstring(txt)and txt then + begin + o.text := txt; + o.SetSel(length(txt),length(txt)); + end end VK_DOWN: begin if FCmdHistoryid >= Length(FCmdHistory)then return o.text := ""; FCmdHistoryid++; txt := FCmdHistory[FCmdHistoryid]; - if ifstring(txt)and txt then o.text := txt; + if ifstring(txt)and txt then + begin + o.text := txt; + o.SetSel(length(txt),length(txt)); + end end 13: begin diff --git a/funcext/tvclib/cstructurelib.tsf b/funcext/tvclib/cstructurelib.tsf index 3e02bf4..1bde53e 100644 --- a/funcext/tvclib/cstructurelib.tsf +++ b/funcext/tvclib/cstructurelib.tsf @@ -222,6 +222,7 @@ type ctslctrans = class(tmemoryclass) o._getvalue_("b")._size_,"***",o._getvalue_("c")._getvalue_("e"); **) private + Fstrcdata; _nomalloc; //protected //_blocks ;//·ÖÅäµÄÄÚ´æ¿é;ÒÔµØÖ·ÎªË÷ÒýµÄÊý×é,ֵΪ·ÖÅäµÄ´óС; @@ -414,6 +415,20 @@ type ctslctrans = class(tmemoryclass) _tool.writeptr(ps,p); return p; end + function modyv(data,b); //ÐÞÕý×Ó¶ÔÏóµÄÏà¶ÔλÖà + begin + r := data; + for i,v in data do + begin + nb := r[i][3]-b; + if v[5]="user" then + begin + r[i][2] := modyv(v[2],nb); + end + r[i][3] := nb; + end + return r; + end {** @explan(˵Ã÷)¾ÉµÄÄÚ´æ¹ÜÀíÀà,²»Ö§³Ö**ÀàÐÍ %% @param(_ptr)(integer) ¶ÔÏóµØÖ· %% @@ -444,6 +459,7 @@ type ctslctrans = class(tmemoryclass) **} return _getvalue_(index); end + function create(data,ptr,ifset); //¹¹Ôì begin {** @@ -462,6 +478,7 @@ type ctslctrans = class(tmemoryclass) _objsize := _objstart := _blocks := _objss := _objst := _objs := array(); ldata := length(data)-1; _size := data[ldata,3]+data[ldata,4]-data[0,3]; + Fstrcdata := data; if ifnumber(ptr)and ptr then begin _ptr := ptr; @@ -472,9 +489,10 @@ type ctslctrans = class(tmemoryclass) v1 := v[5]; //type _objst[v0]:= v1; _objss[v0]:= v[6]; - _objstart[v0]:= v[3]; //¿ªÊ¼Î»Öà + v3 := integer(v[3]); + _objstart[v0]:= v3;//v[3]; //¿ªÊ¼Î»Öà _objsize[v0]:= v[4]; //×Ö½Ú³¤¶È - v3 := v[3]; + v2 := v[2]; //_iindex[i] := v0; if v1="user*" then @@ -492,9 +510,9 @@ type ctslctrans = class(tmemoryclass) end else if v1="userarray" then begin - _objs[v0]:= new ctslctrans(v2,ptr,ifset); + _objs[v0]:= new ctslctrans(modyv(v2,v3),ptr+v3,ifset);//+v3 end else - _objs[v0]:= ptr+v3; + _objs[v0]:= ptr+v3; if ifset then begin if v1="char*" then @@ -505,7 +523,7 @@ type ctslctrans = class(tmemoryclass) end end end else - begin + begin _ptr := tmalloc(_size,1); //_tool.tmset(_ptr,size); for i,v in data do @@ -514,10 +532,11 @@ type ctslctrans = class(tmemoryclass) v1 := v[5]; _objst[v0]:= v1; _objss[v0]:= v[6]; - _objstart[v0]:= v[3]; //¿ªÊ¼Î»Öà + v3 := integer(v[3]); + _objstart[v0]:= v3;//v[3]; //¿ªÊ¼Î»Öà _objsize[v0]:= v[4]; //×Ö½Ú³¤¶È v2 := v[2]; - v3 := v[3]; + _objs[v0]:= _ptr+v3; if v1="user*" then begin @@ -527,7 +546,7 @@ type ctslctrans = class(tmemoryclass) end else if v1="userarray" then begin - no := new ctslctrans(v2,_ptr,true); + no := new ctslctrans(modyv(v2,v3),_ptr+v3,true);//+v3; _objs[v0]:= no; end else if v1="char*" then @@ -566,7 +585,29 @@ type ctslctrans = class(tmemoryclass) {** @explan(˵Ã÷)ÉèÖöÔÏóµØÖ· %% **} - if ifnumber(ptr)and ptr and _nomalloc then _ptr := ptr; + if ifnumber(ptr) and ptr<>_ptr and ptr and _nomalloc then + begin + _ptr := ptr; + for i,v in _objst do + begin + v3 := _objstart[i]; + if v="user*" then + begin + tptr := _tool.readptr(ptr+v3); + o := _objs[i]; + o._setcptr_(tptr); + end else + if v1="userarray" then + begin + tptr := ptr+v3; + o := _objs[i]; + o._setcptr_(tptr); + end else + begin + _objs[v0]:= ptr+v3; + end + end + end end function _size_(); //»ñµÃ¶ÔÏóÕ¼Óÿռä´óС begin @@ -2497,7 +2538,8 @@ begin "bool":"int", "colorref":"int", "nmhdr":"nmhdr", - "guid":"guid" + "guid":"guid", + "cef_string_t":"cef_string_t" ); //ÀàÐͶÔÓ¦³õʼֵ±í typecv := array( diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index e5b804b..55cf4ae 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -207,6 +207,7 @@ type tapplication=class(tcomponent) **} CallMessgeFunction(Foldforminfo["minimize"],o,e); end + //procedure cef_do_message_loop_work();external "libcef.dll" name "cef_do_message_loop_work"; function run(); begin {** @@ -229,6 +230,7 @@ type tapplication=class(tcomponent) begin _wapi.TranslateMessage(ptr); _wapi.DispatchMessageA(ptr); + //cef_do_message_loop_work(); end end else begin