设计器

优化
This commit is contained in:
JianjunLiu 2023-01-19 17:29:53 +08:00
parent 33d710b201
commit c7fd3cf136
3 changed files with 32 additions and 25 deletions

View File

@ -33,7 +33,7 @@ type TVclDesigner = class(tvcform)
FEventGrid; //控件事件grid
//************************************
FCurrentNode;
fselctlnode;
FCurrentClikPos;
FComponentCreater;
FRounMenu;
@ -654,10 +654,10 @@ type TVclDesigner = class(tvcform)
@explan(说明) 构造组件 %%
@return (TDComponent)
**}
if FComponentCreater and FCurrentNode and FCurrentClikPos then
if FComponentCreater and fselctlnode and FCurrentClikPos then
begin
par := FCurrentNode.Component.Cwnd;
r := FComponentCreater.ComponentCreater(FCurrentNode,par);
par := fselctlnode.Component.Cwnd;
r := FComponentCreater.ComponentCreater(fselctlnode,par);
if not r then exit;
//////////////////////////////////////////
//npar := par;
@ -692,7 +692,7 @@ type TVclDesigner = class(tvcform)
end
FCurrentClikPos := nil;
FComponentCreater := nil;
FCurrentNode := nil;
fselctlnode := nil;
FTree.PopupMenu := nil;
//echo "\r\n 添加控件";
g_script_can_set_not_focus := false;
@ -713,8 +713,8 @@ type TVclDesigner = class(tvcform)
@explan(说明) 节点被选择 %%
@param(n)(TComponentTreeNode) 被选择节点 %%
**}
if FCurrentNode=n then exit;
FCurrentNode := n;
if fselctlnode=n then exit;
fselctlnode := n;
if not ifobj(n) then exit;
t := n.Component;
if not t then exit;
@ -740,7 +740,7 @@ type TVclDesigner = class(tvcform)
FProjectManager.setnodesel(wnd);
return ;//
end
if FCurrentNode<>nd then
if fselctlnode<>nd then
begin
nd.owner.SetSel(nd);
TreeNodeSelected(nd);
@ -828,9 +828,9 @@ type TVclDesigner = class(tvcform)
if e.wparam then
begin
o1 := o;
if FCurrentNode then
if fselctlnode then
begin
wd := FCurrentNode.Component.Cwnd;
wd := fselctlnode.Component.Cwnd;
wd1 := wd;
while wd1 do
begin
@ -862,7 +862,7 @@ type TVclDesigner = class(tvcform)
FProjectManager.setnodesel(wnd);
return ;//
end
if FCurrentNode<> nd then
if fselctlnode<> nd then
begin
//wd := o;//nd.Component.Cwnd;
//if wd is class(TWincontrol) then _wapi.BringWindowToTop(wd.Handle);
@ -871,14 +871,14 @@ type TVclDesigner = class(tvcform)
end;
setcomponentfocus(o,true);
if factivatedonging then return ;
if FComponentCreater and FCurrentNode then
if FComponentCreater and fselctlnode then
begin
//SetSysParam("cpos_screan",array(e.lolparam,e.hilparam));
if FComponentCreater is class(TDRootComponent) then
begin
FCurrentNode := (tr.RootItem.items)[0];
if not FCurrentNode then return FComponentCreater := nil;
//O1 := FCurrentNode.Component.Cwnd;
fselctlnode := (tr.RootItem.items)[0];
if not fselctlnode then return FComponentCreater := nil;
//O1 := fselctlnode.Component.Cwnd;
//if not o1 then return FComponentCreater := nil;
end
//else o1 := o;
@ -930,7 +930,6 @@ type TVclDesigner = class(tvcform)
@explan(说明) 选择工具按钮 %%
**}
cct := o._tag;
//if FComponentCreater=cct then exit;
FComponentCreater := cct;
end
@ -938,8 +937,7 @@ type TVclDesigner = class(tvcform)
begin
{**
@explan(说明)关闭当前工程窗口%%
**}
**}
FProjectManager.CloseCurrentEdit(nil,true);
end
public //设计器中绑定事件
@ -994,7 +992,7 @@ type TVclDesigner = class(tvcform)
private //不同窗口切换
function hidenatree(nd);//隐藏控件树
begin
FCurrentNode := nil;
fselctlnode := nil;
if nd then
begin
tr := nd.ftree;
@ -1010,7 +1008,7 @@ type TVclDesigner = class(tvcform)
end
function showtree(nd); //显示控件树
begin
FCurrentNode := nil;
fselctlnode := nil;
tr := nd.ftree;
tr.visible := false;
FTree.visible := true;
@ -1043,7 +1041,7 @@ type TVclDesigner = class(tvcform)
end
function switchtree(nd); //切换控件树
begin
FCurrentNode := nil;
fselctlnode := nil;
if nd<>fcwindowinfo then
begin
if fcwindowinfo then //处理就有的

View File

@ -205,6 +205,7 @@ type TGridCellEditWithButton = class(TGridPropertyRender) //
{**
@explan(说明)标签被点击 %%
**}
ButtonClick(grid,e,d);
end
function CellLeave(grid);override; //离开
begin
@ -331,6 +332,10 @@ type TGridCellEventHandleEdit = class(TGridCellEditList,TPropertyTypeEvent)
function create(owner);override;
begin
inherited;
end
function LabelClick(grid,e,d);override;
begin
end
function CelldbClick(grid,e,d);virtual;
begin
@ -345,8 +350,6 @@ type TGridCellEventHandleEdit = class(TGridCellEditList,TPropertyTypeEvent)
end
type TGridCellVariableEdit = class(TGridCellEditList,TPropertyVarible)
public
function create(owner);override;
begin
inherited;

View File

@ -1922,23 +1922,28 @@ type TWinControl = class(tcontrol)
sel := -1;
selr := 0;
len := ctls.count-1 ;
ct := 0;
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.WsPopUp then continue;
if not(vi.Visible) then continue;
rcs[i] := vi.BoundsRect;
if vi.DesigningSelect() then
begin
sel := i;
selr := rcs[i];
end
ct++;
end
end
if sel >=0 then
if (sel >=0) and (ct>1) then
begin
pc := cv.pen.color;
pct := cv.pen.style;
pcw := cv.pen.width;
cv.pen.Style := PS_DOT;
cv.pen.color := 0x3f3f3f;
for i := 0 to len do
@ -1969,6 +1974,7 @@ type TWinControl = class(tcontrol)
end
cv.pen.color := pc;
cv.pen.style := pct;
cv.pen.width := pcw;
end
end
end