| Quintiq file version 2.0 | 
| #parent: CustomDrawRC/CustomDrawDataLayerPISPInputNodeInRouting | 
| Response OnDrawObject ( | 
|   OperationInputPISPNode object | 
| ) id:Response_CustomDrawRC_CustomDrawDataLayerPISPInputNodeInRouting_OnDrawObject | 
| { | 
|   #keys: '[139394.0.1283372636]' | 
|   CanBindMultiple: false | 
|   DefinitionID: 'Responsedef_WebCustomDrawDataLayer_OnDrawObject' | 
|   QuillAction | 
|   { | 
|     Body: | 
|     [* | 
|       // Draw PISP node in routing | 
|        | 
|       productimage := guard( select( object.PISPNodeInRouting().ProductInStockingPoint_MP().Product_MP(), ProductNode, pn, pn.IconName() <> '', true ).IconName(), '' ); | 
|       imagesize := minvalue ( region.BoundingRect().Height(), region.BoundingRect().Width() ); | 
|        | 
|       //Initialize borders | 
|       surface.Pen().Style( PenSpecification::StyleSolid() ); | 
|       surface.Pen().Width( 1 ) | 
|       surface.Pen().Color( ColorScheme.RoutingConfigurator_RoutingOutline() ); | 
|        | 
|       colorstart := ColorScheme.RoutingConfigurator_PISPNodeInRoutingFromColor(); | 
|       colorend := ColorScheme.RoutingConfigurator_PISPNodeInRoutingToColor(); | 
|        | 
|       if( object.OperationInput().IsFloating() ) | 
|       { | 
|         colorstart := ColorScheme.RoutingConfigurator_FloatingProduct(); | 
|         colorend := ColorScheme.RoutingConfigurator_FloatingProduct(); | 
|       } | 
|        | 
|       surface.Brush().LinearGradient( region.BoundingRect(), colorstart, colorend, 0.0 ) | 
|       surface.Fill( region.Shape() ); | 
|        | 
|        | 
|       //Initialize text | 
|       rcv := MacroPlan.RoutingConfiguratorView(); | 
|       surface.Font().Name( rcv.FontName() ); | 
|       surface.Font().Size( rcv.FontSize() ); | 
|       surface.TextColor( Color::Black() ); | 
|       textformat := TextFormat::Construct( TextFormat::AlignLeft(), TextFormat::AlignMiddle() ); | 
|        | 
|       if ( text = '' ) | 
|       { | 
|         if(  not isnull( object.PISPNodeInRouting() ) and object.PISPNodeInRouting().IsFloating() ) | 
|         { | 
|           text := object.PISPNodeInRouting().ProductInStockingPoint_MP().Product_MP().Name()  + ' ' + Translations::MP_SanityCheck_MissingStockingPoint(); | 
|         } | 
|         else if ( isnull( object.PISPNodeInRouting() ) ) | 
|         { | 
|           text := object.OperationInput().ProductID() + ' ' + Translations::MP_SanityCheck_Invalid(); | 
|         } | 
|         else | 
|         {   | 
|           text := object.OperationInput().ProductInStockingPoint_MP().Name(); | 
|         } | 
|       } | 
|        | 
|       if( productimage <> '' ) | 
|       { | 
|         surface.Image( region.BoundingRect().Left(), region.BoundingRect().Top(), imagesize, imagesize, productimage + '(32)' ); | 
|         surface.TextZoom( region.BoundingRect().Left() + imagesize , region.BoundingRect().Top(),  | 
|                           region.BoundingRect().Width() - imagesize , region.BoundingRect().Height(), text, textformat ); | 
|       } | 
|       else | 
|       { | 
|         // Add pen width to push the text rightward more to avoid clipping with the border | 
|         surface.TextZoom( region.BoundingRect().Left() + surface.Pen().Width(), region.BoundingRect().Top(), | 
|                           region.BoundingRect().Width(), region.BoundingRect().Height(),  | 
|                           text, textformat ); | 
|       } | 
|        | 
|       surface.Rect( region.BoundingRect().Left(), region.BoundingRect().Top(),  | 
|                     region.BoundingRect().Width(), region.BoundingRect().Height(), ColorScheme.RoutingConfigurator_RoutingOutline() ); | 
|     *] | 
|     GroupServerCalls: false | 
|   } | 
| } |