yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
43
44
45
46
47
48
49
50
51
52
53
54
55
Quintiq file version 2.0
#parent: CustomDrawSCO/CustomDrawDataLayerGrid
Response OnDrawObject (
  SupplyChainView object
) id:Response_CustomDrawSCO_CustomDrawDataLayerGrid_OnDrawObject
{
  #keys: '[136682.0.1912949910]'
  CanBindMultiple: false
  DefinitionID: 'Responsedef_WebCustomDrawDataLayer_OnDrawObject'
  QuillAction
  {
    Body:
    [*
      // Draw background image
      
      // Draw the background image defined in global parameter unless it's in a drilled down unit
      view := object;
      bgimage := guard( view.SupplyChainBackground(), '' );
      
      focusedunitnode := select( object, Node.astype( UnitNode ), n, n.Unit() = DataHolderFocusedUnit.Data() );
      
      if ( not isnull( focusedunitnode ) )
      {
        bgimage := focusedunitnode.BackgroundImageName();
      }
      
      if ( bgimage <> '' )
      {
        surface.Image( region.BoundingRect().Left() , region.BoundingRect().Top(), bgimage );
      }
      
      if( object.IsGridVisible() )
      {
        surface.Pen().Color( ColorScheme.SupplyChainOverview_Grid() ); 
        surface.Pen().Style( PenSpecification::StyleSolid() );
        surface.Pen().Width( 1 );
        
        width := object.GridWidth();
        height := object.GridHeight();
        grid := object.GridPointDistance();
      
        for ( x := 0; x < width; x := x + grid )
        {
          surface.Line( x, 0, x, height );
        }
      
        for ( y := 0; y < height; y := y + grid )
        {
          surface.Line( 0, y, width, y );
        }
      }
    *]
    GroupServerCalls: false
  }
}