hongji.li
2023-11-07 192c736b8ac4b2d84cb823ac71f17e507948a5e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Quintiq file version 2.0
#parent: ListEntityTreeInPanel
Response OnDrop (
  structured[UnitNode] information,
  StockingPoint_MP target
) id:Response_ListEntityTreeInPanel_OnDrop_600
{
  #keys: '[127710.1.1019142641]'
  Body:
  [*
    // Dropping unit nodes on stocking point, assign the stocking point as output stocking point
    // #9446: Added CTRL modifier to link in reverse direction
    feedback := '';
    units := selectset( information, Elements.Unit, unit, true, true );
    
    if( dropaction.IsLink()
        and not target.CanLinkToUnits( feedback, units, false ) ) //if shift+control is hold and can unlink
    {
      target.RemoveAsOutputFromUnits( units );
    }
    else //this intends to link (shift+control is not hold)
    {
      target.LinkToUnits( units, dropaction.IsControl() );
    }
  *]
  DefinitionID: 'Responsedef_GUIComponent_OnDrop'
  Precondition:
  [*
    ret_value := true;
    
    if( not dropaction.IsLink() ) //if shift+control not hold, means linking and need to check preconditions
    {
      units := selectset( information, Elements.Unit, unit, true, true );
      ret_value := target.CanLinkToUnits( feedback, units, dropaction.IsControl() );
    }
    
    return ret_value;
  *]
}