yanweiyuan3
2023-10-27 d1d15b61dfcf7fd0f800b32359f082cf580ed556
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
Quintiq file version 2.0
#parent: GanttChartUnitCalendar/MenuIsPlannedInfinite
Response OnPopupUpdateUI (
  structured[UnitPeriod] selections
) id:Response_GanttChartUnitCalendar_MenuIsPlannedInfinite_OnPopupUpdateUI
{
  #keys: '[131962.0.9746568]'
  Body:
  [*
    // Update menu text and image
    element := selections.Element( 0 );
    isInfinite := element.IsPlannedInfinite();
    
    text := "&Plan as infinite";
    image := "CLOCK_REFRESH";
    
    if( isInfinite )
    {
      text := "&Plan as finite";
      
      if( element.Unit().HasCapacityTypeTransportBase() )
      {
        image := "TRUCK_RED";  
      }
      else if( element.Unit().HasCapacityTypeTimeBase() )
      {
        image := "CLOCK";
      }
      else if( element.Unit().HasCapacityTypeQuantityBase() )
      {
        image := "WEIGHT";   
      }  
    }
    
    this.Text( text );
    this.SetProperty( "Image", image );
  *]
  CanBindMultiple: false
  DefinitionID => /GanttChartUnitCalendar/Responsedef_GanttChartUnitCalendar_MenuIsPlannedInfinite_OnPopupUpdateUI
}