File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1528,7 +1528,7 @@ procedure FixVT(VT: TVirtualStringTree; IsResultGrid: Boolean=False);
15281528 VT.OnEndOperation := Mainform.AnyGridEndOperation;
15291529 VT.BorderStyle := bsNone; // Cosmetic
15301530 // Some trees have their own OnContextMenu logic set at design time:
1531- if not Assigned(VT.OnContextPopup) then
1531+ if ( not Assigned(VT.OnContextPopup)) and Assigned(VT.Header.PopupMenu ) then
15321532 VT.OnContextPopup := MainForm.AnyGridContextPopup;
15331533end ;
15341534
Original file line number Diff line number Diff line change @@ -951,7 +951,6 @@ object MainForm: TMainForm
951951 Constraints.MinHeight = 32
952952 Constraints.MinWidth = 32
953953 DefaultText = 'Node'
954- DragMode = dmAutomatic
955954 DragType = dtVCL
956955 Header.AutoSizeIndex = 0
957956 Header.Columns = <
@@ -993,6 +992,7 @@ object MainForm: TMainForm
993992 OnGetNodeDataSize = DBtreeGetNodeDataSize
994993 OnInitChildren = DBtreeInitChildren
995994 OnInitNode = DBtreeInitNode
995+ OnMouseMove = DBtreeMouseMove
996996 OnMouseUp = DBtreeMouseUp
997997 end
998998 end
Original file line number Diff line number Diff line change @@ -841,6 +841,8 @@ TMainForm = class(TExtForm)
841841 var Handled: Boolean);
842842 procedure DataGridContextPopup(Sender: TObject; MousePos: TPoint;
843843 var Handled: Boolean);
844+ procedure DBtreeMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
845+ );
844846 procedure FormActivate(Sender: TObject);
845847 procedure ImageListGetWidthForPPI(Sender: TCustomImageList;
846848 AImageWidth, APPI: Integer; var AResultWidth: Integer);
@@ -4599,6 +4601,16 @@ procedure TMainForm.DataGridContextPopup(Sender: TObject; MousePos: TPoint;
45994601 Handled := Tree.Header.InHeader(MousePos);
46004602end;
46014603
4604+ procedure TMainForm.DBtreeMouseMove(Sender: TObject; Shift: TShiftState; X,
4605+ Y: Integer);
4606+ begin
4607+ // Required step with DragMode=dmManual
4608+ // We use dmManual to fix a non appearing context menu in conjunction with DragType=dtVCL
4609+ // This reserves left-clicks for dragging, leaving right-clicks for context menu
4610+ if (ssLeft in Shift) and (not DBtree.Dragging) then
4611+ DBtree.BeginDrag(False);
4612+ end;
4613+
46024614procedure TMainForm.FormActivate(Sender: TObject);
46034615begin
46044616 // Work around non-working wsMaxmized in OnCreate and OnShow
You can’t perform that action at this time.
0 commit comments