yanweiyuan3
2023-08-09 588bc7829387dfc761cc25f06f77d4c81818bd10
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
32
33
34
35
36
37
Quintiq file version 2.0
#parent: #root
Method New (
  internal[GUIComponent] parent,
  Boolean showhideddloptimizer
) id:Method_DialogCreateEditOptimizerPuzzle_New
{
  #keys: '[146140.0.1633863947]'
  Body:
  [*
    // Create an OptimizerPuzzleWIP, this is a Work In Progress object that the 
    // user modify. This prevent modification on real OptimizerPuzzle, preventing useless
    // changes if the user start to modify OptimizerPuzzle and then cancel.
    // The OptimizerPuzzleWIP is the object that is displayed to the user. The real OptimizerPuzzle
    // is untouched and only changed if the user clicks OK
    
    // Hide ddl and button
    Dialog.ShowHideComponents( showhideddloptimizer );
    
    // Create an optimizerPuzzleWIP
    wip := OptimizerPuzzleWIP::Create( MacroPlan, false );
    
    Dialog.Data( wip );
    
    result := Dialog.DoModal( parent );
    
    if( result > 0 )
    {
      OptimizerPuzzle::Create( MacroPlan, 
                               Dialog.GetOptimizerPuzzleName(),
                               EditorDescription.Text(),
                               false, // IsLastUsed
                               false, // isFromDB
                               wip );
    }
  *]
}