chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
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
Quintiq file version 2.0
#parent: CustomDrawDataLayerSteps
Response OnDrawObject (
  SWF_Step object
) id:Response_SWF_CustomDrawComponentProcessDashboard_CustomDrawDataLayerSteps_OnDrawObject
{
  #keys: '[113694.2.1118104256]'
  Body:
  [*
    // Draw step info
    //this.Rectangle( region ); // debug
    gp := SWF_WorkflowDataset.GlobalParameter(); 
    surface.TextColor( Color::White() );
    bigfont := FontSpecification::Construct( gp.DashboardFont(), gp.DashboardFontSizeBig() );
    smallfont := FontSpecification::Construct( gp.DashboardFont(), gp.DashboardFontSizeSmall() );
    leftmargin := 60;
    
    surface.Image( 0,
                   [Number]( ( gp.DashboardGaugeHeight() / 2 ) - ( gp.DashboardImageHeight() / 2 ) ),
                   gp.DashboardImageWidth(),
                   gp.DashboardImageHeight(),
                   object.Definition().IconName() );
    
    surface.Font( smallfont );
    
    displayname := SWF_WorkflowDataset::GUI_ProcessDashboard_FormatName( object.Name() );
    
    surface.Text( leftmargin, 20, displayname + ' - ' + SWF_WorkflowDataset::GUI_ProcessDashboard_FormatDateToString( object.DueDate() ) );
    
    if( not object.IsCompleted() and object.HasLateness() )
    {
      surface.TextColor( Color::Color( 255, 97, 55 ) );
    }
    else
    {
      surface.TextColor( Color::Color( 153, 255, 51 ) )
    }
    
    surface.Font( bigfont );
    surface.Text( leftmargin, 40, object.DisplayStatus() )
    surface.Text( leftmargin, 75, SWF_WorkflowDataset::GUI_ProcessDashboard_FormatRealToString( object.CompletionPercentage() ) );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_CustomDrawDataLayer_OnDrawObject'
}