更新编辑器

This commit is contained in:
2025-01-26 11:54:31 +08:00
parent 9a87a6286b
commit 314869d09c
19 changed files with 647 additions and 608 deletions
+3 -1
View File
@@ -39,8 +39,10 @@ type t_children_sizer = class()
dh := (bds[3]-bds[1])-(cls[3]-cls[1]);
bds[2] := bds[0]+w+dw;
bds[3] := bds[1]+h+dh;
fowner.BoundsRect := bds;
fowner.BoundsRect := bds;
end
p := fowner.parent;
if p and p.autosize then p.AdjustSize();//处理传到
fautosizing := false;
end
function getsizerinfo();
+4 -4
View File
@@ -1016,8 +1016,8 @@ type tcontrol = class(tcomponent)
if (o is class(TWinControl)) and o.WsPopUp then return ;
if (Align=alNone) then
begin
p := Parent ;
if p and p.childsizing.layout>0 then return p.AdjustSize();
//p := Parent ;
//if p and p.childsizing.layout>0 then return p.AdjustSize();
AdjustSize();
end
end
@@ -1029,8 +1029,8 @@ type tcontrol = class(tcomponent)
if not NoRecycled() then return ;
CallMessgeFunction(OnSize,o,e);
DoWMSIZE(o,e);
p := Parent ;
if p and p.childsizing.layout>0 then return p.AdjustSize();
//p := Parent ;
//if p and p.childsizing.layout>0 then return p.AdjustSize();
AdjustSize();
end
function CMCursorChanged(o,e):CM_CURSORCHANGED;virtual;
+4 -4
View File
@@ -2597,7 +2597,7 @@ type TWinControl = class(tcontrol)
begin
return ;
end
cs := childsizing;
cs := fchildsizing;
if cs and cs.layout>0 then return cs.AdjustSize();
if autosize then
begin
@@ -2682,8 +2682,8 @@ type TWinControl = class(tcontrol)
@explan(说明) 控件对齐 %%
**}
if not HandleAllocated()then exit;
cs := childsizing;
if cs and cs.layout>0 then return ;
cs := fchildsizing;
if cs and cs.layout>0 then return;
if not ifarray(rect)then
begin
rect := ClientRect;
@@ -2710,7 +2710,7 @@ type TWinControl = class(tcontrol)
@explan(说明) 控件锚定调整 %%
**}
if not HandleAllocated()then exit;
cs := childsizing;
cs := fchildsizing;
if cs and cs.layout>0 then return ;
e := new TMANCHOR(CN_ANCHOR,0,0,0);
c := ClientRect;
+13 -6
View File
@@ -4179,8 +4179,10 @@ type TcustomListBox=class(TCustomListBoxbase)
begin
if h>0 and h<>FListitemheigt then
begin
dy := GetYScrollDelta();
FListitemheigt := integer(h);
if FOwnerDraw then
dy2 := GetYScrollDelta();
if dy<>dy2 then
begin
doControlALign();
InvalidateRect(nil,false);
@@ -4194,7 +4196,7 @@ type TcustomListBox=class(TCustomListBoxbase)
fselbkcolor := v;
end
end
function SetItemCount(n);
function SetItemCount(n); //自绘制才能设置项目
begin
if fownerdraw and (n>=0) and ItemCount<>n then
begin
@@ -4208,10 +4210,15 @@ type TcustomListBox=class(TCustomListBoxbase)
if FOwnerDraw<>nv then
begin
FOwnerDraw := nv;
if not(FListitemheigt>0) then
begin
FListitemheigt := font.Height+4;
end
dy := GetYScrollDelta();
ft := Font;
if ft then FListitemheigt := font.Height+4;
dy2 := GetYScrollDelta();
if dy1<>dy2 then //改变
begin
doControlALign();
InvalidateRect(nil,false);
end
end
end
function PaintIdxBkg(idx,rc,cvs);
+20 -2
View File
@@ -2932,7 +2932,16 @@ type tg_text = class(tg_base)
if (visible<>tgc_on) then return ;
if not fdata then return ;
if not zoom_to_xyz(fdata[0],fdata[1],fdata[2],x,y) then return ;
if clip_state=tgc_on then cvs.axesclip();
if clip_state=tgc_on then
begin
bx := axes.zoom_box;
vj := fdata;
if vj[0]<bx[0,0] or vj[1]<bx[1,0] or vj[2]<bx[2,0] or vj[0]>bx[0,1] or vj[1]>bx[1,1] or vj[2]>bx[2,1] then
begin
return ;
end
cvs.axesclip();
end
else cvs.axesunclip();
get_text_size(w,h,hi);
set_lineinfo_to_canvas(cvs);
@@ -3222,7 +3231,16 @@ type tg_tips = class(tg_base) //
ss := get_text();
if not ss then return ;
if not(f_ps and ifnumber(f_ps[0]) and ifnumber(f_ps[1])) then return ;
if clip_state=tgc_on then cvs.axesclip();
if clip_state=tgc_on then //迂回处理
begin
bx := axes.zoom_box;
vj := d;
if vj[0]<bx[0,0] or vj[1]<bx[1,0] or vj[2]<bx[2,0] or vj[0]>bx[0,1] or vj[1]>bx[1,1] or vj[2]>bx[2,1] then
begin
return ;
end
cvs.axesclip();
end
else cvs.axesunclip();
ws := 0;
hs := array();