Skip to content

Commit 91866c1

Browse files
committed
Simplified code in VST2GetPopupMenu() and show popup menu also when tigerred by keyboard.
1 parent 6a8d46c commit 91866c1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Demos/Advanced/GeneralAbilitiesDemo.pas

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface
2828
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
2929
StdCtrls, Buttons, VirtualTrees, ComCtrls, ExtCtrls, ImgList, Menus,
3030
StdActns, ActnList, VirtualTrees.HeaderPopup, UITypes, System.ImageList, VirtualTrees.BaseTree,
31-
VirtualTrees.Types;
31+
VirtualTrees.Types, VirtualTrees.BaseAncestorVCL, VirtualTrees.AncestorVCL;
3232

3333
type
3434
TGeneralForm = class(TForm)
@@ -368,15 +368,11 @@ procedure TGeneralForm.VST2GetPopupMenu(Sender: TBaseVirtualTree; Node: PVirtual
368368
const P: TPoint; var AskParent: Boolean; var PopupMenu: TPopupMenu);
369369

370370
begin
371-
case Column of
372-
0:
373-
PopupMenu := PopupMenu1
374-
else
375-
PopupMenu := nil;
376-
end;
371+
if Column <= 0 then
372+
PopupMenu := PopupMenu1;
377373
end;
378374

379-
//----------------------------------------------------------------------------------------------------------------------
375+
//----------------------------------------------------------------------------------------------------------------------;
380376

381377
procedure TGeneralForm.VST2KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
382378

0 commit comments

Comments
 (0)