Quintiq file version 2.0
|
#parent: CustomDrawRC/CustomDrawDataLayerRC
|
Response OnDrawObject (
|
Routing object
|
) id:Response_CustomDrawRC_CustomDrawDataLayerRC_OnDrawObject
|
{
|
#keys: '[139394.0.1275597002]'
|
CanBindMultiple: false
|
DefinitionID: 'Responsedef_WebCustomDrawDataLayer_OnDrawObject'
|
Precondition:
|
[*
|
/* Comment precon out because we won't be drawing grid for web
|
return guard( MacroPlan.RoutingConfiguratorView().IsGridVisible(), false )
|
and guard( MacroPlan.RoutingConfiguratorView().GridPointDistance() > 0, false ); //prevent infinite loop
|
*/
|
*]
|
QuillAction
|
{
|
Body:
|
[*
|
// Draw background image
|
rcv := MacroPlan.RoutingConfiguratorView();
|
|
|
/* Comment this part out because we don't want grid in the background
|
surface.Pen().Color( Colors.Grid() );
|
|
width := rcv.GridWidth();
|
height := rcv.GridHeight();
|
grid := rcv.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 );
|
}
|
*/
|
|
//draw operation drop here!
|
if( not object.HasStep() )
|
{
|
surface.Font().Size( rcv.FontSize() );
|
surface.Font().Name( rcv.FontName() );
|
surface.TextColor( ColorScheme.RoutingConfigurator_DropHereHelp() );
|
|
surface.Pen().Style( PenSpecification::StyleDashed() );
|
surface.Pen().Color( ColorScheme.RoutingConfigurator_DropHereHelp() );
|
surface.Pen().Width( rcv.EdgeThickness() )
|
|
// xy positions of the step
|
stepX := rcv.OffsetX()
|
+ rcv.PISPWidth() + rcv.GridPointDistance() * 2;
|
|
stepY := rcv.OffsetY();
|
|
stepW := maxvalue( rcv.OperationWidth(), rcv.RoutingStepMinimumWidth() );
|
|
value := ( 2 * rcv.OperationInputOutputHeight() )
|
+ rcv.OperationHeight()
|
+ 2 * rcv.OperationOffsetY();
|
|
stepH := maxvalue( value, rcv.RoutingStepMinimumHeight() );
|
|
rect := Shape::Rect( stepX , stepY, stepW, stepH );
|
surface.Draw( rect );
|
|
textformat := TextFormat::Construct( TextFormat::AlignCentered(), TextFormat::WrapWords() );
|
surface.TextZoom( stepX , stepY, stepW, stepH, Translations::MP_Routing_DropHereUnit(), textformat );
|
}
|
*]
|
GroupServerCalls: false
|
}
|
}
|