1111using Eto . Forms ;
1212using Eto . Veldrid ;
1313using geoWrangler ;
14+ using shapeEngine ;
1415using Veldrid ;
1516using VeldridEto ;
1617using PixelFormat = Veldrid . PixelFormat ;
@@ -29,6 +30,7 @@ public partial class MainForm
2930 private VarianceContextGUI varianceContext ;
3031
3132 private Command quitCommand , helpCommand , aboutCommand , clearLayer , copyLayer , pasteLayer , newSim , openSim , revertSim , saveSim , saveAsSim ;
33+ private Command expExpandersCommand , collExpandersCommand ;
3234
3335 private List < string > notList , booleanList ;
3436
@@ -42,10 +44,10 @@ private void setupUIDataContext(List<string> notList_, List<string> booleanList_
4244 DataContext = new UIStringLists
4345 {
4446 subShapeList = commonVars . subshapes ,
45- shapes = commonVars . getAvailableShapes ( ) ,
46- noiseTypeList = commonVars . getNoiseTypes ( ) ,
47- subShapePos = commonVars . getAvailableSubShapePositions ( ) ,
48- tipLocs = commonVars . getAvailableTipsLocations ( ) ,
47+ shapes = ShapeLibrary . getAvailableShapes ( CentralProperties . shapeTable ) ,
48+ noiseTypeList = NoiseC . noiseTypes ,
49+ subShapePos = ShapeSettings . getAvailableSubShapePositions ( ) ,
50+ tipLocs = ShapeSettings . getAvailableTipsLocations ( ) ,
4951 rngTypeList = commonRNG . rngTypes ,
5052 externalTypeList = commonVars . getExternalTypes ( ) ,
5153 externalFilterList = commonVars . getExternalFilterList ( ) ,
@@ -54,7 +56,7 @@ private void setupUIDataContext(List<string> notList_, List<string> booleanList_
5456 openGLMode = commonVars . getOpenGLModeList ( ) ,
5557 notList = notList_ ,
5658 fallOffList = RayCast . fallOffList ,
57- polyFillList = commonVars . getPolyFillTypes ( ) ,
59+ polyFillList = ShapeSettings . getPolyFillTypes ( ) ,
5860 geoCoreStructureList = commonVars . structureList ,
5961 geoCoreLDList = commonVars . activeStructure_LayerDataTypeList ,
6062 geoCoreStructureList_exp = commonVars . structureList_exp ,
@@ -197,6 +199,15 @@ private void loadPrefs()
197199 {
198200 }
199201
202+ try
203+ {
204+ varianceContext . vc . expandUI = Convert . ToBoolean ( prefs . Descendants ( "expandUI" ) . First ( ) . Value ) ;
205+ }
206+ catch ( Exception )
207+ {
208+ }
209+
210+
200211 varianceContext . vc . rngMappingEquations . Clear ( ) ;
201212 varianceContext . vc . rngMappingEquations . Add ( "Box-Muller" ) ;
202213 try
@@ -607,6 +618,8 @@ private void savePrefs()
607618
608619 prefsXML . Root . Add ( new XElement ( "friendlyNumber" , varianceContext . vc . friendlyNumber ) ) ;
609620
621+ prefsXML . Root . Add ( new XElement ( "expandUI" , varianceContext . vc . expandUI ) ) ;
622+
610623 string equationString = "" ;
611624 for ( int i = 0 ; i < commonVars . rngCustomMapping . Count ; i ++ )
612625 {
@@ -833,10 +846,7 @@ private void uiVars()
833846 simulationSettingsGroupBoxHeight = 180 ;
834847 userGuidanceWidth = 395 ;
835848 userGuidanceHeight = simulationOutputGroupBoxHeight + simulationSettingsGroupBoxHeight + 22 ;
836-
837- simButtonWidth = 64 ;
838- simButtonHeight = 55 ;
839-
849+
840850 replayNumWidth = 80 ;
841851
842852 multiThreadWarnWidth = 300 ;
@@ -1588,7 +1598,7 @@ private void setup_tabs()
15881598 tabPage_2D_PASearch_table = new TableLayout ( ) ;
15891599 tabPage_2D_PASearch_scrollable = new Scrollable { Content = tabPage_2D_PASearch_table } ;
15901600
1591- tabPage_2D_PASearch = new TabPage { Text = "PA Search" , Content = tabPage_2D_PASearch_scrollable } ;
1601+ tabPage_2D_PASearch = new TabPage { Text = "Process Assumptions Search" , Content = tabPage_2D_PASearch_scrollable } ;
15921602
15931603
15941604 tabControl_2D_simsettings . Pages . Add ( tabPage_2D_PASearch ) ;
@@ -1597,7 +1607,7 @@ private void setup_tabs()
15971607 private void setup_layout ( )
15981608 {
15991609 // mainPanel is tab UI.
1600- Panel mainPanel = new ( ) { Size = new Size ( 920 , 800 ) , Content = mainTable } ;
1610+ Panel mainPanel = new ( ) { Size = new Size ( 920 , 750 ) , Content = mainTable } ;
16011611 // force the UI out to contain the panel. Hope this will be redundant eventually with the table UI.
16021612 // rightPanel will take viewport and controls.
16031613 Panel rightPanel = new ( ) ;
@@ -1717,14 +1727,21 @@ private void commands()
17171727
17181728 saveAsSim = new Command { MenuText = "Save As" , ToolBarText = "Save As" , Shortcut = Application . Instance . CommonModifier | Keys . Shift | Keys . S } ;
17191729 saveAsSim . Executed += saveAsHandler ;
1730+
1731+ expExpandersCommand = new Command { MenuText = "Unfold All" , ToolBarText = "Unfold All" , Shortcut = Application . Instance . CommonModifier | Keys . Shift | Keys . X } ;
1732+ expExpandersCommand . Executed += expandExpanders ;
1733+
1734+ collExpandersCommand = new Command { MenuText = "Fold All" , ToolBarText = "Fold All" , Shortcut = Application . Instance . CommonModifier | Keys . Shift | Keys . C } ;
1735+ collExpandersCommand . Executed += collapseExpanders ;
17201736
17211737 // create menu
17221738 Menu = new MenuBar
17231739 {
17241740 Items = {
17251741 //File submenu
17261742 new ButtonMenuItem { Text = "&File" , Items = { newSim , openSim , revertSim , saveSim , saveAsSim } } ,
1727- new ButtonMenuItem { Text = "&Edit" , Items = { copyLayer , pasteLayer , clearLayer } }
1743+ new ButtonMenuItem { Text = "&Edit" , Items = { copyLayer , pasteLayer , clearLayer } } ,
1744+ new ButtonMenuItem { Text = "&View" , Items = { expExpandersCommand , collExpandersCommand } } ,
17281745 } ,
17291746 QuitItem = quitCommand ,
17301747 HelpItems = {
@@ -1742,26 +1759,21 @@ private void setup_buttons(TableCell tc)
17421759 tc . Control = TableLayout . AutoSized ( p , centered : true ) ;
17431760
17441761 TableLayout buttons_table = new ( ) ;
1745- p . Content = buttons_table ;
1762+ p . Content = TableLayout . AutoSized ( buttons_table ) ;
17461763 buttons_table . Rows . Add ( new TableRow ( ) ) ;
1747-
1748- btn_singleCPU = new Button { Text = "Single\r \n CPU" } ;
1749- btn_singleCPU . Click += monteCarloSingleThreadEventHandler ;
1750- setSize ( btn_singleCPU , simButtonWidth , simButtonHeight ) ;
1751- // buttons_table.Rows[0].Cells.Add(new TableCell() { Control = btn_singleCPU });
1752-
1753- btn_multiCPU = new Button { Text = "Multi\r \n CPU" } ;
1754- setSize ( btn_multiCPU , simButtonWidth , simButtonHeight ) ;
1755- btn_multiCPU . Click += monteCarloMultipleThreadEventHandler ;
1756- buttons_table . Rows [ 0 ] . Cells . Add ( new TableCell { Control = btn_multiCPU } ) ;
1764+
1765+ btn_Run = new Button { Text = "Run" } ;
1766+ //setSize(btn_Run, simButtonWidth, simButtonHeight);
1767+ btn_Run . Click += monteCarloMultipleThreadEventHandler ;
1768+ buttons_table . Rows [ 0 ] . Cells . Add ( new TableCell { Control = btn_Run } ) ;
17571769
17581770 btn_Cancel = new Button { Text = "Cancel" } ;
1759- setSize ( btn_Cancel , simButtonWidth , simButtonHeight ) ;
1760- btn_Cancel . Click += btnCancel ;
1771+ // setSize(btn_Cancel, simButtonWidth, simButtonHeight);
1772+ // btn_Cancel.Click += btnCancel;
17611773 buttons_table . Rows [ 0 ] . Cells . Add ( new TableCell { Control = btn_Cancel } ) ;
17621774
17631775 btn_STOP = new Button { Text = "STOP" } ;
1764- setSize ( btn_STOP , simButtonWidth , simButtonHeight ) ;
1776+ // setSize(btn_STOP, simButtonWidth, simButtonHeight);
17651777 btn_STOP . Click += btnSTOP ;
17661778 buttons_table . Rows [ 0 ] . Cells . Add ( new TableCell { Control = btn_STOP } ) ;
17671779 }
0 commit comments