界面库

优化编辑器
This commit is contained in:
JianjunLiu 2023-02-06 17:21:34 +08:00
parent c7fd3cf136
commit fc0eb3e1cd
3 changed files with 64 additions and 12 deletions

View File

@ -421,14 +421,22 @@ type TTslDebuga=class(TCustomControl)
if FCmdHistoryid <= 0 then return o.text := ""; if FCmdHistoryid <= 0 then return o.text := "";
FCmdHistoryid--; FCmdHistoryid--;
txt := FCmdHistory[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 end
VK_DOWN: VK_DOWN:
begin begin
if FCmdHistoryid >= Length(FCmdHistory)then return o.text := ""; if FCmdHistoryid >= Length(FCmdHistory)then return o.text := "";
FCmdHistoryid++; FCmdHistoryid++;
txt := FCmdHistory[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 end
13: 13:
begin begin

View File

@ -222,6 +222,7 @@ type ctslctrans = class(tmemoryclass)
o._getvalue_("b")._size_,"***",o._getvalue_("c")._getvalue_("e"); o._getvalue_("b")._size_,"***",o._getvalue_("c")._getvalue_("e");
**) **)
private private
Fstrcdata;
_nomalloc; _nomalloc;
//protected //protected
//_blocks ;//分配的内存块;以地址为索引的数组,值为分配的大小; //_blocks ;//分配的内存块;以地址为索引的数组,值为分配的大小;
@ -414,6 +415,20 @@ type ctslctrans = class(tmemoryclass)
_tool.writeptr(ps,p); _tool.writeptr(ps,p);
return p; return p;
end 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(说明)旧的内存管理类,不支持**类型 %% @explan(说明)旧的内存管理类,不支持**类型 %%
@param(_ptr)(integer) 对象地址 %% @param(_ptr)(integer) 对象地址 %%
@ -444,6 +459,7 @@ type ctslctrans = class(tmemoryclass)
**} **}
return _getvalue_(index); return _getvalue_(index);
end end
function create(data,ptr,ifset); //构造 function create(data,ptr,ifset); //构造
begin begin
{** {**
@ -462,6 +478,7 @@ type ctslctrans = class(tmemoryclass)
_objsize := _objstart := _blocks := _objss := _objst := _objs := array(); _objsize := _objstart := _blocks := _objss := _objst := _objs := array();
ldata := length(data)-1; ldata := length(data)-1;
_size := data[ldata,3]+data[ldata,4]-data[0,3]; _size := data[ldata,3]+data[ldata,4]-data[0,3];
Fstrcdata := data;
if ifnumber(ptr)and ptr then if ifnumber(ptr)and ptr then
begin begin
_ptr := ptr; _ptr := ptr;
@ -472,9 +489,10 @@ type ctslctrans = class(tmemoryclass)
v1 := v[5]; //type v1 := v[5]; //type
_objst[v0]:= v1; _objst[v0]:= v1;
_objss[v0]:= v[6]; _objss[v0]:= v[6];
_objstart[v0]:= v[3]; //żŞĘźÎťÖĂ v3 := integer(v[3]);
_objstart[v0]:= v3;//v[3]; //开始位置
_objsize[v0]:= v[4]; //字节长度 _objsize[v0]:= v[4]; //字节长度
v3 := v[3];
v2 := v[2]; v2 := v[2];
//_iindex[i] := v0; //_iindex[i] := v0;
if v1="user*" then if v1="user*" then
@ -492,7 +510,7 @@ type ctslctrans = class(tmemoryclass)
end else end else
if v1="userarray" then if v1="userarray" then
begin begin
_objs[v0]:= new ctslctrans(v2,ptr,ifset); _objs[v0]:= new ctslctrans(modyv(v2,v3),ptr+v3,ifset);//+v3
end else end else
_objs[v0]:= ptr+v3; _objs[v0]:= ptr+v3;
if ifset then if ifset then
@ -514,10 +532,11 @@ type ctslctrans = class(tmemoryclass)
v1 := v[5]; v1 := v[5];
_objst[v0]:= v1; _objst[v0]:= v1;
_objss[v0]:= v[6]; _objss[v0]:= v[6];
_objstart[v0]:= v[3]; //żŞĘźÎťÖĂ v3 := integer(v[3]);
_objstart[v0]:= v3;//v[3]; //开始位置
_objsize[v0]:= v[4]; //字节长度 _objsize[v0]:= v[4]; //字节长度
v2 := v[2]; v2 := v[2];
v3 := v[3];
_objs[v0]:= _ptr+v3; _objs[v0]:= _ptr+v3;
if v1="user*" then if v1="user*" then
begin begin
@ -527,7 +546,7 @@ type ctslctrans = class(tmemoryclass)
end else end else
if v1="userarray" then if v1="userarray" then
begin begin
no := new ctslctrans(v2,_ptr,true); no := new ctslctrans(modyv(v2,v3),_ptr+v3,true);//+v3;
_objs[v0]:= no; _objs[v0]:= no;
end else end else
if v1="char*" then if v1="char*" then
@ -566,7 +585,29 @@ type ctslctrans = class(tmemoryclass)
{** {**
@explan(说明)设置对象地址 %% @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 end
function _size_(); //获得对象占用空间大小 function _size_(); //获得对象占用空间大小
begin begin
@ -2497,7 +2538,8 @@ begin
"bool":"int", "bool":"int",
"colorref":"int", "colorref":"int",
"nmhdr":"nmhdr", "nmhdr":"nmhdr",
"guid":"guid" "guid":"guid",
"cef_string_t":"cef_string_t"
); );
//类型对应初始值表 //类型对应初始值表
typecv := array( typecv := array(

View File

@ -207,6 +207,7 @@ type tapplication=class(tcomponent)
**} **}
CallMessgeFunction(Foldforminfo["minimize"],o,e); CallMessgeFunction(Foldforminfo["minimize"],o,e);
end end
//procedure cef_do_message_loop_work();external "libcef.dll" name "cef_do_message_loop_work";
function run(); function run();
begin begin
{** {**
@ -229,6 +230,7 @@ type tapplication=class(tcomponent)
begin begin
_wapi.TranslateMessage(ptr); _wapi.TranslateMessage(ptr);
_wapi.DispatchMessageA(ptr); _wapi.DispatchMessageA(ptr);
//cef_do_message_loop_work();
end end
end else end else
begin begin