优化编辑器,ctrol+j 弹出函数查找
This commit is contained in:
@@ -28,6 +28,7 @@ type t_children_sizer = class()
|
||||
if flayout=0 then return ;
|
||||
if fautosizing then return ;
|
||||
fautosizing := true;
|
||||
if not fowner then return ;
|
||||
faownercls := fowner.ClientRect;
|
||||
dolayoutctls(w,h);
|
||||
if fowner.autosize then
|
||||
@@ -62,7 +63,7 @@ type t_children_sizer = class()
|
||||
case i of
|
||||
"layout" :
|
||||
begin
|
||||
if vi<>flayout and(vi=0 or vi=1) then
|
||||
if vi<>flayout and(vi=0 or vi=1 or vi=2) then
|
||||
begin
|
||||
flayout := vi;
|
||||
if vi then flg := true;
|
||||
@@ -130,6 +131,7 @@ type t_children_sizer = class()
|
||||
end
|
||||
function dolayoutctls(w,h);
|
||||
begin
|
||||
if not fowner then return ;
|
||||
ctls := fowner.Controls;
|
||||
r := array();
|
||||
ridx := 0;
|
||||
@@ -141,6 +143,7 @@ type t_children_sizer = class()
|
||||
if not ctl then continue;
|
||||
if not ctl.Visible then continue;
|
||||
if (ctl is getwndclass()) and ctl.WsPopUp then continue;
|
||||
|
||||
if cidx>=fcontrolsperline then
|
||||
begin
|
||||
ccount := fcontrolsperline;
|
||||
@@ -148,12 +151,17 @@ type t_children_sizer = class()
|
||||
ridx++;
|
||||
end
|
||||
ctl.GetPreferredSize(wi,hi);
|
||||
r[ridx,cidx] := array(ctl,0,0,wi,hi);
|
||||
if flayout=1 then
|
||||
r[ridx,cidx] := array(ctl,0,0,wi,hi);
|
||||
else r[cidx,ridx] := array(ctl,0,0,wi,hi);
|
||||
cidx++;
|
||||
end
|
||||
ccount := max(ccount,cidx);
|
||||
end
|
||||
ccount := mcols(r);
|
||||
ridx := mrows(r);
|
||||
//ccount := max(ccount,cidx);
|
||||
wsz := zeros(ccount);
|
||||
hsz := zeros(ridx+1);
|
||||
//hsz := zeros(ridx+1);
|
||||
hsz := zeros(ridx);
|
||||
for i := 0 to length(r)-1 do
|
||||
begin
|
||||
for j := 0 to length(r[i])-1 do
|
||||
@@ -240,10 +248,10 @@ type t_children_sizer = class()
|
||||
end
|
||||
function setlayout(v);
|
||||
begin
|
||||
if v<>flayout and v in array(0,1) then
|
||||
if v<>flayout and v in array(0,1,2) then
|
||||
begin
|
||||
flayout := v;
|
||||
if v<>0 then
|
||||
if v>0 then
|
||||
begin
|
||||
dolayout();
|
||||
end
|
||||
|
||||
@@ -1014,7 +1014,7 @@ type tcontrol = class(tcomponent)
|
||||
if (Align=alNone) then
|
||||
begin
|
||||
p := Parent ;
|
||||
if p and p.childsizing.layout=1 then return p.AdjustSize();
|
||||
if p and p.childsizing.layout>0 then return p.AdjustSize();
|
||||
AdjustSize();
|
||||
end
|
||||
end
|
||||
@@ -1027,7 +1027,7 @@ type tcontrol = class(tcomponent)
|
||||
CallMessgeFunction(OnSize,o,e);
|
||||
DoWMSIZE(o,e);
|
||||
p := Parent ;
|
||||
if p and p.childsizing.layout=1 then return p.AdjustSize();
|
||||
if p and p.childsizing.layout>0 then return p.AdjustSize();
|
||||
AdjustSize();
|
||||
end
|
||||
function CMCursorChanged(o,e):CM_CURSORCHANGED;virtual;
|
||||
|
||||
@@ -2598,7 +2598,7 @@ type TWinControl = class(tcontrol)
|
||||
return ;
|
||||
end
|
||||
cs := childsizing;
|
||||
if cs and cs.layout=1 then return cs.AdjustSize();
|
||||
if cs and cs.layout>0 then return cs.AdjustSize();
|
||||
if autosize then
|
||||
begin
|
||||
a := Align ;
|
||||
@@ -2683,7 +2683,7 @@ type TWinControl = class(tcontrol)
|
||||
**}
|
||||
if not HandleAllocated()then exit;
|
||||
cs := childsizing;
|
||||
if cs and cs.layout=1 then return ;
|
||||
if cs and cs.layout>0 then return ;
|
||||
if not ifarray(rect)then
|
||||
begin
|
||||
rect := ClientRect;
|
||||
@@ -2711,7 +2711,7 @@ type TWinControl = class(tcontrol)
|
||||
**}
|
||||
if not HandleAllocated()then exit;
|
||||
cs := childsizing;
|
||||
if cs and cs.layout=1 then return ;
|
||||
if cs and cs.layout>0 then return ;
|
||||
e := new TMANCHOR(CN_ANCHOR,0,0,0);
|
||||
c := ClientRect;
|
||||
for i := 0 to ControlCount-1 do
|
||||
|
||||
Reference in New Issue
Block a user