Quintiq file version 2.0
#parent: #root
Method EnableDisableChildComponents () id:Method_ScenarioManager_DialogEditAdvancedStrategy_EnableDisableChildComponents
{
  #keys: '[136682.0.1844374627]'
  Body:
  [*
    // Enable disabled components under sliding windows approach
    isslidingwindows := CheckBoxUseSlidingWindowsApproach.Checked();
    lblnrofperiodswindow.Enabled( isslidingwindows );
    EditorNumberOfPeriodsInWindow.Enabled( isslidingwindows );
    lblnrofperiodsperslide.Enabled( isslidingwindows );
    EditorNumberOfPeriodsPerSlide.Enabled( isslidingwindows );
    
    // Set editor value of 0 if empty and hidden (to prevent error)
    if( not isslidingwindows )
    {
      if( EditorNumberOfPeriodsInWindow.Text() = '' )
      {
        EditorNumberOfPeriodsInWindow.Text( '0' );
      }
      if( EditorNumberOfPeriodsPerSlide.Text() = '' )
      {
        EditorNumberOfPeriodsPerSlide.Text( '0' );
      }
    }
    
    ismeta := CheckBoxUseMetaOptimizer.Checked(); 
    overridefirst := CheckBoxMetaOptimizerFirstLevelHasOverride.Checked(); 
    overridelast := CheckBoxMetaOptimizerLastLevelHasOverride.Checked(); 
    CheckBoxMetaOptimizerFirstLevelHasOverride.Enabled( ismeta ); 
    CheckBoxMetaOptimizerLastLevelHasOverride.Enabled( ismeta ); 
    EditorMetaOptimizerFirstLevelOverride.Enabled( ismeta and overridefirst ); 
    lblLabelMetaOptimizerFirstLevelOverride.Enabled( ismeta and overridefirst ); 
    lblLabelMetaOptimizerLastLevelOverride.Enabled( ismeta and overridelast ); 
    CheckBoxMetaOptimizerRunFullPlanPriorToFocus.Enabled( ismeta and overridefirst ); 
    EditorMetaOptimizerLastLevelOverride.Enabled( ismeta and overridelast ); 
    EditorMetaOptimizerMaxNumberOfSecondsAllIterations.Enabled( ismeta );
    lblLabelMetaOptimizerMaxNumberOfSecondsAllIterations.Enabled( ismeta );
    if ( ismeta and guard( [Number] EditorMetaOptimizerMaxNumberOfSecondsAllIterations.Text() = 0, false ) ) 
    {
      EditorMetaOptimizerMaxNumberOfSecondsAllIterations.Text( '999999999' ); // set to large number to avoid confusion
    }
    CheckBoxMetaOptimizerIsCollapseLevel.Enabled( ismeta ); 
    iscollapse := CheckBoxMetaOptimizerIsCollapseLevel.Checked(); 
    EditorMetaOptimizerCollapseLevelWeight.Enabled( ismeta and iscollapse );
  *]
}
