using System;
2using System.Collections;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Windows.Forms;
7using Nevron.Editors;
8using Nevron.SmartShapes;
9using Nevron.GraphicsCore;
10using Nevron.Chart;
1112namespace Nevron.Examples.Chart.WinForm
13{
14 /// <summary>
15 /// Summary description for NRadialGaugeIndicatorsUC.
16 /// </summary>
17 public class NRadialGaugeIndicatorsUC : NExampleBaseUC
18 {
19 /// <summary>
20 /// Required designer variable.
21 /// </summary>
22 private System.ComponentModel.Container components =
null;
2324 private Nevron.UI.WinForm.Controls.NGroupBox groupBox2;
25 private Nevron.UI.WinForm.Controls.NComboBox RangeIndicatorOriginModeComboBox;
26 private Nevron.UI.WinForm.Controls.NNumericUpDown RangeIndicatorOriginUpDown;
27 private System.Windows.Forms.Label label3;
28 private System.Windows.Forms.Label label2;
29 private System.Windows.Forms.Label label1;
30 private Nevron.UI.WinForm.Controls.NNumericUpDown RangeIndicatorValueUpDown;
31 private Nevron.UI.WinForm.Controls.NGroupBox groupBox1;
32 private Nevron.UI.WinForm.Controls.NNumericUpDown ValueIndicatorUpDown;
33 private System.Windows.Forms.Label label5;
34 private System.Windows.Forms.Label label4;
35 private Nevron.UI.WinForm.Controls.NComboBox ValueIndicatorShapeComboBox;
36 private System.Windows.Forms.Label label6;
37 private System.Windows.Forms.Label label7;
38 private Nevron.UI.WinForm.Controls.NNumericUpDown BeginAngleUpDown;
39 private Nevron.UI.WinForm.Controls.NNumericUpDown SweepAngleUpDown;
4041 NRadialGaugePanel m_RadialGauge;
42 NRangeIndicator m_Indicator1;
43 NNeedleValueIndicator m_Indicator2;
44 private System.Windows.Forms.Label label8;
45 private Nevron.UI.WinForm.Controls.NButton ShowNeedleEditorButton;
46 private Nevron.UI.WinForm.Controls.NNumericUpDown NeedleWidthUpDown;
47 NNumericDisplayPanel m_NumericDisplay;
4849 public NRadialGaugeIndicatorsUC()
50 {
51 // This call is required by the Windows.Forms Form Designer.
52 InitializeComponent();
53 }
5455 /// <summary>
56 /// Clean up any resources being used.
57 /// </summary>
58 protected override void Dispose(
bool disposing )
59 {
60 if( disposing )
61 {
62 if(components !=
null)
63 {
64 components.Dispose();
65 }
66 }
67 base.Dispose( disposing );
68 }
6970 public override void Initialize()
71 {
72 nChartControl1.Panels.Clear();
7374 // add a header label
75 NLabel header =
new NLabel(
"Radial Gauge Indicators");
76 header.TextStyle.FontStyle =
new NFontStyle(
"Times New Roman", 18, FontStyle.Italic);
77 header.ContentAlignment = ContentAlignment.BottomRight;
78 header.Location =
new NPointL(
new NLength(2, NRelativeUnit.ParentPercentage),
new NLength(2, NRelativeUnit.ParentPercentage));
79 80 nChartControl1.Panels.Add(header);
8182 // create the radial gauge
83 m_RadialGauge =
new NRadialGaugePanel();
84 m_RadialGauge.PaintEffect =
new NGlassEffectStyle();
85 m_RadialGauge.BorderStyle =
new NEdgeBorderStyle(BorderShape.Auto);
86 m_RadialGauge.ContentAlignment = ContentAlignment.MiddleCenter;
87 m_RadialGauge.Location =
new NPointL(
new NLength(50, NRelativeUnit.ParentPercentage),
new NLength(55, NRelativeUnit.ParentPercentage));
88 m_RadialGauge.Size =
new NSizeL(
new NLength(80, NRelativeUnit.ParentPercentage),
new NLength(80, NRelativeUnit.ParentPercentage));
89 m_RadialGauge.BackgroundFillStyle =
new NGradientFillStyle(Color.DarkGray, Color.Black);
9091 // configure scale
92 NGaugeAxis axis = (NGaugeAxis)m_RadialGauge.Axes[0];
93 NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;
9495 scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation);
96 scale.LabelStyle.TextStyle.FontStyle =
new NFontStyle(
"Arial", 12, FontStyle.Bold);
97 scale.LabelStyle.TextStyle.FillStyle =
new NColorFillStyle(Color.White);
98 scale.LabelStyle.Angle =
new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 90);
99 scale.MinorTickCount = 4;
100 scale.RulerStyle.BorderStyle.Width =
new NLength(0);
101 scale.RulerStyle.FillStyle =
new NColorFillStyle(Color.DarkGray);
102103 // add radial gauge indicators
104 m_Indicator1 =
new NRangeIndicator();
105 m_Indicator1.Value = 20;
106 m_Indicator1.FillStyle =
new NGradientFillStyle(Color.Yellow, Color.Red);
107 m_Indicator1.StrokeStyle.Color = Color.DarkBlue;
108 m_Indicator1.EndWidth =
new NLength(-20);
109 m_RadialGauge.Indicators.Add(m_Indicator1);
110111 m_Indicator2 =
new NNeedleValueIndicator();
112 m_Indicator2.Value = 79;
113 m_Indicator2.Shape.FillStyle =
new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red);
114 m_Indicator2.Shape.StrokeStyle.Color = Color.Red;
115 m_RadialGauge.Indicators.Add(m_Indicator2);
116 m_RadialGauge.SweepAngle = 270;
117118 // add radial gauge
119 nChartControl1.Panels.Add(m_RadialGauge);
120121 // create and configure a numeric display attached to the radial gauge
122 m_NumericDisplay =
new NNumericDisplayPanel();
123 m_NumericDisplay.Location =
new NPointL(
new NLength(50, NRelativeUnit.ParentPercentage),
new NLength(70, NRelativeUnit.ParentPercentage));
124 m_NumericDisplay.ContentAlignment = ContentAlignment.TopCenter;
125 m_NumericDisplay.SegmentWidth =
new NLength(2, NGraphicsUnit.Point);
126 m_NumericDisplay.SegmentGap =
new NLength(1, NGraphicsUnit.Point);
127 m_NumericDisplay.CellSize =
new NSizeL(
new NLength(15, NGraphicsUnit.Point),
new NLength(30, NGraphicsUnit.Point));
128 m_NumericDisplay.DecimalCellSize =
new NSizeL(
new NLength(10, NGraphicsUnit.Point),
new NLength(20, NGraphicsUnit.Point));
129 m_NumericDisplay.ShowDecimalSeparator =
false;
130 m_NumericDisplay.CellAlignment = VertAlign.Top;
131 m_NumericDisplay.BackgroundFillStyle =
new NColorFillStyle(Color.DimGray);
132 m_NumericDisplay.LitFillStyle =
new NGradientFillStyle(Color.Lime, Color.Green);
133 m_NumericDisplay.CellCountMode = DisplayCellCountMode.Fixed;
134 m_NumericDisplay.CellCount = 6;
135 m_NumericDisplay.Padding =
new NMarginsL(6, 3, 6, 3);
136 m_RadialGauge.ChildPanels.Add(m_NumericDisplay);
137138 // create a sunken border around the display
139 NEdgeBorderStyle borderStyle =
new NEdgeBorderStyle(BorderShape.RoundedRect);
140 borderStyle.OuterBevelWidth =
new NLength(0);
141 borderStyle.MiddleBevelWidth =
new NLength(0);
142 m_NumericDisplay.BorderStyle = borderStyle;
143144 // init form controls
145 SweepAngleUpDown.Value = (
decimal)m_RadialGauge.SweepAngle;
146 BeginAngleUpDown.Value = (
decimal)m_RadialGauge.BeginAngle;
147148 ValueIndicatorShapeComboBox.FillFromEnum(
typeof(SmartShape1D));
149 ValueIndicatorShapeComboBox.SelectedIndex = (
int)SmartShape1D.Arrow2;
150151 ValueIndicatorUpDown.Value = (
decimal)m_Indicator2.Value;
152 RangeIndicatorValueUpDown.Value = (
decimal)m_Indicator1.Value;
153154 RangeIndicatorOriginModeComboBox.FillFromEnum(
typeof(OriginMode));
155 RangeIndicatorOriginModeComboBox.SelectedIndex = 0;
156157 NeedleWidthUpDown.Value = (
decimal)m_Indicator2.Width.Value;
158 }
159 #region Component Designer generated code ...
160
161 /// <summary>
162 /// Required method for Designer support - do not modify
163 /// the contents of this method with the code editor.
164 /// </summary>
165 private void InitializeComponent()
166 {
167 this.groupBox2 = new Nevron.UI.WinForm.Controls.NGroupBox();
168 this.RangeIndicatorOriginModeComboBox = new Nevron.UI.WinForm.Controls.NComboBox();
169 this.RangeIndicatorOriginUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
170 this.label3 = new System.Windows.Forms.Label();
171 this.label2 = new System.Windows.Forms.Label();
172 this.label1 = new System.Windows.Forms.Label();
173 this.RangeIndicatorValueUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
174 this.groupBox1 = new Nevron.UI.WinForm.Controls.NGroupBox();
175 this.ShowNeedleEditorButton = new Nevron.UI.WinForm.Controls.NButton();
176 this.NeedleWidthUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
177 this.label8 = new System.Windows.Forms.Label();
178 this.ValueIndicatorUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
179 this.ValueIndicatorShapeComboBox = new Nevron.UI.WinForm.Controls.NComboBox();
180 this.label5 = new System.Windows.Forms.Label();
181 this.label4 = new System.Windows.Forms.Label();
182 this.label6 = new System.Windows.Forms.Label();
183 this.label7 = new System.Windows.Forms.Label();
184 this.BeginAngleUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
185 this.SweepAngleUpDown = new Nevron.UI.WinForm.Controls.NNumericUpDown();
186 this.groupBox2.SuspendLayout();
187 ((System.ComponentModel.ISupportInitialize)(this.RangeIndicatorOriginUpDown)).BeginInit();
188 ((System.ComponentModel.ISupportInitialize)(this.RangeIndicatorValueUpDown)).BeginInit();
189 this.groupBox1.SuspendLayout();
190 ((System.ComponentModel.ISupportInitialize)(this.NeedleWidthUpDown)).BeginInit();
191 ((System.ComponentModel.ISupportInitialize)(this.ValueIndicatorUpDown)).BeginInit();
192 ((System.ComponentModel.ISupportInitialize)(this.BeginAngleUpDown)).BeginInit();
193 ((System.ComponentModel.ISupportInitialize)(this.SweepAngleUpDown)).BeginInit();
194 this.SuspendLayout();
195 //
196 // groupBox2
197 //
198 this.groupBox2.Controls.Add(this.RangeIndicatorOriginModeComboBox);
199 this.groupBox2.Controls.Add(this.RangeIndicatorOriginUpDown);
200 this.groupBox2.Controls.Add(this.label3);
201 this.groupBox2.Controls.Add(this.label2);
202 this.groupBox2.Controls.Add(this.label1);
203 this.groupBox2.Controls.Add(this.RangeIndicatorValueUpDown);
204 this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top;
205 this.groupBox2.ImageIndex = 0;
206 this.groupBox2.Location = new System.Drawing.Point(0, 168);
207 this.groupBox2.Name = "groupBox2";
208 this.groupBox2.Size = new System.Drawing.Size(232, 144);
209 this.groupBox2.TabIndex = 5;
210 this.groupBox2.TabStop = false;
211 this.groupBox2.Text = "Range Indicator";
212 //
213 // RangeIndicatorOriginModeComboBox
214 //
215 this.RangeIndicatorOriginModeComboBox.Location = new System.Drawing.Point(95, 56);
216 this.RangeIndicatorOriginModeComboBox.Name = "RangeIndicatorOriginModeComboBox";
217 this.RangeIndicatorOriginModeComboBox.Size = new System.Drawing.Size(121, 21);
218 this.RangeIndicatorOriginModeComboBox.TabIndex = 3;
219 this.RangeIndicatorOriginModeComboBox.Text = "RangeIndicatorOriginModeComboBox";
220 this.RangeIndicatorOriginModeComboBox.SelectedIndexChanged += new System.EventHandler(this.RangeIndicatorOriginModeComboBox_SelectedIndexChanged);
221 //
222 // RangeIndicatorOriginUpDown
223 //
224 this.RangeIndicatorOriginUpDown.Location = new System.Drawing.Point(96, 96);
225 this.RangeIndicatorOriginUpDown.Name = "RangeIndicatorOriginUpDown";
226 this.RangeIndicatorOriginUpDown.Size = new System.Drawing.Size(120, 20);
227 this.RangeIndicatorOriginUpDown.TabIndex = 5;
228 this.RangeIndicatorOriginUpDown.ValueChanged += new System.EventHandler(this.RangeIndicatorOriginUpDown_ValueChanged);
229 //
230 // label3
231 //
232 this.label3.Location = new System.Drawing.Point(8, 100);
233 this.label3.Name = "label3";
234 this.label3.Size = new System.Drawing.Size(40, 16);
235 this.label3.TabIndex = 4;
236 this.label3.Text = "Origin:";
237 this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
238 //
239 // label2
240 //
241 this.label2.Location = new System.Drawing.Point(8, 54);
242 this.label2.Name = "label2";
243 this.label2.Size = new System.Drawing.Size(72, 23);
244 this.label2.TabIndex = 2;
245 this.label2.Text = "Origin Mode:";
246 this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
247 //
248 // label1
249 //
250 this.label1.Location = new System.Drawing.Point(8, 20);
251 this.label1.Name = "label1";
252 this.label1.Size = new System.Drawing.Size(40, 16);
253 this.label1.TabIndex = 0;
254 this.label1.Text = "Value:";
255 this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
256 //
257 // RangeIndicatorValueUpDown
258 //
259 this.RangeIndicatorValueUpDown.Location = new System.Drawing.Point(96, 16);
260 this.RangeIndicatorValueUpDown.Name = "RangeIndicatorValueUpDown";
261 this.RangeIndicatorValueUpDown.Size = new System.Drawing.Size(120, 20);
262 this.RangeIndicatorValueUpDown.TabIndex = 1;
263 this.RangeIndicatorValueUpDown.ValueChanged += new System.EventHandler(this.RangeIndicatorValueUpDown_ValueChanged);
264 //
265 // groupBox1
266 //
267 this.groupBox1.Controls.Add(this.ShowNeedleEditorButton);
268 this.groupBox1.Controls.Add(this.NeedleWidthUpDown);
269 this.groupBox1.Controls.Add(this.label8);
270 this.groupBox1.Controls.Add(this.ValueIndicatorUpDown);
271 this.groupBox1.Controls.Add(this.ValueIndicatorShapeComboBox);
272 this.groupBox1.Controls.Add(this.label5);
273 this.groupBox1.Controls.Add(this.label4);
274 this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top;
275 this.groupBox1.ImageIndex = 0;
276 this.groupBox1.Location = new System.Drawing.Point(0, 0);
277 this.groupBox1.Name = "groupBox1";
278 this.groupBox1.Size = new System.Drawing.Size(232, 168);
279 this.groupBox1.TabIndex = 4;
280 this.groupBox1.TabStop = false;
281 this.groupBox1.Text = "Value Indicator";
282 //
283 // ShowNeedleEditorButton
284 //
285 this.ShowNeedleEditorButton.Location = new System.Drawing.Point(12, 96);
286 this.ShowNeedleEditorButton.Name = "ShowNeedleEditorButton";
287 this.ShowNeedleEditorButton.Size = new System.Drawing.Size(204, 23);
288 this.ShowNeedleEditorButton.TabIndex = 11;
289 this.ShowNeedleEditorButton.Text = "Show Editor...";
290 this.ShowNeedleEditorButton.Click += new System.EventHandler(this.ShowNeedleEditorButton_Click);
291 //
292 // NeedleWidthUpDown
293 //
294 this.NeedleWidthUpDown.Location = new System.Drawing.Point(100, 128);
295 this.NeedleWidthUpDown.Maximum = new System.Decimal(new int[] {
296 60,
297 0,
298 0,
299 0});
300 this.NeedleWidthUpDown.Minimum = new System.Decimal(new int[] {
301 20,
302 0,
303 0,
304 -2147483648});
305 this.NeedleWidthUpDown.Name = "NeedleWidthUpDown";
306 this.NeedleWidthUpDown.Size = new System.Drawing.Size(120, 20);
307 this.NeedleWidthUpDown.TabIndex = 10;
308 this.NeedleWidthUpDown.ValueChanged += new System.EventHandler(this.NeedleWidthUpDown_ValueChanged);
309 //
310 // label8
311 //
312 this.label8.Location = new System.Drawing.Point(12, 128);
313 this.label8.Name = "label8";
314 this.label8.Size = new System.Drawing.Size(48, 23);
315 this.label8.TabIndex = 9;
316 this.label8.Text = "Width: ";
317 this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
318 //
319 // ValueIndicatorUpDown
320 //
321 this.ValueIndicatorUpDown.Location = new System.Drawing.Point(96, 32);
322 this.ValueIndicatorUpDown.Name = "ValueIndicatorUpDown";
323 this.ValueIndicatorUpDown.Size = new System.Drawing.Size(120, 20);
324 this.ValueIndicatorUpDown.TabIndex = 1;
325 this.ValueIndicatorUpDown.ValueChanged += new System.EventHandler(this.ValueIndicatorUpDown_ValueChanged);
326 //
327 // ValueIndicatorShapeComboBox
328 //
329 this.ValueIndicatorShapeComboBox.Location = new System.Drawing.Point(96, 64);
330 this.ValueIndicatorShapeComboBox.Name = "ValueIndicatorShapeComboBox";
331 this.ValueIndicatorShapeComboBox.Size = new System.Drawing.Size(120, 21);
332 this.ValueIndicatorShapeComboBox.TabIndex = 3;
333 this.ValueIndicatorShapeComboBox.Text = "comboBox1";
334 this.ValueIndicatorShapeComboBox.SelectedIndexChanged += new System.EventHandler(this.ValueIndicatorShapeComboBox_SelectedIndexChanged);
335 //
336 // label5
337 //
338 this.label5.Location = new System.Drawing.Point(8, 62);
339 this.label5.Name = "label5";
340 this.label5.Size = new System.Drawing.Size(48, 23);
341 this.label5.TabIndex = 2;
342 this.label5.Text = "Shape:";
343 this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
344 //
345 // label4
346 //
347 this.label4.Location = new System.Drawing.Point(8, 29);
348 this.label4.Name = "label4";
349 this.label4.Size = new System.Drawing.Size(40, 23);
350 this.label4.TabIndex = 0;
351 this.label4.Text = "Value:";
352 this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
353 //
354 // label6
355 //
356 this.label6.Location = new System.Drawing.Point(8, 328);
357 this.label6.Name = "label6";
358 this.label6.Size = new System.Drawing.Size(80, 23);
359 this.label6.TabIndex = 6;
360 this.label6.Text = "Begin Angle:";
361 //
362 // label7
363 //
364 this.label7.Location = new System.Drawing.Point(8, 360);
365 this.label7.Name = "label7";
366 this.label7.Size = new System.Drawing.Size(80, 23);
367 this.label7.TabIndex = 7;
368 this.label7.Text = "Sweep Angle:";
369 //
370 // BeginAngleUpDown
371 //
372 this.BeginAngleUpDown.Location = new System.Drawing.Point(96, 328);
373 this.BeginAngleUpDown.Maximum = new System.Decimal(new int[] {
374 360,
375 0,
376 0,
377 0});
378 this.BeginAngleUpDown.Minimum = new System.Decimal(new int[] {
379 360,
380 0,
381 0,
382 -2147483648});
383 this.BeginAngleUpDown.Name = "BeginAngleUpDown";
384 this.BeginAngleUpDown.Size = new System.Drawing.Size(120, 20);
385 this.BeginAngleUpDown.TabIndex = 8;
386 this.BeginAngleUpDown.ValueChanged += new System.EventHandler(this.BeginAngleUpDown_ValueChanged);
387 //
388 // SweepAngleUpDown
389 //
390 this.SweepAngleUpDown.Location = new System.Drawing.Point(96, 360);
391 this.SweepAngleUpDown.Maximum = new System.Decimal(new int[] {
392 360,
393 0,
394 0,
395 0});
396 this.SweepAngleUpDown.Minimum = new System.Decimal(new int[] {
397 360,
398 0,
399 0,
400 -2147483648});
401 this.SweepAngleUpDown.Name = "SweepAngleUpDown";
402 this.SweepAngleUpDown.Size = new System.Drawing.Size(120, 20);
403 this.SweepAngleUpDown.TabIndex = 9;
404 this.SweepAngleUpDown.ValueChanged += new System.EventHandler(this.SweepAngleUpDown_ValueChanged);
405 //
406 // NRadialGaugeIndicatorsUC
407 //
408 this.Controls.Add(this.SweepAngleUpDown);
409 this.Controls.Add(this.BeginAngleUpDown);
410 this.Controls.Add(this.label7);
411 this.Controls.Add(this.label6);
412 this.Controls.Add(this.groupBox2);
413 this.Controls.Add(this.groupBox1);
414 this.Name = "NRadialGaugeIndicatorsUC";
415 this.Size = new System.Drawing.Size(232, 408);
416 this.groupBox2.ResumeLayout(false);
417 ((System.ComponentModel.ISupportInitialize)(this.RangeIndicatorOriginUpDown)).EndInit();
418 ((System.ComponentModel.ISupportInitialize)(this.RangeIndicatorValueUpDown)).EndInit();
419 this.groupBox1.ResumeLayout(false);
420 ((System.ComponentModel.ISupportInitialize)(this.NeedleWidthUpDown)).EndInit();
421 ((System.ComponentModel.ISupportInitialize)(this.ValueIndicatorUpDown)).EndInit();
422 ((System.ComponentModel.ISupportInitialize)(this.BeginAngleUpDown)).EndInit();
423 ((System.ComponentModel.ISupportInitialize)(this.SweepAngleUpDown)).EndInit();
424 this.ResumeLayout(false);
425
426 }
427 #endregion428429 private void RangeIndicatorOriginModeComboBox_SelectedIndexChanged(
object sender, System.EventArgs e)
430 {
431 m_Indicator1.OriginMode = (OriginMode)RangeIndicatorOriginModeComboBox.SelectedIndex;
432 if (m_Indicator1.OriginMode != OriginMode.Custom)
433 {
434 RangeIndicatorOriginUpDown.Enabled =
false;
435 }
436 else437 {
438 RangeIndicatorOriginUpDown.Enabled =
true;
439 }
440441 nChartControl1.Refresh();
442 }
443444 private void ValueIndicatorUpDown_ValueChanged(
object sender, System.EventArgs e)
445 {
446 m_Indicator2.Value = (
double)ValueIndicatorUpDown.Value;
447 m_NumericDisplay.Value = m_Indicator2.Value;
448 nChartControl1.Refresh();
449 }
450451 private void RangeIndicatorValueUpDown_ValueChanged(
object sender, System.EventArgs e)
452 {
453 m_Indicator1.Value = (
double)RangeIndicatorValueUpDown.Value;
454 nChartControl1.Refresh();
455 }
456457 private void RangeIndicatorOriginUpDown_ValueChanged(
object sender, System.EventArgs e)
458 {
459 m_Indicator1.Origin = (
double)RangeIndicatorOriginUpDown.Value;
460 nChartControl1.Refresh();
461 }
462463 private void BeginAngleUpDown_ValueChanged(
object sender, System.EventArgs e)
464 {
465 m_RadialGauge.BeginAngle = (
float)BeginAngleUpDown.Value;
466 nChartControl1.Refresh();
467 }
468469 private void SweepAngleUpDown_ValueChanged(
object sender, System.EventArgs e)
470 {
471 m_RadialGauge.SweepAngle = (
float)SweepAngleUpDown.Value;
472 nChartControl1.Refresh();
473 }
474475 private void ValueIndicatorShapeComboBox_SelectedIndexChanged(
object sender, System.EventArgs e)
476 {
477 N1DSmartShapeFactory factory =
new N1DSmartShapeFactory(m_Indicator2.Shape.FillStyle, m_Indicator2.Shape.StrokeStyle, m_Indicator2.Shape.ShadowStyle);
478 m_Indicator2.Shape = factory.CreateShape((SmartShape1D)ValueIndicatorShapeComboBox.SelectedIndex);
479 nChartControl1.Refresh();
480 }
481482 private void ShowNeedleEditorButton_Click(
object sender, System.EventArgs e)
483 {
484 NSmartShapeEditorUC editor2 =
new NSmartShapeEditorUC();
485486 NSmartShapesCategory cat =
new NSmartShapesCategory(
"Needle Shapes");
487 N1DSmartShapeFactory factory =
new N1DSmartShapeFactory(m_Indicator2.Shape.FillStyle, m_Indicator2.Shape.StrokeStyle, m_Indicator2.Shape.ShadowStyle);
488489 NSmartShape[] shapes = factory.CreateShapes();
490491 for (
int i = 0; i < shapes.Length; i++)
492 {
493 cat.Add(shapes[i]);
494 }
495496 editor2.PredefinedShapes =
new NSmartShapesCategory[]{cat};
497 editor2.Shape = (NSmartShape)(((ICloneable)m_Indicator2.Shape).Clone());
498499 if (editor2.ShowInHostForm() == DialogResult.OK)
500 {
501 m_Indicator2.Shape = editor2.Shape;
502 nChartControl1.Refresh();
503 }
504505 editor2.Dispose();
506 }
507508 private void NeedleWidthUpDown_ValueChanged(
object sender, System.EventArgs e)
509 {
510 m_Indicator2.Width =
new NLength((
float)NeedleWidthUpDown.Value);
511 nChartControl1.Refresh();
512 }
513 }
514}
515