Skip to content

Commit b3745ba

Browse files
committed
Do not draw selection when cclick in header
1 parent 922dc60 commit b3745ba

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
@@ -10488,6 +10488,9 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
1048810488
with TLMLButtonDblClk(Message) do
1048910489
P := Point(XPos, YPos);
1049010490

10491+
IsInHeader := InHeader(P);
10492+
Result := IsInHeader;
10493+
1049110494
if (hoHeightDblClickResize in FOptions) and InHeaderSplitterArea(P) and (FDefaultHeight > 0) then
1049210495
begin
1049310496
if DoHeightDblClickResize(P, GetShiftState) and (FDefaultHeight > 0) then
@@ -10504,7 +10507,7 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
1050410507
Message.Result := 0;
1050510508
Result := True;
1050610509
end
10507-
else if InHeader(P) and (Message.Msg <> LM_LBUTTONDBLCLK) then
10510+
else if IsInHeader and (Message.Msg <> LM_LBUTTONDBLCLK) then
1050810511
begin
1050910512
case Message.Msg of
1051010513
LM_MBUTTONDBLCLK:
@@ -10587,9 +10590,9 @@ function TVTHeader.HandleMessage(var Message: TLMessage): Boolean;
1058710590
// Disabled columns do not start a drag operation because they can't be clicked.
1058810591
Include(FStates, hsDragPending);
1058910592
SetCapture(Treeview.Handle);
10590-
Result := True;
1059110593
Message.Result := 0;
1059210594
end;
10595+
Result := True;
1059310596
end;
1059410597

1059510598
// This is a good opportunity to notify the application.
@@ -25210,9 +25213,11 @@ procedure TBaseVirtualTree.WndProc(var Message: TLMessage);
2521025213
//lclheader
2521125214
//let the header handle the message here
2521225215
//otherwise no header click event will be fired
25213-
FHeader.HandleMessage(Message);
25214-
ControlState := ControlState + [csLButtonDown];
25215-
Dispatch(Message); // overrides TControl's BeginDrag
25216+
if not FHeader.HandleMessage(Message) then
25217+
begin
25218+
ControlState := ControlState + [csLButtonDown];
25219+
Dispatch(Message); // overrides TControl's BeginDrag
25220+
end;
2521625221
end;
2521725222
end;
2521825223
end;

0 commit comments

Comments
 (0)