private void SetHThermometerDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Rectangular; SetBaseGuageColor(); GaugeLinearScale scale = new GaugeLinearScale(_GaugeControl); scale.Name = "Scale1"; scale.Width = 0.1F; scale.Location = new PointF(.55f, .51f); scale.MinValue = -30; scale.MaxValue = 40; scale.Labels.FormatString = "0°"; scale.MajorTickMarks.Layout.Placement = DisplayPlacement.Near; scale.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Rectangle; scale.MajorTickMarks.Layout.Width = 0.008F; scale.MinPin.Visible = false; scale.MaxPin.Visible = false; scale.MinorTickMarks.Layout.Placement = DisplayPlacement.Near; scale.MinorTickMarks.Layout.Width = 0.016F; GaugeSection section = new GaugeSection(scale); section.Name = "Section1"; section.FillColor.Color1 = Color.SteelBlue; section.FillColor.Color2 = Color.LightCyan; section.FillColor.GradientFillType = GradientFillType.HorizontalCenter; scale.Sections.Add(section); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Width = 0.1F; pointer.Style = PointerStyle.Thermometer; pointer.BulbSize = 0.132F; pointer.BulbOffset = .026F; pointer.FillColor.Color1 = Color.Red; pointer.FillColor.Color2 = Color.Empty; pointer.ThermoBackColor.Color1 = Color.FromArgb(100, 60, 60, 60); pointer.Value = 12; scale.Pointers.Add(pointer); _GaugeControl.LinearScales.Add(scale); scale = new GaugeLinearScale(_GaugeControl); scale.Name = "Scale2"; scale.Width = 0.1F; scale.Location = new PointF(.55f, .51f); scale.MinValue = -22; scale.MaxValue = 104; scale.Labels.FormatString = "0°"; scale.Labels.Layout.Placement = DisplayPlacement.Far; scale.Labels.ShowMaxLabel = false; scale.Labels.ShowMinLabel = false; scale.MinPin.Visible = false; scale.MaxPin.Visible = false; scale.MajorTickMarks.Interval = 20; scale.MajorTickMarks.IntervalOffset = 2; scale.MajorTickMarks.Layout.Placement = DisplayPlacement.Far; scale.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Rectangle; scale.MajorTickMarks.Layout.Width = 0.008F; scale.MinorTickMarks.Interval = 4; scale.MinorTickMarks.IntervalOffset = 2; scale.MinorTickMarks.Layout.Placement = DisplayPlacement.Far; scale.MinorTickMarks.Layout.Width = 0.016F; _GaugeControl.LinearScales.Add(scale); GaugeText text = new GaugeText(_GaugeControl); text.Location = new PointF(.08f, .28f); text.Name = "Text1"; text.Text = "C°"; _GaugeControl.GaugeItems.Add(text); text = new GaugeText(_GaugeControl); text.Location = new PointF(.08f, .73f); text.Name = "Text2"; text.Text = "F°"; _GaugeControl.GaugeItems.Add(text); }
private void SetVerticalDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Rectangular; SetBaseGuageColor(); GaugeLinearScale scale = new GaugeLinearScale(_GaugeControl); scale.Name = "Scale1"; scale.Orientation = Orientation.Vertical; scale.MaxValue = 50; scale.Labels.Layout.ScaleOffset = .03f; scale.MinPin.Visible = false; scale.MaxPin.Visible = false; _GaugeControl.LinearScales.Add(scale); GaugeSection section = new GaugeSection(scale); section.Name = "Section1"; section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple); scale.Sections.Add(section); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Marker; pointer.Placement = DisplayPlacement.Far; pointer.ScaleOffset = .05f; pointer.FillColor = new GradientFillColor(Color.Red); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; Color color1 = Color.FromArgb(100, 60, 60, 60); pointer.ThermoBackColor = new GradientFillColor(color1); pointer.ThermoBackColor.BorderColor = Color.Black; pointer.ThermoBackColor.BorderWidth = 1; scale.Pointers.Add(pointer); }
private void SetC2ScalesDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Circular; SetBaseGuageColor(); GaugeCircularScale scale1 = new GaugeCircularScale(_GaugeControl); scale1.Name = "Scale1"; scale1.Radius = .38f; _GaugeControl.CircularScales.Add(scale1); GaugeSection section = new GaugeSection(scale1); section.Name = "Section1"; section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple); scale1.Sections.Add(section); GaugePointer pointer = new GaugePointer(scale1); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.Length = 0.358F; pointer.FillColor = new GradientFillColor(Color.WhiteSmoke, Color.Red); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.CapFillColor = new GradientFillColor(Color.WhiteSmoke, Color.DimGray, 90); pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; scale1.Pointers.Add(pointer); GaugeCircularScale scale2 = new GaugeCircularScale(_GaugeControl); scale2.Name = "Scale2"; scale2.Radius = .24f; scale2.MaxValue = 200; scale2.MajorTickMarks.Interval = 20; scale2.MaxValue = 200; scale2.MinorTickMarks.Interval = 4; scale2.Name = "Scale2"; scale2.Radius = 0.24F; _GaugeControl.CircularScales.Add(scale2); section = new GaugeSection(scale2); section.Name = "Section1"; section.FillColor.Color1 = Color.CornflowerBlue; section.Name = "Section1"; scale2.Sections.Add(section); }
private void SetCInsetScaleDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Circular; SetBaseGuageColor(); GaugeCircularScale scale1 = new GaugeCircularScale(_GaugeControl); scale1.Name = "Scale1"; scale1.Radius = 0.092F; scale1.Width = 0.139F; scale1.MaxValue = 10; scale1.Labels.Layout.RotateLabel = false; scale1.Labels.Layout.Font = new Font("Microsoft Sans Serif", 18F); GradientFillColor fillColor = new GradientFillColor(Color.White); fillColor.BorderColor = Color.DimGray; fillColor.BorderWidth = 1; scale1.MajorTickMarks.Interval = 1; scale1.MajorTickMarks.Layout.FillColor = fillColor; scale1.MajorTickMarks.Layout.Length = 0.263F; scale1.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Circle; scale1.MajorTickMarks.Layout.Width = 0.263F; scale1.MinorTickMarks.Interval = 0.5; scale1.MinorTickMarks.Layout.FillColor = new GradientFillColor(Color.Black); scale1.MinorTickMarks.Layout.Length = 0.2F; scale1.PivotPoint = new PointF(.50f, .68f); GaugePointer pointer = new GaugePointer(scale1); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.Length = 0.54F; pointer.Width = 0.2F; pointer.Placement = DisplayPlacement.Near; pointer.NeedleStyle = NeedlePointerStyle.Style6; pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; pointer.CapFillColor.Color1 = Color.WhiteSmoke; pointer.CapFillColor.Color2 = Color.Brown; pointer.CapFillColor.GradientFillType = GradientFillType.Center; pointer.CapStyle = NeedlePointerCapStyle.Style1; pointer.CapWidth = 0.4F; pointer.FillColor.BorderColor = Color.DarkSlateGray; pointer.FillColor.BorderWidth = 1; pointer.FillColor.Color1 = Color.Turquoise; scale1.Pointers.Add(pointer); GaugeSection section = new GaugeSection(scale1); section.FillColor.Color1 = Color.CornflowerBlue; section.Name = "Section1"; scale1.Sections.Add(section); _GaugeControl.CircularScales.Add(scale1); GaugeCircularScale scale2 = new GaugeCircularScale(_GaugeControl); scale2.Name = "Scale2"; scale2.Radius = .38f; section = new GaugeSection(scale2); section.Name = "Section1"; section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple); scale2.Sections.Add(section); pointer = new GaugePointer(scale2); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.Length = 0.358F; pointer.FillColor = new GradientFillColor(Color.WhiteSmoke, Color.Red); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.CapFillColor = new GradientFillColor(Color.WhiteSmoke, Color.DimGray, 90); pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; scale2.Pointers.Add(pointer); _GaugeControl.CircularScales.Add(scale2); }
private void InitializeNewLinearScale(GaugeLinearScale scale) { scale.Orientation = GetDefaultOrientation(scale); scale.Name = GetScaleName(scale); GaugeSection section = new GaugeSection(scale); section.Name = GetSectionName(scale); section.FillColor = new GradientFillColor(Color.CornflowerBlue); scale.Sections.Add(section); }
private GaugeLinearScale NewLinearScale(Orientation orientation) { GaugeLinearScale scale = new GaugeLinearScale(_GaugeControl); scale.Orientation = orientation; scale.Name = GetScaleName(scale); scale.MinPin.EndOffset = .028f; scale.MaxPin.EndOffset = .028f; GaugeSection section = new GaugeSection(scale); section.Name = GetSectionName(scale); section.FillColor = new GradientFillColor(Color.CornflowerBlue); scale.Sections.Add(section); return (scale); }
public PostRenderScaleSectionEventArgs(Graphics graphics, GaugeSection section) { _Graphics = graphics; _Section = section; _Bounds = section.Bounds; _StartAngle = section.StartAngle; _SweepAngle = section.SweepAngle; }
private void CopySection(GaugeSection section) { if (_AddButton != null) { _AddButton.PerformClick(); GaugeSectionCollection sc = section.Scale.Sections; GaugeSection clone = sc[sc.Count - 1]; section.CopyToItem(clone); } }
internal void OnSectionExit(GaugePointer pointer, GaugeSection section) { if (SectionLeave != null) SectionLeave(this, new SectionLeaveEventArgs(pointer, section)); }
public PreRenderScaleSectionEventArgs(Graphics graphics, GaugeSection section) : base(graphics, section) { }
internal void OnSectionEnter(GaugePointer pointer, GaugeSection section) { if (SectionEnter != null) SectionEnter(this, new SectionEnterEventArgs(pointer, section)); }
internal void OnPostRenderScaleSection(PaintEventArgs e, GaugeSection section) { if (PostRenderScaleSection != null) { PostRenderScaleSectionEventArgs args = new PostRenderScaleSectionEventArgs(e.Graphics, section); PostRenderScaleSection(this, args); } }
internal bool OnPreRenderScaleSection(PaintEventArgs e, GaugeSection section) { if (PreRenderScaleSection != null) { PreRenderScaleSectionEventArgs args = new PreRenderScaleSectionEventArgs(e.Graphics, section); PreRenderScaleSection(this, args); if (args.Cancel == true) return (true); } return (false); }
private void SetV2ScalesDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Rectangular; SetBaseGuageColor(); GaugeLinearScale scale = new GaugeLinearScale(_GaugeControl); scale.Name = "Scale1"; scale.Orientation = Orientation.Vertical; scale.MaxValue = 50; scale.Width = 0.14F; scale.BorderColor = Color.Gray; scale.BorderWidth = 1; scale.Location = new PointF(.5f, .53f); scale.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Rectangle; scale.MajorTickMarks.Layout.Placement = DisplayPlacement.Near; scale.MajorTickMarks.Layout.Width = 0.047F; scale.MinorTickMarks.Layout.Placement = DisplayPlacement.Near; scale.MaxPin.Visible = false; scale.MinPin.Visible = false; GaugeSection section = new GaugeSection(scale); section.Name = "Section1"; section.FillColor.Color1 = Color.CornflowerBlue; scale.Sections.Add(section); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Bar; pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; pointer.CapFillColor.Color1 = Color.WhiteSmoke; pointer.CapFillColor.Color2 = Color.DimGray; pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.FillColor.Color1 = Color.Red; pointer.Value = 15; scale.Pointers.Add(pointer); _GaugeControl.LinearScales.Add(scale); scale = new GaugeLinearScale(_GaugeControl); scale.Name = "Scale2"; scale.Orientation = Orientation.Vertical; scale.Width = 0.14F; scale.MaxValue = 25; scale.Location = new PointF(.5f, .53f); scale.Labels.Layout.Placement = DisplayPlacement.Far; scale.Labels.Layout.ScaleOffset = 0.054F; scale.MajorTickMarks.Interval = 5; scale.MajorTickMarks.Layout.Width = 0.047F; scale.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Rectangle; scale.MajorTickMarks.Layout.Placement = DisplayPlacement.Far; scale.MinorTickMarks.Interval = 1.25f; scale.MinorTickMarks.Layout.Placement = DisplayPlacement.Far; scale.MaxPin.Visible = false; scale.MinPin.Visible = false; _GaugeControl.LinearScales.Add(scale); }
public SectionEnterEventArgs(GaugePointer pointer, GaugeSection section) { _Pointer = pointer; _Section = section; }
/// <summary> /// Initializes our gauge /// </summary> private void InitGauge() { Frame.Style = GaugeFrameStyle.None; GaugeLinearScale scale = new GaugeLinearScale(); scale.Width = .3f; scale.Size = new SizeF(.7f, .51f); scale.Location = new PointF(.6f, .5f); scale.BorderColor = Color.DimGray; scale.BorderWidth = 1; scale.MinValue = -20; scale.MaxValue = 20; scale.MinPin.Visible = false; scale.MaxPin.Visible = false; scale.Labels.Layout.Font = new Font("Arial", 10); scale.Labels.Layout.AutoSize = false; scale.MajorTickMarks.Layout.Width = .2f; scale.MajorTickMarks.Layout.Length = .2f; scale.MajorTickMarks.Layout.Style = GaugeMarkerStyle.Circle; scale.MajorTickMarks.Layout.FillColor = new GradientFillColor(Color.White); scale.MajorTickMarks.Layout.FillColor.BorderColor = Color.DimGray; scale.MajorTickMarks.Layout.FillColor.BorderWidth = 1; GaugeText text = new GaugeText(); text.AutoSize = false; text.Location = new PointF(.12f, .5f); text.TextAlignment = TextAlignment.MiddleRight; GaugeItems.Add(text); LinearScales.Add(scale); GaugeSection section = new GaugeSection(scale); section.Width = .8f; section.FillColor = new GradientFillColor(Color.Red, Color.Green); scale.Sections.Add(section); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Marker; pointer.MarkerStyle = GaugeMarkerStyle.Triangle; pointer.Placement = DisplayPlacement.Far; pointer.ScaleOffset = .03f; pointer.Width = .3f; pointer.Length = .3f; pointer.Origin = PointerOrigin.Custom; pointer.OriginInterval = 0; pointer.AllowUserChange = true; pointer.ChangeCursor = Cursors.Hand; pointer.FillColor = new GradientFillColor(Color.Yellow); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; scale.Pointers.Add(pointer); }
public SectionLeaveEventArgs(GaugePointer pointer, GaugeSection section) : base(pointer, section) { }
private void InitializeNewCircularScale(GaugeCircularScale scale) { scale.Name = GetScaleName(scale); GaugeSection section = new GaugeSection(scale); section.Name = GetSectionName(scale); section.FillColor = new GradientFillColor(Color.CornflowerBlue); scale.Sections.Add(section); }
private void SetCircularDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Circular; SetBaseGuageColor(); GaugeCircularScale scale = new GaugeCircularScale(_GaugeControl); scale.Name = "Scale1"; scale.Radius = .38f; _GaugeControl.CircularScales.Add(scale); GaugeSection section = new GaugeSection(scale); section.Name = "Section1"; section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple); scale.Sections.Add(section); GaugeRange range = new GaugeRange(scale); range.Name = "Range1"; range.FillColor = new GradientFillColor(Color.Lime, Color.Red); range.FillColor.BorderColor = Color.DimGray; range.FillColor.BorderWidth = 1; range.ScaleOffset = .28f; range.StartValue = 70; scale.Ranges.Add(range); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.Length = 0.358F; pointer.FillColor = new GradientFillColor(Color.WhiteSmoke, Color.Red); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.CapFillColor = new GradientFillColor(Color.WhiteSmoke, Color.DimGray, 90); pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; scale.Pointers.Add(pointer); }
private void InitializeNewSection(GaugeSection section) { section.StartValue = section.Scale.MinValue; section.EndValue = section.Scale.MinValue + (section.Scale.MajorTickMarks.Interval * 2); section.Name = GetSectionName(section.Scale); section.FillColor = new GradientFillColor(Color.Lime); }
private GaugeCircularScale NewCircularScale() { GaugeCircularScale scale = new GaugeCircularScale(_GaugeControl); scale.Name = GetScaleName(scale); GaugeSection section = new GaugeSection(scale); section.Name = GetSectionName(scale); section.FillColor = new GradientFillColor(Color.CornflowerBlue); scale.Sections.Add(section); return (scale); }