设计器

优化体验
This commit is contained in:
JianjunLiu 2022-09-30 11:37:37 +08:00
parent 7b404b5ed0
commit 1dac8f9a56
4 changed files with 58 additions and 20 deletions

View File

@ -956,8 +956,9 @@ type TVclDesigner = class(tvcform)
fcwindowinfo := nd;
FTree := fcwindowinfo.ftree;
showtree(fcwindowinfo);
rnd := FTree.RootItem;
nnd := rnd.GetNodeByIndex(0);
//rnd := FTree.RootItem;
//nnd := rnd.GetNodeByIndex(0);
nnd := ftree.CurrentNode;
if nnd then
begin
cp := nnd.Component;
@ -967,12 +968,13 @@ type TVclDesigner = class(tvcform)
begin
wd.visible := false;
wd.visible := true;
end
FPropGrid.Component := cp;
FEventGrid.Component := cp;
end
end
end
end
public
function ExecuteCommand(cmd,p);override;
begin

View File

@ -506,6 +506,7 @@ type TProjectView = class(TVCForm) //
if FTree.PopUpMenu then
begin
it := e.itemnew;
if it=ftree.RootNode then return FDesigner.ExecuteCommand("hiddrennode",nil);
if it then
begin
if it.FType="dir" then
@ -743,10 +744,11 @@ type TProjectView = class(TVCForm) //
FDesigner.ExecuteCommand("hiddrennode",nil);
fn := FCurrentOpend.geteditfilename();
it := FTslEditer.OpenAndGotoFileByName(fn);
if not it then return FCurrentOpend := nil;
if not it then
begin
return FCurrentOpend := nil;
end
ShowEditor(); //FTslEditer.Show();
end
"form","panel":
begin
@ -921,7 +923,8 @@ type TProjectView = class(TVCForm) //
end;
end
//FTree.DeleteNode(nd);
nd.Recycling();
FTree.DeleteCurrentNode();
//nd.Recycling();
SaveProjInfo();
end
end
@ -1903,7 +1906,7 @@ type TFileTree = class(TTreeCtl)
FPNode.Caption := "当前工程";
FPNode.FType := "dir";
FPNode.parent := RootNode;
SetSel(FPNode);
//SetSel(FPNode);
end
function GetNodesByName(nds,n);
begin
@ -1968,10 +1971,10 @@ type TFileTree = class(TTreeCtl)
C := CurrentNode;
if not c then return false;
if FPNode=c then return false;
pc := c.parent;
DeleteNode(c);
if pc.ItemCount<1 then setsel(pc);
else setsel(pc.GetNodeByIndex(0));
//pc := c.parent;
//DeleteNode(c);
//if pc.ItemCount<1 then setsel(pc);
//else setsel(pc.GetNodeByIndex(0));
c.Recycling();
end
function GetNodePath(nd); //获得目录节点的path

View File

@ -3199,10 +3199,34 @@ type TPairSplitter=class(tcustomcontrol) //
end
function MouseMove(o,e);override;
begin
if (csDesigning in ComponentState) then return ;
if FIs_Draging then
begin
nxy := clienttowindow(e.xpos,e.ypos);
_wapi.ImageList_DragMove(nxy[0],nxy[1]);
end else
begin
idx := 0;
for i:= 0 to FSides.count-1 do
begin
vi := FSides[i];
if vi.Enabled and vi.Visible then idx++;
if idx>1 then break;
end
if idx>1 then
begin
if FSplitterType=pstHorizontal then
begin
cursor := OCR_SIZEWE;
end else
if FSplitterType=pstVertical then
begin
cursor := OCR_SIZENS ;
end
end else
begin
cursor := OCR_NORMAL;
end
end
inherited;
end

View File

@ -465,6 +465,10 @@ type TcustomTreeCtlNode = class(TVirtualListItem)
CurrentDeleteNode := nd;
nd.parent := self(true);
CurrentDeleteNode := nil;
if nd = Owner.CurrentNode then
begin
Owner.SetSel(nil);
end
finally
Owner.DecPaintLock();
end
@ -1696,7 +1700,11 @@ type TcustomTreeCtl = class(TVirtualList)
@explan(说明) 设置选中节点 %%
@param(it)(TcustomTreeCtlNode) 节点 %%
**}
if(it is class(TcustomTreeCtlNode))and it.Owner=self then
if flockchangedcall then
begin
return ;//
end
if ifnil(it) or ( (it is class(TcustomTreeCtlNode))and (it.Owner=self)) then
begin
r := CallSelChange(it);
if r then return;
@ -1711,6 +1719,7 @@ type TcustomTreeCtl = class(TVirtualList)
end
function GoToNode(it);
begin
if not((it is class(TcustomTreeCtlNode))and (it.Owner=self)) then return ;
if NodeInList(it)then
begin
//return SetTopLine(GetItemIndex(it)); //滚动
@ -1756,15 +1765,12 @@ type TcustomTreeCtl = class(TVirtualList)
end
inherited;
end
function CreateNode();virtual;
{function CreateNode();virtual;
begin
{**
@ignore(ºöÂÔ) %%
**}
return CreateTreeNode();
r := new TcustomTreeCtlNode(self(true));
return r;
end
end}
function CreateTreeNode();virtual;
begin
r := new TcustomTreeCtlNode(self(true));
@ -1827,7 +1833,9 @@ type TcustomTreeCtl = class(TVirtualList)
begin
//setprofiler(1+2+4);
//exportfile(ftstream(),"","d:\\tst\\abc.stm",getprofilerinfo(true));
flockchangedcall := true;
if FRootItem then FRootItem.Recycling();
flockchangedcall := false;
FRootItem := nil;
FCurrentNode := nil;
FOnSelChanging := nil;
@ -1879,6 +1887,7 @@ type TcustomTreeCtl = class(TVirtualList)
return FRootItem;
end
private
flockchangedcall;//
FOnlyLeafNodeCheckMark;
FNodeHierarchyWidth;
FMulSelected;