Quintiq file version 2.0
#parent: #root
Method EnablePattern () id:Method_LibCal_dlgEvent_EnablePattern
{
  #keys: '[131094.0.1374217265]'
  Body:
  [*
    // Enable the controls of the recurrence pattern.
    
    // Toggle-buttons
    btnNoRecurrence.Enabled( true );
    btnWeekly      .Enabled( true );
    btnMonthly     .Enabled( true );
    btnYearly      .Enabled( true );
    
    // Separator
    lblRecurrencePattern.TextColor( Color::WindowText() );
    lblHorizontalLine2  .TextColor( Color::Gray() );
    
    // Daily
    if( btnDaily.Pressed() )
    {
      ckbEvery       .Enabled( true );
      ckbEveryWeekday.Enabled( true );
      
      edtEveryNrOfDays.Enabled( true );
      edtEveryNrOfDays.TextColor( Color::WindowText() );
      lblDays         .TextColor( Color::WindowText() );
    
      // Disable the EditBox again if necessary.
      // It needs to be enabled above first to have the tooltiptext reset.
      if( not ckbEvery.Checked() )
      {
        edtEveryNrOfDays.Enabled( false );
      }
    }
    
    // Weekly
    else if( btnWeekly.Pressed() )
    {
      lblRecurWeekly   .TextColor( Color::WindowText() );
      edtEveryNrOfWeeks.Enabled( true );
      edtEveryNrOfWeeks.TextColor( Color::WindowText() );
      lblWeeks         .TextColor( Color::WindowText() );
    
      lblOn       .TextColor( Color::WindowText() );
      btnMonday   .Enabled( true );
      btnTuesday  .Enabled( true );
      btnWednesday.Enabled( true );
      btnThursday .Enabled( true );
      btnFriday   .Enabled( true );
      btnSaturday .Enabled( true );
      btnSunday   .Enabled( true );
    }
    
    // Monthly
    else if( btnMonthly.Pressed() )
    {
      this.ShowRecurrencePattern( LibCal_RecurrencePattern::TYPE_MONTHLY() );
    }
    
    // Yearly
    else if( btnYearly.Pressed() )
    {
      lblRecurYearly   .TextColor( Color::WindowText() );
      edtEveryNrOfYears.Enabled( true );
      edtEveryNrOfYears.TextColor( Color::WindowText() );
      lblYears         .TextColor( Color::WindowText() );
    
      this.ShowRecurrencePattern( LibCal_RecurrencePattern::TYPE_YEARLY() );
    }
  *]
}
