haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
Quintiq file version 2.0
#parent: #root
Method ShowHideNavigationPanelComponents (
  structured[SupplyChainSelection] selections
) id:Method_ApplicationLibMacroPlanner_ShowHideNavigationPanelComponents
{
  #keys: '[113694.2.1025324048]'
  Body:
  [*
    // Toggle show/hide of the components in navigation panel.
    
    ColumnTitlesUnits.Visible( false );
    ColumnTitlesProducts.Visible( false );
    ColumnTitlesSalesSegments.Visible( false );
    ColumnTitlesPeriods.Visible( false );
    
    showentity := counter( selections, Elements, e, e.Name() = SupplyChainSelection::GetStringStockingPointsAndUnits() );
    showproducts := counter( selections, Elements, e, e.Name() = SupplyChainSelection::GetStringProducts() );
    showsalessegments := counter( selections, Elements, e, e.Name() = SupplyChainSelection::GetStringSalesSegments() );
    showperiods := counter( selections, Elements, e, e.Name() = SupplyChainSelection::GetStringPeriods() );
    
    ratio := guard( 100 / selections.Size(), 0 );
    
    /* Sizes of splitter pane has to be set in reverse order according to sequence
       on the navigation panel to avoid resizing of other splitter panes when setting
       the size */
    SplitterPanePeriods.Size( ratio * showperiods );
    SplitterPaneSalesSegment.Size( ratio * showsalessegments );
    SplitterPaneProducts.Size( ratio * showproducts );                                                                            
    SplitterPaneEntities.Size( ratio * showentity );
  *]
}