Quintiq file version 2.0
#parent: #root
Method ShowHideComponentForRadioButtonValue () id:Method_DialogCreateEditInventorySpecification_ShowHideComponentForRadioButtonValue
{
  #keys: '[108486.0.932613536]'
  Body:
  [*
    // Show / hide labels and editor of days and quantity according to current selection of radio buttons.
    
    
    // MinLevelInDays and MinLevelInQuantity
    EditorMinLevelInDays.Visible( [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    LabelMinLevelInDays.Visible( [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    EditorMinLevelInQuantity.Visible( not [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    LabelMinLevelInQuantity.Visible( not [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    
    EditorMinLevelInDays.Enabled( [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    EditorMinLevelInQuantity.Enabled( not [Boolean]RadioButtonGroupMinLevel.BoundValue() );
    
    // MaxLevelInDays and MaxLevelInQuantity
    EditorMaxLevelInDays.Visible( [Boolean]RadioButtonGroupMaxLevel.BoundValue() );
    LabelMaxLevelInDays.Visible( [Boolean]RadioButtonGroupMaxLevel.BoundValue() );
    EditorMaxLevelInQuantity.Visible( not [Boolean]RadioButtonGroupMaxLevel.BoundValue() );
    LabelMaxLevelInQuantity.Visible( not [Boolean]RadioButtonGroupMaxLevel.BoundValue() );
    
    enablemaxlevel := GroupPanelMaxLevel.Enabled() and CheckBoxHasMaxLevel.Checked();
    RadioButtonGroupMaxLevel.Enabled( enablemaxlevel );
    EditorMaxLevelInDays.Enabled( enablemaxlevel and [Boolean] RadioButtonGroupMaxLevel.BoundValue() );
    EditorMaxLevelInQuantity.Enabled( enablemaxlevel and not [Boolean] RadioButtonGroupMaxLevel.BoundValue() );
  *]
}
