diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2014-12-22 08:08:36 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2014-12-22 08:08:36 +0100 |
| commit | e8b13fbea6cab4f01af769a1246c49c588fa2f3e (patch) | |
| tree | 649f51c9c995c5f0c106ce3c60bc99fd364b1368 /src/GraphicObjects/AnalogMeter.cs | |
| parent | 1753010a7b08f29f425356171f78817dc8c6e7f4 (diff) | |
CompilerServices for EventHandler statements in XML attributes
Improve code formatting
debug
Diffstat (limited to 'src/GraphicObjects/AnalogMeter.cs')
| -rw-r--r-- | src/GraphicObjects/AnalogMeter.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/GraphicObjects/AnalogMeter.cs b/src/GraphicObjects/AnalogMeter.cs new file mode 100644 index 00000000..5ef18090 --- /dev/null +++ b/src/GraphicObjects/AnalogMeter.cs @@ -0,0 +1,41 @@ +using System; +using System.Xml.Serialization; +using System.ComponentModel; +using Cairo; + +namespace go +{ + public class AnalogMeter : NumericControl + { + #region CTOR + public AnalogMeter() : base() + {} + public AnalogMeter(double minimum, double maximum, double step) + : base(minimum,maximum,step) + { + } + #endregion + + #region GraphicObject Overrides + protected override void onDraw (Context gr) + { + base.onDraw (gr); + + Rectangle r = ClientRectangle; + Point m = r.Center; + + double aUnit = Math.PI*2.0 / (Maximum - Minimum); + gr.Translate (m.X, m.Y); + gr.Rotate (Value * aUnit); + gr.Translate (-m.X, -m.Y); + + gr.LineWidth = 2; + gr.Color = Foreground; + gr.MoveTo (m); + gr.LineTo (m.X, 0); + gr.Stroke (); + } + #endregion + } +} + |