limj
2023-10-24 93652435728de839582440eefd5122c281181d35
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Quintiq file version 2.0
#parent: #root
Method ShowAllDay () id:Method_LibCal_dlgEvent_ShowAllDay
{
  #keys: '[131094.0.1104130545]'
  Body:
  [*
    // Show the controls on both pnlIsRecurring and pnlIsNotRecurring according to the state of ckbAllDay.
    if( ckbIsAllDay.Checked() )
    {
      // Store the EndDate before updating the StartTime, otherwise setting the StartTime can already have influenced the EndDate.
      endDate := datEndDate.Date();
      
      // Set to whole day if this is not yet the case.
      if( durStartTimeOfDay.Duration() <> Duration::Zero() )
      {
        durStartTimeOfDay         .Duration( Duration::Zero() );
        durStartTimeOfDayRecurring.Duration( Duration::Zero() );
      }
      
      if( durEndTimeOfDay.Duration() <> Duration::Zero() )
      {
        durEndTimeOfDay         .Duration( Duration::Zero() );
        durEndTimeOfDayRecurring.Duration( Duration::Zero() );
        
        datEndDate.Date( endDate + 1 );
      }
      
      durStartTimeOfDay         .Enabled( false );
      durStartTimeOfDayRecurring.Enabled( false );
      durEndTimeOfDay           .Enabled( false );
      durEndTimeOfDayRecurring  .Enabled( false );
    }
    else
    {
      // Restore original values. These have been captured when they were changed.
      if( durStartTimeOfDay.Duration() <> vhStartTimeOfDay.Data() )
      {
        durStartTimeOfDay         .Duration( vhStartTimeOfDay.Data() );
        durStartTimeOfDayRecurring.Duration( vhStartTimeOfDay.Data() );
      }
      
      if( durEndTimeOfDay.Duration() <> vhEndTimeOfDay.Data() )
      {
        durEndTimeOfDay         .Duration( vhEndTimeOfDay.Data() );
        durEndTimeOfDayRecurring.Duration( vhEndTimeOfDay.Data() );
        
        // During initialization, just take over the value from the DataHolder.
        endDate := datEndDate.Date();
        if( endDate.IsInfinite() )
        {
          endDate := vhEndDate.Data();
        }
        // See if the EndDate must be corrected.
        else if( vhEndTimeOfDay.Data() <> Duration::Zero() )
        {
          endDate := endDate - 1;
        }
        datEndDate.Date( endDate );
      }
    
      durStartTimeOfDay         .Enabled( true );
      durStartTimeOfDayRecurring.Enabled( true );
      durEndTimeOfDay           .Enabled( true );
      durEndTimeOfDayRecurring  .Enabled( true );
    }
  *]
}