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