Skip to content

Commit

Permalink
Corrected messed up if-statement ´from last commit for issue #739.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joachim Marder committed Nov 20, 2017
1 parent 7be1336 commit 1b5ca56
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Source/VirtualTrees.pas
Original file line number Diff line number Diff line change
Expand Up @@ -8344,6 +8344,12 @@ procedure TVirtualTreeColumns.HandleClick(P: TPoint; Button: TMouseButton; Force
begin
FreeAndNil(fColumnPopupMenu);// Attention: Do not free the TVTHeaderPopupMenu at the end of this method, otherwise the clikc events of the menu item will not be fired.
if Assigned(Header.PopupMenu) then
begin
With Header.Treeview.ClientToScreen(P) do
Header.PopupMenu.Popup(X, Y);
end // if hoAutoColumnPopupMenu
else if (hoAutoColumnPopupMenu in Header.Options) then
begin
fColumnPopupMenu := TVTHeaderPopupMenu.Create(Header.TreeView);
TVTHeaderPopupMenu(fColumnPopupMenu).OnColumnChange := HeaderPopupMenuColumnChange;
fColumnPopupMenu.PopupComponent := Header.Treeview;
Expand All @@ -8353,11 +8359,6 @@ procedure TVirtualTreeColumns.HandleClick(P: TPoint; Button: TMouseButton; Force
TVTHeaderPopupMenu(fColumnPopupMenu).Options := TVTHeaderPopupMenu(fColumnPopupMenu).Options - [poResizeToFitItem];
With Header.Treeview.ClientToScreen(P) do
fColumnPopupMenu.Popup(X, Y);
end // if hoAutoColumnPopupMenu
else if (hoAutoColumnPopupMenu in Header.Options) then begin
begin
With Header.Treeview.ClientToScreen(P) do
Header.PopupMenu.Popup(X, Y);
end;
end;//if mbRight
FHeader.Treeview.DoHeaderClick(HitInfo);
Expand Down

0 comments on commit 1b5ca56

Please sign in to comment.