Quintiq file version 2.0
#parent: #root
Method UpdateCheckboxState () id:Method_DialogCreateEditCampaignType_UpdateCheckboxState
{
  #keys: '[143600.0.1231616196]'
  Body:
  [*
    //By checking duration it will default to quantity if nothing is found
    quantitybased := RadioButtonGroupQuantityDuration.BoundValue() = GlobalParameters_MP::GetCampaignTransitionsTypeQuantity();
    durationbased := not quantitybased;
    
    //show/hide durations
    GUIDurationSelectorMinDuration.Visible( durationbased );
    GUIDurationSelectorMinDuration.Duration( ifexpr( durationbased, Dialog.Data().DefaultMinDuration(), Duration::Zero() ) );
    GUIDurationSelectorMaxDuration.Visible( durationbased );
    GUIDurationSelectorMaxDuration.Duration( ifexpr( durationbased, Dialog.Data().DefaultMaxDuration(), Duration::Zero() ) );
    LabelMinDuration.Visible( durationbased );
    CheckBoxDefaultMaxDuration.Visible( durationbased );
    
    //show/hide quantity
    EditorDefaultMinQuantity.Visible( quantitybased );
    EditorDefaultMaxQuantity.Visible( quantitybased );
    LabelMinQuantity.Visible( quantitybased );
    CheckBoxDefaultMaxQuantity.Visible( quantitybased );
    
    //Enable/disable
    EditorDefaultMaxQuantity.Enabled( CheckBoxDefaultMaxQuantity.Checked() );
    GUIDurationSelectorMaxDuration.Enabled( CheckBoxDefaultMaxDuration.Checked() );
  *]
}
