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
28
29
30
31
Quintiq file version 2.0
#parent: #root
Method SelectConditionalType (
  internal[GUIComponent] parent,
  internal[Type] roottype,
  internal[Type] excludetype
) as shadow[LibOpt_UIConditionalType] id:Method_LibOpt_DialogConditionalTypes_SelectConditionalType
{
  #keys: '[143908.0.730099744]'
  Body:
  [*
    // shows the dialog in a modal way and returns the user-selected conditional type's name
    
    // When the dialog opens, create a new shadow[LibOpt_UIOwner], store it in the dataholder
    owner := construct( shadow[ LibOpt_UIOwner ] );
    Dialog.DataHolderOwner().Data( & owner );
    
    // 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
    this.CreateConditionalTypes( roottype, excludetype );
    
    value := Dialog.DoModal( parent ) > 0;
    selection := null( shadow[ LibOpt_UIConditionalType ] );
    if( value )
    {
      selection := Dialog.DataHolderSelectedType().Data();
    }
    
    return selection;
  *]
}