设计器

优化细节
This commit is contained in:
JianjunLiu
2023-01-18 17:57:13 +08:00
parent 34bf83ae86
commit 33d710b201
4 changed files with 104 additions and 13 deletions
+54 -1
View File
@@ -1916,7 +1916,60 @@ type TWinControl = class(tcontrol)
x+=dx;
cv.SetPixel(array(x,y),c);
end
end
end
ctls := controls;
rcs := array();
sel := -1;
selr := 0;
len := ctls.count-1 ;
for i:= 0 to len do
begin
vi := ctls[i];
if vi is class(TWinControl) then
begin
if vi.Visible then rcs[i] := vi.BoundsRect;
if vi.DesigningSelect() then
begin
sel := i;
selr := rcs[i];
end
end
end
if sel >=0 then
begin
pc := cv.pen.color;
pct := cv.pen.style;
cv.pen.Style := PS_DOT;
cv.pen.color := 0x3f3f3f;
for i := 0 to len do
begin
if i=sel then continue;
rc := rcs[i];
if not rc then continue;
if rc[0] = selr[0] then
begin
cv.moveto(array(rc[0],min(rc[1],selr[1])));
cv.LineTo(array(rc[0],max(rc[1],selr[1])));
end
if rc[1]=selr[1] then
begin
cv.moveto(array(min(rc[0],selr[0]),rc[1]));
cv.LineTo(array(max(rc[0],selr[0]),rc[1]));
end
if rc[2] = selr[2] then
begin
cv.moveto(array(rc[2],min(rc[1],selr[1])));
cv.LineTo(array(rc[2],max(rc[1],selr[1])));
end
if rc[3] = selr[3] then
begin
cv.moveto(array(min(rc[0],selr[0]),rc[3]));
cv.LineTo(array(max(rc[0],selr[0]),rc[3]));
end
end
cv.pen.color := pc;
cv.pen.style := pct;
end
end
end
function ControlCreateWnd();