| Quintiq file version 2.0 | 
| #parent: #root | 
| Response OnClick ( | 
|   Unit selection | 
| ) id:Response_ListUnitTree_MenuNewUnit_OnClick | 
| { | 
|   #keys: '[113694.2.1040955934]' | 
|   Body: | 
|   [* | 
|     // Create a new child unit | 
|     dlg := construct( DialogCreateEditUnit ); | 
|     unit := dlg.NewUnit( this, selection, GlobalParameters_MP::GetDefaultGridX(), GlobalParameters_MP::GetDefaultGridY() ); | 
|      | 
|     if( not isnull( unit ) ) | 
|     { | 
|       objects := construct( Units ); | 
|       objects.Add( unit ); | 
|       ApplicationLibMacroPlanner.ExpandNavigationSelection( objects ); | 
|     } | 
|   *] | 
|   CanBindMultiple: false | 
|   DefinitionID => /Responsedef_ListUnitTree_Menu_OnClick | 
|   Initiator: 'MenuNewUnit' | 
|   Precondition: | 
|   [* | 
|     return MacroPlan::HasMacroPlan( MacroPlan, feedback ); | 
|   *] | 
| } |