admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
40
41
42
Quintiq file version 2.0
#parent: CustomDrawComponent/CustomDrawDataLayerStockingPointUnitEdge
Response OnDrawObject (
  StockingPointUnitEdge object
) id:Response_CustomDrawComponent_CustomDrawDataLayerStockingPointUnitEdge_OnDrawObject
{
  #keys: '[11660.0.305213728]'
  Body:
  [*
    // Draw SPUE
    
    // draw line
    minx := minvalue ( object.FromX(), object.ToX() );
    miny := minvalue ( object.FromY(), object.ToY() );
    
    // region always starts at 0,0
    adjustX := 0 - minx;
    adjustY := 0 - miny;
    
    color := ColorScheme.StockingPointUnit();
    if ( object.SupplyChainView().ArrowColor() <> '' )
    {
      color := guard( Color::Color( object.SupplyChainView().ArrowColor() ), ColorScheme.StockingPointUnit() );
    }
    
    surface.Pen().Color( color ); 
    surface.Pen().Style( PenSpecification::StyleDashed() );
    surface.Pen().Width( 1 );
    surface.Brush().Color( color ); // to paint the solid arrowhead
    
    line := GraphicalLine::LineTo( object.FromX() + adjustX, object.FromY() + adjustY, object.ToX() + adjustX, object.ToY() + adjustY );
    line.ArrowToEnd( true ).ArrowPos( GraphicalLine::ArrowPosMiddle() );
    
    surface.Draw( line );
  *]
  DefinitionID: 'Responsedef_CustomDrawDataLayer_OnDrawObject'
  Precondition:
  [*
    return MacroPlan::HasMacroPlan( MacroPlan, feedback )
          and not isnull( DataHolderView.Data() )
  *]
}