public HeatLeakVisualizer(SimulatorStub simulator) { InitializeComponent(); this.simulator = simulator; this.materials = simulator.GetMaterials(); this.coolers = simulator.GetCoolers(); simulator.SimulationChangedEvent += new EventHandler(simulator_SimulationChangedEvent); update(); }
public StrutPicker( SimulatorStub simulator ) { InitializeComponent(); Material[] materials = simulator.GetMaterials(); materialsListBox.Items.Clear(); for (int i = 0; i < materials.Length; i++) { materialsListBox.Items.Add(materials[i]); } materialsListBox.SelectedIndex = 0; adjustTrackbar(lengthTrackBar, minStrutLength, maxStrutLength); lengthTrackBar.Value = (int)((maxStrutLength - minStrutLength) / 2 * TRACKBAR_RANGE); lengthTrackBar.TickFrequency = TRACKBAR_RANGE / 10; adjustTrackbar(crossSectionTrackBar, minCrossSection, maxCrossSection); crossSectionTrackBar.Value = (int)((maxCrossSection - minCrossSection) / 2 * TRACKBAR_RANGE); crossSectionTrackBar.TickFrequency = TRACKBAR_RANGE / 10; updatePrice(); this.FormClosing += new FormClosingEventHandler(StrutPicker_FormClosing); }