Quintiq file version 2.0
|
#parent: CustomDrawComponentRoutingConfigurator/CustomDrawDataLayerPISPNodeInRoutingRCV
|
Response OnDrawObject (
|
OperationInputPISPNode object
|
) id:Response_CustomDrawComponentRoutingConfigurator_CustomDrawDataLayerPISPNodeInRoutingRCV_OnDrawObject
|
{
|
#keys: '[124808.0.1228985585]'
|
Body:
|
[*
|
// Draw PISP node in routing
|
|
productimage := guard( select( object.PISPNodeInRouting().ProductInStockingPoint_MP().Product_MP(), ProductNode, pn, pn.IconName() <> '', true ).IconName(), '' );
|
imagesize := minvalue ( region.Height(), region.Width() );
|
|
//Initialize borders
|
surface.Pen().Style( PenSpecification::StyleSolid() );
|
surface.Pen().Width( 1 )
|
surface.Pen().Color( ColorScheme.Outline() );
|
|
colorstart := ColorScheme.RoutingConfigurator_PISPNodeInRouting1();
|
colorend := ColorScheme.RoutingConfigurator_PISPNodeInRouting2();
|
|
if( object.OperationInput().IsFloating() )
|
{
|
colorstart := ColorScheme.RoutingConfigurator_FloatingProduct();
|
colorend := ColorScheme.RoutingConfigurator_FloatingProduct();
|
}
|
|
if( not objectinfo.Highlighted()
|
and guard( DataHolderHighlightPISPNodeInRouting.Data().Find( object.PISPNodeInRouting() ) >= 0, false ) )
|
{
|
colorstart := Color::Interpolate( colorstart, Color::Black() );
|
colorend := Color::Interpolate( colorend, Color::Black() );
|
}
|
|
surface.Brush().LinearGradient( region, colorstart, colorend, 0.0 )
|
surface.Fill( region );
|
|
|
//Initialize text
|
rcv := DataHolderRCView.Data();
|
surface.Font().Name( rcv.FontName() );
|
surface.Font().Size( rcv.FontSize() );
|
surface.TextColor( Color::Black() );
|
textformat := TextFormat::Construct( TextFormat::AlignCenter(), TextFormat::AlignMiddle() );
|
|
if ( text = '' )
|
{
|
text := object.OperationInput().ProductInStockingPoint_MP().Name();
|
}
|
|
if( productimage <> '' )
|
{
|
surface.Image( region.Left(), region.Top(), imagesize, imagesize, productimage + '(32)' );
|
surface.Text( region.Left() + imagesize , region.Top(), region.Width() - imagesize , region.Height(), text, textformat);
|
}
|
else
|
{
|
surface.Text( region, text, textformat );
|
}
|
|
surface.Rect( region.Left(), region.Top(), region.Width(), region.Height(), Color::Black() );
|
*]
|
DefinitionID: 'Responsedef_CustomDrawDataLayer_OnDrawObject'
|
Precondition:
|
[*
|
return not isnull( DataHolderRCView.Data() );
|
*]
|
}
|