2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
25 InitializeComponent();
33 set { mainForm = value; }
43 public void setSlicingGroups(
int slice, Decimal increment,
int decimalPlaces, Decimal value)
48 XSliceNumericUpDown.Increment = increment;
49 XSliceNumericUpDown.DecimalPlaces = decimalPlaces;
50 XSliceNumericUpDown.Value = value;
53 YSliceNumericUpDown.Increment = increment;
54 YSliceNumericUpDown.DecimalPlaces = decimalPlaces;
55 YSliceNumericUpDown.Value = value;
58 ZSliceNumericUpDown.Increment = increment;
59 ZSliceNumericUpDown.DecimalPlaces = decimalPlaces;
60 ZSliceNumericUpDown.Value = value;
80 XSlider.Maximum = maximum;
81 XSlider.Value = value;
84 YSlider.Maximum = maximum;
85 YSlider.Value = value;
88 ZSlider.Maximum = maximum;
89 ZSlider.Value = value;
99 private void handleSliceNumericUpDown(
object sender, EventArgs e)
106 if (sender == XSliceNumericUpDown)
108 XSlider.Value = Decimal.ToInt32(Decimal.Multiply(XSliceNumericUpDown.Value,
new Decimal(XSlider.Maximum)));
109 GameProperties.Instance.xSliceValue = (float)XSliceNumericUpDown.Value;
112 else if (sender == YSliceNumericUpDown)
114 YSlider.Value = Decimal.ToInt32(Decimal.Multiply(YSliceNumericUpDown.Value,
new Decimal(YSlider.Maximum)));
115 GameProperties.Instance.ySliceValue = (float)YSliceNumericUpDown.Value;
118 else if (sender == ZSliceNumericUpDown)
120 ZSlider.Value = Decimal.ToInt32(Decimal.Multiply(ZSliceNumericUpDown.Value,
new Decimal(ZSlider.Maximum)));
121 GameProperties.Instance.zSliceValue = (float)ZSliceNumericUpDown.Value;
126 mainForm.setSlicingGroups(1, XSliceNumericUpDown.Increment, XSliceNumericUpDown.DecimalPlaces, XSliceNumericUpDown.Value);
127 mainForm.setSlicingGroups(2, YSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, YSliceNumericUpDown.Value);
128 mainForm.setSlicingGroups(3, ZSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, ZSliceNumericUpDown.Value);
129 mainForm.setSlicingGroups(1, XSlider.Maximum, XSlider.Value);
130 mainForm.setSlicingGroups(2, YSlider.Maximum, YSlider.Value);
131 mainForm.setSlicingGroups(3, ZSlider.Maximum, ZSlider.Value);
132 mainForm.updateSliceGroups();
134 if (!GameProperties.Instance.viewMode.Equals(
ViewMode.VolView))
136 mainForm.updateXnaEngineState(
false,
false,
false,
true);
145 private void handleScrollSlider(
object sender, EventArgs e)
147 if (sender == XSlider)
149 Decimal newValue = Decimal.Divide(
new Decimal(XSlider.Value),
new Decimal(XSlider.Maximum));
150 XSliceNumericUpDown.Value = newValue;
151 GameProperties.Instance.xSliceValue = (float)newValue;
154 else if (sender == YSlider)
156 Decimal newValue = Decimal.Divide(
new Decimal(YSlider.Value),
new Decimal(YSlider.Maximum));
157 YSliceNumericUpDown.Value = newValue;
158 GameProperties.Instance.ySliceValue = (float)newValue;
161 else if (sender == ZSlider)
163 Decimal newValue = Decimal.Divide(
new Decimal(ZSlider.Value),
new Decimal(ZSlider.Maximum));
164 ZSliceNumericUpDown.Value = newValue;
165 GameProperties.Instance.zSliceValue = (float)newValue;
170 mainForm.setSlicingGroups(1, XSliceNumericUpDown.Increment, XSliceNumericUpDown.DecimalPlaces, XSliceNumericUpDown.Value);
171 mainForm.setSlicingGroups(2, YSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, YSliceNumericUpDown.Value);
172 mainForm.setSlicingGroups(3, ZSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, ZSliceNumericUpDown.Value);
173 mainForm.setSlicingGroups(1, XSlider.Maximum, XSlider.Value);
174 mainForm.setSlicingGroups(2, YSlider.Maximum, YSlider.Value);
175 mainForm.setSlicingGroups(3, ZSlider.Maximum, ZSlider.Value);
176 mainForm.updateSliceGroups();
178 if (!GameProperties.Instance.viewMode.Equals(
ViewMode.VolView))
180 mainForm.updateXnaEngineState(
false,
false,
false,
true);
189 private void handleSlicingFormOnClosing(
object sender, FormClosingEventArgs e)
191 mainForm.setSlicingGroups(1, XSliceNumericUpDown.Increment, XSliceNumericUpDown.DecimalPlaces, XSliceNumericUpDown.Value);
192 mainForm.setSlicingGroups(2, YSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, YSliceNumericUpDown.Value);
193 mainForm.setSlicingGroups(3, ZSliceNumericUpDown.Increment, YSliceNumericUpDown.DecimalPlaces, ZSliceNumericUpDown.Value);
194 mainForm.setSlicingGroups(1, XSlider.Maximum, XSlider.Value);
195 mainForm.setSlicingGroups(2, YSlider.Maximum, YSlider.Value);
196 mainForm.setSlicingGroups(3, ZSlider.Maximum, ZSlider.Value);
197 mainForm.updateSliceGroups();
198 mainForm.SliceFormOpen =
false;