Quintiq file version 2.0
#parent: #root
Method ParseMenu (output owning TG_DO_Container container, Menu component) id:Method_GlobalStateTestGenerator_ParseMenu
{
  #keys: '[142876.9.473925072]'
  Body:
  [*
    name := '';
    title := '';
    formkey := Key::ZeroKey();
    
    if( component.istype( ComponentMenu ) )
    {
      name := component.astype( ComponentMenu ).GetProperty( 'ComponentType' );
      GlobalStateTestGenerator.GetFormProperties( name, title, formkey );
    }
    else
    {
      name := component.Text();
      title := '{TODO_TITLE}'; // TODO
    }
    
    do_form := container.DO_Form( relnew,
                                  FormKey := formkey,
                                  Name := name,
                                  Title := title );
    
    if( formkey <> Key::ZeroKey() )
    {
      info( 'FORM:', name );
      info( '>>>> DO FORM SIZE:', container.DO_Form( relsize ) );
      GlobalStateTestGenerator.ParseForm( do_form, construct( Form, name ) );
    }
    
    traverse( component, SubComponents.astype( Menu ), child )
    {
      this.ParseMenu( &container, child );
    }
  *]
}
