Skip to content

Commit 1c06fb0

Browse files
committed
Do not draw selection when cclick in header
1 parent 872219c commit 1c06fb0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Source/VirtualTrees.pas

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9886,6 +9886,9 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
98869886
with TLMLButtonDblClk(Message) do
98879887
P := Point(XPos, YPos);
98889888

9889+
IsInHeader := InHeader(P);
9890+
Result := IsInHeader;
9891+
98899892
if (hoHeightDblClickResize in FOptions) and InHeaderSplitterArea(P) and (FDefaultHeight > 0) then
98909893
begin
98919894
if DoHeightDblClickResize(P, GetShiftState) and (FDefaultHeight > 0) then
@@ -9901,7 +9904,7 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
99019904
Message.Result := 0;
99029905
Result := True;
99039906
end
9904-
else if InHeader(P) and (Message.Msg <> LM_LBUTTONDBLCLK) then
9907+
else if IsInHeader and (Message.Msg <> LM_LBUTTONDBLCLK) then
99059908
begin
99069909
case Message.Msg of
99079910
LM_MBUTTONDBLCLK:
@@ -9972,9 +9975,9 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
99729975
// Disabled columns do not start a drag operation because they can't be clicked.
99739976
Include(FStates, hsDragPending);
99749977
SetCapture(Treeview.Handle);
9975-
Result := True;
99769978
Message.Result := 0;
99779979
end;
9980+
Result := True;
99789981
end;
99799982

99809983
// This is a good opportunity to notify the application.
@@ -23864,9 +23867,11 @@ procedure TBaseVirtualTree.WndProc(var Message: TLMessage);
2386423867
//lclheader
2386523868
//let the header handle the message here
2386623869
//otherwise no header click event will be fired
23867-
FHeader.HandleMessage(Message);
23868-
ControlState := ControlState + [csLButtonDown];
23869-
Dispatch(Message); // overrides TControl's BeginDrag
23870+
if not FHeader.HandleMessage(Message) then
23871+
begin
23872+
ControlState := ControlState + [csLButtonDown];
23873+
Dispatch(Message); // overrides TControl's BeginDrag
23874+
end;
2387023875
end;
2387123876
end;
2387223877
end;

0 commit comments

Comments
 (0)