You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// DragOver only accepts dmOnNode in root tree level
2455
+
IndexNode := TargetNode;
2456
+
ColPos := IndexNode.ChildCount;
2457
+
end;
2458
+
2459
+
1: begin
2460
+
IndexNode := TargetNode.Parent;
2461
+
// Find the right new position for the dropped column
2462
+
ColPos := TargetNode.Index;
2463
+
if Source = Sender thenbegin
2464
+
// Drop within index tree: Take care if user dragged from above or from below the target node
2465
+
if FocusedNode <> nilthenbegin
2466
+
if (FocusedNode.Index < TargetNode.Index) and (Mode = dmAbove) and (ColPos > 0) then
2467
+
Dec(ColPos);
2468
+
if (FocusedNode.Index > TargetNode.Index) and (Mode = dmBelow) and (ColPos < IndexNode.ChildCount-1) then
2469
+
Inc(ColPos);
2470
+
end;
2471
+
endelsebegin
2472
+
// Drop from columns list
2473
+
if Mode = dmBelow then
2474
+
Inc(ColPos);
2475
+
end;
2476
+
end;
2477
+
2478
+
end;
2479
+
2480
+
if Source = Sender then
2481
+
MoveFocusedIndexPart(ColPos)
2482
+
elsebegin
2483
+
TblKey := FKeys[IndexNode.Index];
2484
+
Col := SourceVT.GetNodeData(SourceVT.FocusedNode);
2485
+
ColName := Col.Name;
2486
+
if TblKey.Columns.IndexOf(ColName) > -1thenbegin
2487
+
if MessageDialog(_('Add duplicated column to index?'),
2488
+
f_('Index "%s" already contains the column "%s". It is possible to add a column twice into a index, but total nonsense in practice.', [VT.Text[IndexNode, 0], ColName]),
2489
+
mtConfirmation, [mbYes, mbNo]) = mrNo then
2490
+
Exit;
2491
+
end;
2492
+
2493
+
TblKey.Columns.Insert(ColPos, ColName);
2494
+
PartLength := '';
2495
+
if (not TblKey.IsFulltext) and (Col.DataType.Index in [dbdtTinyText, dbdtText, dbdtMediumText, dbdtLongText, dbdtTinyBlob, dbdtBlob, dbdtMediumBlob, dbdtLongBlob]) then
0 commit comments