设计器

优化体验
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
+25 -1
View File
@@ -3199,11 +3199,35 @@ 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
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
function RemoveSide(ASide);
+15 -6
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;