yanweiyuan3
2023-08-09 98db93a55d7079e89c706c18b15eeaecd0ec539a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Quintiq file version 2.0
#parent: #root
Method CreateConditionalTypes (
  internal[Type] roottype,
  internal[Type] excludetype
) id:Method_LibOpt_DialogConditionalTypes_CreateConditionalTypes
{
  #keys: '[143908.0.730126732]'
  Body:
  [*
    // Adds a shadow LibOpt_UIConditionalType for almost every subtype of LibOpt_BreakpointConditional/LibOpt_DatasetCopyConditional into the data holder owner. 
    // The LibOpt_Breakpoint type and all LibOpt_DatasetCopyConditionalNotSelectable subtypes (e.g. LibOpt_DatasetCopyUnconditional) are excluded
    
    owner := Dialog.DataHolderOwner().Data(); 
    
    leaftypes := this.GetLeafTypes( roottype, excludetype );
    
    traverse( leaftypes, Elements, conditionaltype )
    {
      // create a shadow[LibOpt_UIConditionalType] for each leaf. To fill the Name you can use type.Name(). To get the Description you can do type.TypeView().Description().
      uitype := construct( shadow[ LibOpt_UIConditionalType ] );
      uitype.Name( conditionaltype.Name() );
      uitype.Description( conditionaltype.TypeView().Description() );  
      owner.UIConditionalType( relinsert, & uitype );
    }
  *]
}