yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
Quintiq file version 2.0
#parent: pnlNotRecurring/durStartTimeOfDay
Response OnChanged () id:Response_pnlNotRecurring_durStartTimeOfDay_OnChanged
{
  #keys: '[131094.0.629922468]'
  Body:
  [*
    // If not AllDay, adjust the EndTimeOfDay accordingly.
    // When EndTimeOfDay is not changed, UpdateDuration must be done from here.
    updateDuration := true;
    
    if( not ckbIsAllDay.Checked() )
    {
      delta := this.Duration() - vhStartTimeOfDay.Data();
    
      if( delta <> Duration::Zero() )
      {
        endTimeOfDay := durEndTimeOfDay.Duration() + delta;
    
        // Also adjust datEndDate if necessary.    
        datEndDate     .Date(     datEndDate.Date() + endTimeOfDay.Days()                   );
        durEndTimeOfDay.Duration( endTimeOfDay      - Duration::Days( endTimeOfDay.Days() ) );
    
        // Update the 'memory' for later delta-calculation, and/or setting the time back when AllDay is turned off.
        vhStartTimeOfDay.Data( this.Duration() );
        
        updateDuration := false;
      }
    }
    
    if( updateDuration )
    {
      Dialog.UpdateDuration();
    }
    
    // Keep durStartTimeRecurring on the other panel in sync.
    durStartTimeOfDayRecurring.Duration( this.Duration() );
  *]
  CanBindMultiple: false
  DefinitionID: 'Responsedef_GUIDurationSelector_OnChanged'
}