mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 14:29:07 +02:00
lcl: improve InsertMarkType detection for TTreeView by patch of Paul Michell (issue #0013314)
git-svn-id: trunk@18991 -
This commit is contained in:
parent
af8f77fb82
commit
6526ca074b
@ -3401,14 +3401,18 @@ begin
|
||||
if Y<0 then Y:=0;
|
||||
if Y>=ClientHeight then Y:=ClientHeight-1;
|
||||
ANode:=GetNodeAtY(Y);
|
||||
NodeRect:=ANode.DisplayRect(false);
|
||||
NodeMidY:=(NodeRect.Top+NodeRect.Bottom) div 2;
|
||||
if ANode<>nil then begin
|
||||
AnInsertMarkNode:=ANode;
|
||||
if (X>AnInsertMarkNode.DisplayExpandSignRight) then
|
||||
// insert as first child of pointed node
|
||||
AnInsertMarkType:=tvimAsFirstChild
|
||||
else begin
|
||||
NodeRect:=ANode.DisplayRect(false);
|
||||
NodeMidY:=(NodeRect.Top+NodeRect.Bottom) div 2;
|
||||
if Y>=NodeMidY then begin
|
||||
// insert as first child of pointed node
|
||||
AnInsertMarkType:=tvimAsFirstChild;
|
||||
end else begin
|
||||
// insert as previous sibling of pointed node
|
||||
AnInsertMarkType:=tvimAsPrevSibling;
|
||||
end else begin
|
||||
if Y>=NodeMidY then begin
|
||||
if ANode.Expanded and ANode.HasChildren then begin
|
||||
// insert as first child of pointed node
|
||||
@ -3418,6 +3422,7 @@ begin
|
||||
AnInsertMarkType:=tvimAsNextSibling;
|
||||
end;
|
||||
end else begin
|
||||
// insert as previous sibling of pointed node
|
||||
AnInsertMarkType:=tvimAsPrevSibling;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user