From 2ecee34ba41874ce199a32b0dd36b700971d6bcc Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 19 Jun 2023 04:42:13 -0700 Subject: [PATCH] fix: build LBIndustrialCtrls and ZedGraph from the SDK folder --- .../LBIndustrialCtrls/AssemblyInfo.cs | 31 - .../Base/LBIndustrialCtrlBase.Designer.cs | 42 -- .../Base/LBIndustrialCtrlBase.cs | 252 -------- .../LBIndustrialCtrls/Base/Renderer.cs | 26 - .../Button/ButtonRenderer.cs | 265 -------- .../Button/LBButton.Designer.cs | 51 -- .../LBIndustrialCtrls/Button/LBButton.cs | 297 --------- .../LBIndustrialCtrls/Button/LBButton.resx | 120 ---- .../LBIndustrialCtrls/Knob/Knob.bmp | Bin 822 -> 0 bytes .../LBIndustrialCtrls/Knob/KnobRenderer.cs | 198 ------ .../LBIndustrialCtrls/Knob/LBKnob.Designer.cs | 53 -- .../LBIndustrialCtrls/Knob/LBKnob.cs | 450 ------------- .../LBIndustrialCtrls/Knob/LBKnob.resx | 120 ---- .../LBIndustrialCtrls.csproj | 176 ----- .../Led/LB7SegmentDisplay.Designer.cs | 51 -- .../Led/LB7SegmentDisplay.cs | 59 -- .../Led/LB7SegmentDisplay.resx | 120 ---- .../Led/LB7SegmentDisplayRenderer.cs | 608 ------------------ .../LBIndustrialCtrls/Led/LBLed.Designer.cs | 56 -- .../LBIndustrialCtrls/Led/LBLed.cs | 216 ------- .../LBIndustrialCtrls/Led/LBLed.resx | 123 ---- .../LBIndustrialCtrls/Led/LedRenderer.cs | 275 -------- .../Meters/LBAnalogMeter.Designer.cs | 46 -- .../LBIndustrialCtrls/Meters/LBAnalogMeter.cs | 256 -------- .../Meters/LBDigitalMeter.Designer.cs | 45 -- .../Meters/LBDigitalMeter.cs | 323 ---------- .../Meters/LBDigitalMeter.resx | 120 ---- .../Meters/LBDigitalMeterRenderer.cs | 68 -- .../Meters/LBMeterThreshold.cs | 165 ----- .../LBIndustrialCtrls/Meters/MeterRenderer.cs | 397 ------------ .../LBIndustrialCtrls/Utils/ColorMng.cs | 62 -- .../LBIndustrialCtrls/Utils/MathFunc.cs | 21 - .../LBIndustrialCtrls_src/TestApp.sln | 31 - .../TestApp/AssemblyInfo.cs | 31 - .../TestApp/MainForm.Designer.cs | 541 ---------------- .../LBIndustrialCtrls_src/TestApp/MainForm.cs | 182 ------ .../TestApp/MainForm.resx | 135 ---- .../LBIndustrialCtrls_src/TestApp/Program.cs | 32 - .../TestApp/TestApp.csproj | 132 ---- .../LBIndustrialCtrls_src/TestApp/app.config | 3 - MidiShapeShifter/MidiShapeShifter.sln | 21 +- .../MidiShapeShifter/MidiShapeShifter.csproj | 12 +- MidiShapeShifter/lib/DependencyInfo.ods | Bin 4105 -> 0 bytes MidiShapeShifter/lib/ZedGraph.dll | Bin 299008 -> 0 bytes .../LBIndustrialCtrls.csproj | 18 +- SDK/ZedGraphs/ZedGraph.csproj | 7 +- 46 files changed, 43 insertions(+), 6194 deletions(-) delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/AssemblyInfo.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/Renderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/ButtonRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/Knob.bmp delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/KnobRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/LBIndustrialCtrls.csproj delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplayRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LedRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeterRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBMeterThreshold.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/MeterRenderer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/ColorMng.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/MathFunc.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp.sln delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/AssemblyInfo.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.Designer.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.resx delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/Program.cs delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/TestApp.csproj delete mode 100644 MidiShapeShifter/LBIndustrialCtrls_src/TestApp/app.config delete mode 100644 MidiShapeShifter/lib/DependencyInfo.ods delete mode 100644 MidiShapeShifter/lib/ZedGraph.dll diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/AssemblyInfo.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/AssemblyInfo.cs deleted file mode 100644 index aecdd25..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/AssemblyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region Using directives - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -#endregion - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LBIndustrialCtrls")] -[assembly: AssemblyDescription(".NET library controls for measure, visualization and commands")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("LBSoft di Bonotto Luca")] -[assembly: AssemblyProduct("LBIndustrialCtrls")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all the values or you can use the default the Revision and -// Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("2.1.0.0")] diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.Designer.cs deleted file mode 100644 index 2a2c381..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.Designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace LBSoft.IndustrialCtrls.Base -{ - partial class LBIndustrialCtrlBase - { - /// - /// Variabile di progettazione necessaria. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Liberare le risorse in uso. - /// - /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario. - protected override void Dispose(bool disposing) - { - // Dispose the renderers - this.DefaultRenderer.Dispose(); - if (this.Renderer != null) - this.Renderer.Dispose(); - - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Codice generato da Progettazione componenti - - /// - /// Metodo necessario per il supporto della finestra di progettazione. Non modificare - /// il contenuto del metodo con l'editor di codice. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - } - - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.cs deleted file mode 100644 index e226af7..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/LBIndustrialCtrlBase.cs +++ /dev/null @@ -1,252 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBIndustrialCtrlBase.cs - * Utente: lucabonotto - * Date: 05/04/2009 - * Time: 13.36 - *-------------------------------------------------------------------------*/ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace LBSoft.IndustrialCtrls.Base -{ - /// - /// Base class for the IndustrialCtrls - /// - public partial class LBIndustrialCtrlBase : UserControl - { - #region (* Constructor *) - public LBIndustrialCtrlBase() - { - InitializeComponent(); - - // Set the styles for drawing - SetStyle(ControlStyles.AllPaintingInWmPaint | - ControlStyles.ResizeRedraw | - ControlStyles.DoubleBuffer | - ControlStyles.SupportsTransparentBackColor, - true); - - // Transparent background - this.BackColor = Color.Transparent; - - // Creation of the default renderer - this._defaultRenderer = CreateDefaultRenderer(); - if (this._defaultRenderer != null) - this._defaultRenderer.Control = this; - } - #endregion - - #region (* Properties *) - /// - /// Default renderer of the control - /// - private ILBRenderer _defaultRenderer = null; - [Browsable(false)] - public ILBRenderer DefaultRenderer - { - get { return this._defaultRenderer; } - } - - /// - /// User defined renderer - /// - private ILBRenderer _renderer = null; - [Browsable(false)] - public ILBRenderer Renderer - { - set - { - // set the renderer - this._renderer = value; - if (this._renderer != null) - { - // Set the control tu the renderer - this._renderer.Control = this; - // Update the renderer - this._renderer.Update(); - } - - // Redraw the renderer - Invalidate(); - } - get { return this._renderer; } - } - #endregion - - #region (* Events delegates *) - /// - /// Font change event - /// - /// - [System.ComponentModel.EditorBrowsableAttribute()] - protected override void OnFontChanged(EventArgs e) - { - // Calculate dimensions - this.CalculateDimensions(); - } - /// - /// SizeChanged event - /// - /// - [System.ComponentModel.EditorBrowsableAttribute()] - protected override void OnSizeChanged(EventArgs e) - { - // Default - base.OnSizeChanged(e); - // Calculate al the data for - // drawing the control - this.CalculateDimensions(); - // Redraw - this.Invalidate(); - } - - /// - /// Resize event - /// - /// - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - // Calculate al the data for - // drawing the control - this.CalculateDimensions(); - // Redraw - this.Invalidate(); - } - /// - /// Paint event - /// - /// - [System.ComponentModel.EditorBrowsableAttribute()] - protected override void OnPaint(PaintEventArgs e) - { - // Rectangle of the control - RectangleF _rc = new RectangleF(0, 0, this.Width, this.Height); - e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; - - // Call the default renderer if the user - // rendere is null - if (this.Renderer == null) - { - this.DefaultRenderer.Draw(e.Graphics); - return; - } - - // Draw with the user renderer - this.Renderer.Draw(e.Graphics); - } - #endregion - - #region (* Virtual method *) - /// - /// Call from the constructor to create the default renderer - /// - /// - protected virtual ILBRenderer CreateDefaultRenderer() - { - return new LBRendererBase(); - } - - /// - /// Calculate the dimensions of the control - /// - protected virtual void CalculateDimensions() - { - this.DefaultRenderer.Update(); - - // Update the data in the renderer - if (this.Renderer != null) - this.Renderer.Update(); - - this.Invalidate(); - } - #endregion - } - - /// - /// Base class for the controls renderer - /// - public class LBRendererBase : ILBRenderer - { - #region (* Constructor *) - public LBRendererBase() - { - } - #endregion - - #region (* IDisposable implementation *) - public void Dispose() - { - this.OnDispose(); - } - #endregion - - #region (* Properties *) - /// - /// Associated control - /// - protected object _control = null; - public object Control - { - set { this._control = value; } - get { return this._control; } - } - #endregion - - #region (* Virtual methods *) - /// - /// Dispose the resource of the object - /// - public virtual void OnDispose() - { - } - - /// - /// Update the renderer - /// - /// - public virtual bool Update() - { - return false; - } - - /// - /// Drawing method - /// - /// - public virtual void Draw(Graphics Gr) - { - // Check the graphics - if (Gr == null) - throw new ArgumentNullException("Gr"); - - // Check the control - Control ctrl = this.Control as Control; - if (ctrl == null) - throw new NullReferenceException("Associated control is not valid"); - - // Default drawing - Rectangle rc = ctrl.Bounds; - - Gr.FillRectangle(Brushes.White, ctrl.Bounds); - Gr.DrawRectangle(Pens.Black, ctrl.Bounds); - - Gr.DrawLine(Pens.Red, - ctrl.Left, - ctrl.Top, - ctrl.Right, - ctrl.Bottom); - - Gr.DrawLine(Pens.Red, - ctrl.Right, - ctrl.Top, - ctrl.Left, - ctrl.Bottom); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/Renderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/Renderer.cs deleted file mode 100644 index 3a0aefc..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Base/Renderer.cs +++ /dev/null @@ -1,26 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: Renderer.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Drawing; - -namespace LBSoft.IndustrialCtrls.Base -{ - /// - /// Renderer interface for all - /// LBSoft.IndustrialCtrls renderer - /// - public interface ILBRenderer : IDisposable - { - object Control - { - set; - get; - } - bool Update (); - void Draw ( Graphics Gr ); - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/ButtonRenderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/ButtonRenderer.cs deleted file mode 100644 index 6241e3c..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/ButtonRenderer.cs +++ /dev/null @@ -1,265 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: ButtonRenderer.cs - * Utente: lucabonotto - * Date: 05/04/2009 - * Time: 13.36 - *-------------------------------------------------------------------------*/ - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using LBSoft.IndustrialCtrls.Utils; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Buttons -{ - /// - /// Base class for the button renderers - /// - public class LBButtonRenderer : LBRendererBase - { - #region (* Variables *) - protected RectangleF rectCtrl; - protected RectangleF rectBody; - protected RectangleF rectText; - protected float drawRatio = 1.0F; - #endregion - - #region (* Constructor *) - public LBButtonRenderer() - { - this.rectCtrl = new RectangleF ( 0, 0, 0, 0 ); - } - #endregion - - #region (* Overrided methods *) - /// - /// Update the rectangles for drawing - /// - /// - public override bool Update() - { - // Check Button object - if ( this.Button == null ) - throw new NullReferenceException ( "Invalid 'Button' object" ); - - // Control rectangle - this.rectCtrl.X = 0; - this.rectCtrl.Y = 0; - this.rectCtrl.Width = this.Button.Width; - this.rectCtrl.Height = this.Button.Height; - - if (this.Button.Style == LBButton.ButtonStyle.Circular) - { - if (rectCtrl.Width < rectCtrl.Height) - rectCtrl.Height = rectCtrl.Width; - else if (rectCtrl.Width > rectCtrl.Height) - rectCtrl.Width = rectCtrl.Height; - - if (rectCtrl.Width < 10) - rectCtrl.Width = 10; - if (rectCtrl.Height < 10) - rectCtrl.Height = 10; - } - - this.rectBody = this.rectCtrl; - this.rectBody.Width -= 1; - this.rectBody.Height -= 1; - - this.rectText = this.rectCtrl; - this.rectText.Width -= 2; - this.rectText.Height -= 2; - - // Calculate ratio - drawRatio = (Math.Min(rectCtrl.Width,rectCtrl.Height)) / 200; - if ( drawRatio == 0.0 ) - drawRatio = 1; - - return true; - } - - /// - /// Draw the button object - /// - /// - public override void Draw ( Graphics Gr ) - { - if ( Gr == null ) - throw new ArgumentNullException ( "Gr", "Invalid Graphics object" ); - - if ( this.Button == null ) - throw new NullReferenceException ( "Invalid 'Button' object" ); - - this.DrawBackground( Gr, this.rectCtrl ); - this.DrawBody ( Gr, this.rectBody ); - this.DrawText ( Gr, this.rectText ); - } - #endregion - - #region (* Properies *) - /// - /// Get the associated button object - /// - public LBButton Button - { - get { return this.Control as LBButton; } - } - #endregion - - #region (* Virtual method *) - /// - /// Draw the background of the control - /// - /// - /// - /// - public virtual bool DrawBackground( Graphics Gr, RectangleF rc ) - { - if ( this.Button == null ) - return false; - - Color c = this.Button.BackColor; - SolidBrush br = new SolidBrush ( c ); - Pen pen = new Pen ( c ); - - Rectangle _rcTmp = new Rectangle(0, 0, this.Button.Width, this.Button.Height ); - Gr.DrawRectangle ( pen, _rcTmp ); - Gr.FillRectangle ( br, rc ); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - /// - /// Draw the body of the control - /// - /// - /// - /// - public virtual bool DrawBody( Graphics Gr, RectangleF rc ) - { - if ( this.Button == null ) - return false; - - Color bodyColor = this.Button.ButtonColor; - Color cDark = LBColorManager.StepColor ( bodyColor, 20 ); - - LinearGradientBrush br1 = new LinearGradientBrush ( rc, - bodyColor, - cDark, - 45 ); - - if ((this.Button.Style == LBButton.ButtonStyle.Circular) || - (this.Button.Style == LBButton.ButtonStyle.Elliptical)) - { - Gr.FillEllipse(br1, rc); - } - else - { - GraphicsPath path = this.RoundedRect(rc, 15F); - Gr.FillPath(br1, path); - path.Dispose(); - } - - if ( this.Button.State == LBButton.ButtonState.Pressed ) - { - RectangleF _rc = rc; - _rc.Inflate ( -15F * this.drawRatio, -15F * drawRatio ); - LinearGradientBrush br2 = new LinearGradientBrush ( _rc, - cDark, - bodyColor, - 45 ); - if ((this.Button.Style == LBButton.ButtonStyle.Circular) || - (this.Button.Style == LBButton.ButtonStyle.Elliptical)) - { - Gr.FillEllipse(br2, _rc); - } - else - { - GraphicsPath path = this.RoundedRect(_rc, 10F); - Gr.FillPath(br2, path); - path.Dispose(); - } - - br2.Dispose(); - } - - br1.Dispose(); - return true; - } - - /// - /// Draw the text of the control - /// - /// - /// - /// - public virtual bool DrawText( Graphics Gr, RectangleF rc ) - { - if ( this.Button == null ) - return false; - - //Draw Strings - Font font = new Font ( this.Button.Font.FontFamily, - this.Button.Font.Size * this.drawRatio, - this.Button.Font.Style ); - - String str = this.Button.Label; - - Color bodyColor = this.Button.ButtonColor; - Color cDark = LBColorManager.StepColor ( bodyColor, 20 ); - - SizeF size = Gr.MeasureString ( str, font ); - - SolidBrush br1 = new SolidBrush ( bodyColor ); - SolidBrush br2 = new SolidBrush ( cDark ); - - Gr.DrawString ( str, - font, - br1, - rc.Left + ( ( rc.Width * 0.5F ) - (float)( size.Width * 0.5F ) ) + (float)( 1 * this.drawRatio ), - rc.Top + ( ( rc.Height * 0.5F ) - (float)( size.Height * 0.5 ) ) + (float)( 1 * this.drawRatio ) ); - - Gr.DrawString ( str, - font, - br2, - rc.Left + ( ( rc.Width * 0.5F ) - (float)( size.Width * 0.5F ) ), - rc.Top + ( ( rc.Height * 0.5F ) - (float)( size.Height * 0.5 ) ) ); - - br1.Dispose(); - br2.Dispose(); - font.Dispose(); - - return false; - } - #endregion - - #region (* Protected Methods *) - protected GraphicsPath RoundedRect(RectangleF rect, float radius) - { - RectangleF baseRect = rect; - float diameter = (radius*this.drawRatio) * 2.0f; - SizeF sizeF = new SizeF(diameter, diameter); - RectangleF arc = new RectangleF(baseRect.Location, sizeF); - GraphicsPath path = new GraphicsPath(); - - // top left arc - path.AddArc(arc, 180, 90); - // top right arc - arc.X = baseRect.Right - diameter; - path.AddArc(arc, 270, 90); - // bottom right arc - arc.Y = baseRect.Bottom - diameter; - path.AddArc(arc, 0, 90); - // bottom left arc - arc.X = baseRect.Left; - path.AddArc(arc, 90, 90); - - path.CloseFigure(); - return path; - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.Designer.cs deleted file mode 100644 index cd229b0..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.Designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 05/04/2008 - * Ora: 13.36 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -namespace LBSoft.IndustrialCtrls.Buttons -{ - partial class LBButton - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the control. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // LBButton - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LBButton"; - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown); - this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMuoseUp); - this.ResumeLayout(false); - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.cs deleted file mode 100644 index a7bb327..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.cs +++ /dev/null @@ -1,297 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBButton.cs - * Utente: lucabonotto - * Date: 05/04/2009 - * Time: 13.36 - *-------------------------------------------------------------------------*/ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Buttons -{ - /// - /// Description of LBButton. - /// - public partial class LBButton : LBIndustrialCtrlBase - { - #region (* Enumeratives *) - /// - /// Button styles - /// - public enum ButtonStyle - { - Circular = 0, - Rectangular = 1, - Elliptical = 2, - } - - /// - /// Button states - /// - public enum ButtonState - { - Normal = 0, - Pressed, - } - #endregion - - #region (* Properties variables *) - private ButtonStyle buttonStyle = ButtonStyle.Circular; - private ButtonState buttonState = ButtonState.Normal; - private Color buttonColor = Color.Red; - private string label = String.Empty; - private bool enableRepeatState = false; - private int startRepeatInterval = 500; - private int repeatInterval = 100; - #endregion - - #region (* Variables *) - private Timer tmrRepeat = null; - #endregion - - #region (* Constructor *) - public LBButton() - { - // Initialization - InitializeComponent(); - - // Properties initialization - this.buttonColor = Color.Red; - this.Size = new Size(50, 50); - - // Timer - this.tmrRepeat = new Timer(); - this.tmrRepeat.Enabled = false; - this.tmrRepeat.Interval = this.startRepeatInterval; - this.tmrRepeat.Tick += this.Timer_Tick; - } - #endregion - - #region (* Overrided methods *) - protected override ILBRenderer CreateDefaultRenderer() - { - return new LBButtonRenderer(); - } - #endregion - - #region (* Properties *) - [ - Category("Button"), - Description("Style of the button") - ] - public ButtonStyle Style - { - set - { - this.buttonStyle = value; - this.CalculateDimensions(); - } - get { return this.buttonStyle; } - } - - [ - Category("Button"), - Description("Color of the body of the button") - ] - public Color ButtonColor - { - get { return buttonColor; } - set - { - buttonColor = value; - Invalidate(); - } - } - - [ - Category("Button"), - Description("Label of the button"), - ] - public string Label - { - get { return this.label; } - set - { - this.label = value; - Invalidate(); - } - } - - [ - Category("Button"), - Description("State of the button") - ] - public ButtonState State - { - set - { - this.buttonState = value; - this.Invalidate(); - } - get { return this.buttonState; } - } - - [ - Category("Button"), - Description("Enable/Disable the repetition of the event if the button is pressed") - ] - public bool RepeatState - { - set { this.enableRepeatState = value; } - get { return this.enableRepeatState; } - } - - [ - Category("Button"), - Description("Interval to wait in ms for start the repetition") - ] - public int StartRepeatInterval - { - set { this.startRepeatInterval = value; } - get { return this.startRepeatInterval; } - } - - [ - Category("Button"), - Description("Interva in ms for the repetition") - ] - public int RepeatInterval - { - set { this.repeatInterval = value; } - get { return this.repeatInterval; } - } - #endregion - - #region (* Events delegates *) - /// - /// Timer event - /// - /// - /// - void Timer_Tick(object sender, EventArgs e) - { - this.tmrRepeat.Enabled = false; - - // Update the interval - if (tmrRepeat.Interval == this.startRepeatInterval) - this.tmrRepeat.Interval = this.repeatInterval; - - // Call the delagate - LBButtonEventArgs ev = new LBButtonEventArgs(); - ev.State = this.State; - this.OnButtonRepeatState(ev); - - this.tmrRepeat.Enabled = true; - } - - /// - /// Mouse down event - /// - /// - /// - void OnMouseDown(object sender, MouseEventArgs e) - { - // Change the state - this.State = ButtonState.Pressed; - this.Invalidate(); - - // Call the delagates - LBButtonEventArgs ev = new LBButtonEventArgs(); - ev.State = this.State; - this.OnButtonChangeState ( ev ); - - // Enable the repeat timer - if (this.RepeatState != false) - { - this.tmrRepeat.Interval = this.StartRepeatInterval; - this.tmrRepeat.Enabled = true; - } - } - - /// - /// Mouse up event - /// - /// - /// - void OnMuoseUp(object sender, MouseEventArgs e) - { - // Change the state - this.State = ButtonState.Normal; - this.Invalidate(); - - // Call the delagates - LBButtonEventArgs ev = new LBButtonEventArgs(); - ev.State = this.State; - this.OnButtonChangeState ( ev ); - - // Disable the timer - this.tmrRepeat.Enabled = false; - } - #endregion - - #region (* Fire events *) - /// - /// Event for the state changed - /// - public event ButtonChangeState ButtonChangeState; - - /// - /// Method for call the delagetes - /// - /// - protected virtual void OnButtonChangeState( LBButtonEventArgs e ) - { - if( this.ButtonChangeState != null ) - this.ButtonChangeState( this, e ); - } - - /// - /// Event for the repetition of state - /// - public event ButtonRepeatState ButtonRepeatState; - - /// - /// Method for call the delagetes - /// - /// - protected virtual void OnButtonRepeatState(LBButtonEventArgs e) - { - if (this.ButtonRepeatState != null) - this.ButtonRepeatState(this, e); - } - #endregion - } - - #region (* Classes for event and event delagates args *) - - #region (* Event args class *) - /// - /// Class for events delegates - /// - public class LBButtonEventArgs : EventArgs - { - private LBButton.ButtonState state; - - public LBButtonEventArgs() - { - } - - public LBButton.ButtonState State - { - get { return this.state; } - set { this.state = value; } - } - } - #endregion - - #region (* Delegates *) - public delegate void ButtonChangeState ( object sender, LBButtonEventArgs e ); - public delegate void ButtonRepeatState ( object sender, LBButtonEventArgs e ); - #endregion - - #endregion -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.resx b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.resx deleted file mode 100644 index 7080a7d..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Button/LBButton.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/Knob.bmp b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/Knob.bmp deleted file mode 100644 index 94a36c59404c9fc9a1e91469fea0f6d846648367..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 822 zcmb7C%Wo2K5XN})V&cUk2S^AOkw+F-Xty9BZ+R@Q@G2$^N@CDL!D_2eND=J`i^8I| zyQNJVc`OTfXtkR7k2zt zP4IZ%7i=<_jK|~AXfzlM`u#pchG8JHK$%0xlO$QI)zay--|u(3-N|IKSS%6*LDTe{ zH$_mn*uHN9*nO5zN3!jwm{t z?>HO|trk_QR6xErHJA!P)TkDX#-jWCb!IeT`HkkqMs_a}i9jj6UJtapQv;z|tws<8 z$MM~Ab;!*49~xJ=+_uZ*3WY*WrxU|4rBVqBXrfZ7SpJ)0c{rT$KM|K(TQ#588;{2m ziGYUpTJb=$%`<3cdD)q!- zd0;jfEf$O2W;2>hejHCdPPd3ox7*|P4**`v!N - /// Base class for the renderers of the knob - /// - public class LBKnobRenderer : LBRendererBase - { - #region (* Variables *) - private RectangleF drawRect; - private RectangleF rectScale; - private RectangleF rectKnob; - private PointF knobCenter; - private PointF knobIndicatorPos; - private float drawRatio; - #endregion - - #region (* Properies *) - public LBKnob Knob - { - get { return this.Control as LBKnob; } - } - #endregion - - #region (* Overrided method *) - public override bool Update() - { - // Check Button object - if (this.Knob == null) - throw new NullReferenceException("Invalid 'Knob' object"); - - // Rectangle - float x, y, w, h; - x = 0; - y = 0; - w = this.Knob.Size.Width; - h = this.Knob.Size.Height; - - // Calculate ratio - drawRatio = (Math.Min(w, h)) / 200; - if (drawRatio == 0.0) - drawRatio = 1; - - // Draw rectangle - drawRect.X = x; - drawRect.Y = y; - drawRect.Width = w - 2; - drawRect.Height = h - 2; - - if (w < h) - drawRect.Height = w; - else if (w > h) - drawRect.Width = h; - - if (drawRect.Width < 10) - drawRect.Width = 10; - if (drawRect.Height < 10) - drawRect.Height = 10; - - this.rectScale = this.drawRect; - this.rectKnob = this.drawRect; - this.rectKnob.Inflate(-20 * this.drawRatio, -20 * this.drawRatio); - - this.knobCenter.X = this.rectKnob.Left + (this.rectKnob.Width * 0.5F); - this.knobCenter.Y = this.rectKnob.Top + (this.rectKnob.Height * 0.5F); - - this.knobIndicatorPos = this.Knob.GetPositionFromValue(this.Knob.Value); - - this.Knob.KnobRect = this.rectKnob; - this.Knob.KnobCenter = this.knobCenter; - this.Knob.DrawRatio = this.drawRatio; - return true; - } - - public override void Draw(Graphics Gr) - { - if (Gr == null) - throw new ArgumentNullException("Gr"); - - LBKnob ctrl = this.Knob; - if (ctrl == null) - throw new NullReferenceException("Associated control is not valid"); - - this.DrawBackground(Gr, ctrl.Bounds); - this.DrawScale(Gr, this.rectScale); - this.DrawKnob(Gr, this.rectKnob); - this.DrawKnobIndicator(Gr, this.rectKnob, this.knobIndicatorPos); - } - #endregion - - #region (* Virtual method *) - /// - /// Draw the background of the control - /// - /// - /// - /// - public virtual bool DrawBackground( Graphics Gr, RectangleF rc ) - { - if ( this.Knob == null ) - return false; - - Color c = this.Knob.BackColor; - SolidBrush br = new SolidBrush ( c ); - Pen pen = new Pen ( c ); - - Rectangle _rcTmp = new Rectangle(0, 0, this.Knob.Width, this.Knob.Height ); - Gr.DrawRectangle ( pen, _rcTmp ); - Gr.FillRectangle ( br, rc ); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - /// - /// Draw the scale of the control - /// - /// - /// - /// - public virtual bool DrawScale( Graphics Gr, RectangleF rc ) - { - if ( this.Knob == null ) - return false; - - Color cKnob = this.Knob.ScaleColor; - Color cKnobDark = LBColorManager.StepColor ( cKnob, 60 ); - - LinearGradientBrush br = new LinearGradientBrush ( rc, cKnobDark, cKnob, 45 ); - - Gr.FillEllipse ( br, rc ); - - br.Dispose(); - - return true; - } - - /// - /// Draw the knob of the control - /// - /// - /// - /// - public virtual bool DrawKnob( Graphics Gr, RectangleF rc ) - { - if ( this.Knob == null ) - return false; - - Color cKnob = this.Knob.KnobColor; - Color cKnobDark = LBColorManager.StepColor ( cKnob, 60 ); - - LinearGradientBrush br = new LinearGradientBrush ( rc, cKnob, cKnobDark, 45 ); - - Gr.FillEllipse ( br, rc ); - - br.Dispose(); - - return true; - } - - public virtual bool DrawKnobIndicator( Graphics Gr, RectangleF rc, PointF pos ) - { - if ( this.Knob == null ) - return false; - - RectangleF _rc = rc; - _rc.X = pos.X - 4; - _rc.Y = pos.Y - 4; - _rc.Width = 8; - _rc.Height = 8; - - Color cKnob = this.Knob.IndicatorColor; - Color cKnobDark = LBColorManager.StepColor ( cKnob, 60 ); - - LinearGradientBrush br = new LinearGradientBrush ( _rc, cKnobDark, cKnob, 45 ); - - Gr.FillEllipse ( br, _rc ); - - br.Dispose(); - - return true; - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.Designer.cs deleted file mode 100644 index 4d1d2f0..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.Designer.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 05/04/2008 - * Ora: 13.35 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -namespace LBSoft.IndustrialCtrls.Knobs -{ - partial class LBKnob - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the control. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // LBKnob - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LBKnob"; - this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.OnMouseDown); - this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove); - this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.OnMouseUp); - this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyDown); - this.ResumeLayout(false); - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.cs deleted file mode 100644 index 68556e4..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.cs +++ /dev/null @@ -1,450 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBKnob.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Knobs -{ - /// - /// Description of LBKnob. - /// - public partial class LBKnob : LBIndustrialCtrlBase - { - #region *( Enumerators *) - public enum KnobStyle - { - Circular = 0, - } - #endregion - - #region (* Properties variables *) - private float minValue = 0.0F; - private float maxValue = 1.0F; - private float stepValue = 0.1F; - private float currValue = 0.0F; - private RectangleF knobRect = RectangleF.Empty; - private PointF knobCenter = PointF.Empty; - private KnobStyle style = KnobStyle.Circular; - private Color scaleColor = Color.Green; - private Color knobColor = Color.Black ; - private Color indicatorColor = Color.Red; - private float indicatorOffset = 10F; - private float drawRatio = 1F; - #endregion - - #region (* Class variables *) - private bool isKnobRotating = false; - #endregion - - #region (* Constructor *) - public LBKnob() - { - InitializeComponent(); - - this.CalculateDimensions(); - } - #endregion - - #region (* Properties *) - [ - Category("Knob"), - Description("Minimum value of the knob") - ] - public float MinValue - { - set - { - this.minValue = value; - this.Invalidate(); - } - get { return this.minValue; } - } - - [ - Category("Knob"), - Description("Maximum value of the knob") - ] - public float MaxValue - { - set - { - this.maxValue = value; - this.Invalidate(); - } - get { return this.maxValue; } - } - - [ - Category("Knob"), - Description("Step value of the knob") - ] - public float StepValue - { - set - { - this.stepValue = value; - this.Invalidate(); - } - get { return this.stepValue; } - } - - [ - Category("Knob"), - Description("Current value of the knob") - ] - public float Value - { - set - { - if ( value != this.currValue ) - { - this.currValue = value; - this.CalculateDimensions(); - this.Invalidate(); - - LBKnobEventArgs e = new LBKnobEventArgs(); - e.Value = this.currValue; - this.OnKnobChangeValue( e ); - } - } - get { return this.currValue; } - } - - [ - Category("Knob"), - Description("Style of the knob") - ] - public KnobStyle Style - { - set - { - this.style = value; - this.Invalidate(); - } - get { return this.style; } - } - - [ - Category("Knob"), - Description("Color of the knob") - ] - public Color KnobColor - { - set - { - this.knobColor = value; - this.Invalidate(); - } - get { return this.knobColor; } - } - - [ - Category("Knob"), - Description("Color of the scale") - ] - public Color ScaleColor - { - set - { - this.scaleColor = value; - this.Invalidate(); - } - get { return this.scaleColor; } - } - - [ - Category("Knob"), - Description("Color of the indicator") - ] - public Color IndicatorColor - { - set - { - this.indicatorColor = value; - this.Invalidate(); - } - get { return this.indicatorColor; } - } - - [ - Category("Knob"), - Description("Offset of the indicator from the kob border") - ] - public float IndicatorOffset - { - set - { - this.indicatorOffset = value; - this.CalculateDimensions(); - this.Invalidate(); - } - get { return this.indicatorOffset; } - } - - [Browsable(false)] - public PointF KnobCenter - { - set { this.knobCenter = value; } - get { return this.knobCenter; } - } - - [Browsable(false)] - public RectangleF KnobRect - { - set { this.knobRect = value; } - get { return this.knobRect; } - } - - [Browsable(false)] - public float DrawRatio - { - set { this.drawRatio = value; } - get { return this.drawRatio; } - } - #endregion - - #region (* Events delegates *) - - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - { - bool blResult = true; - - /// - /// Specified WM_KEYDOWN enumeration value. - /// - const int WM_KEYDOWN = 0x0100; - - /// - /// Specified WM_SYSKEYDOWN enumeration value. - /// - const int WM_SYSKEYDOWN = 0x0104; - - float val = this.Value; - - if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) - { - switch(keyData) - { - case Keys.Up: - val += this.StepValue; - if ( val <= this.MaxValue ) - this.Value = val; - break; - - case Keys.Down: - val -= this.StepValue; - if ( val >= this.MinValue ) - this.Value = val; - break; - - case Keys.PageUp: - if ( val < this.MaxValue ) - { - val += ( this.StepValue * 10 ); - this.Value = val; - } - break; - - case Keys.PageDown: - if ( val > this.MinValue ) - { - val -= ( this.StepValue * 10 ); - this.Value = val; - } - break; - - case Keys.Home: - this.Value = this.MinValue; - break; - - case Keys.End: - this.Value = this.MaxValue; - break; - - default: - blResult = base.ProcessCmdKey(ref msg,keyData); - break; - } - } - - return blResult; - } - - [System.ComponentModel.EditorBrowsableAttribute()] - protected override void OnClick(EventArgs e) - { - this.Focus(); - this.Invalidate(); - base.OnClick(e); - } - - void OnMouseUp(object sender, MouseEventArgs e) - { - this.isKnobRotating = false; - - if (this.knobRect.Contains(e.Location) == false) - return; - - float val = this.GetValueFromPosition ( e.Location ); - if ( val != this.Value ) - { - this.Value = val; - this.Invalidate(); - } - } - - void OnMouseDown(object sender, MouseEventArgs e) - { - if (this.knobRect.Contains(e.Location) == false) - return; - - this.isKnobRotating = true; - - this.Focus(); - } - - void OnMouseMove(object sender, MouseEventArgs e) - { - if ( this.isKnobRotating == false ) - return; - - float val = this.GetValueFromPosition ( e.Location ); - if ( val != this.Value ) - { - this.Value = val; - this.Invalidate (); - } - } - - void OnKeyDown(object sender, KeyEventArgs e) - { - float val = this.Value; - - switch ( e.KeyCode ) - { - case Keys.Up: - val = this.Value + this.StepValue; - break; - - case Keys.Down: - val = this.Value - this.StepValue; - break; - } - - if ( val < this.MinValue ) - val = this.MinValue; - - if ( val > this.MaxValue ) - val = this.MaxValue; - - this.Value = val; - } - #endregion - - #region (* Virtual methods *) - public virtual float GetValueFromPosition ( PointF position ) - { - float degree = 0.0F; - float v = 0.0F; - - PointF center = this.KnobCenter; - - if ( position.X <= center.X ) - { - degree = (center.Y - position.Y ) / (center.X - position.X ); - degree = (float)Math.Atan(degree); - degree = (float)((degree) * (180F / Math.PI) + 45F); - v = (degree * ( this.MaxValue - this.MinValue )/ 270F); - } - else - { - if ( position.X > center.X ) - { - degree = (position.Y - center.Y ) / (position.X - center.X ); - degree = (float)Math.Atan(degree); - degree = (float)(225F + (degree) * (180F / Math.PI)); - v = (degree * ( this.MaxValue - this.MinValue ) / 270F); - } - } - - if ( v > this.MaxValue ) - v = this.MaxValue; - - if (v < this.MinValue ) - v = this.MinValue; - - return v; - } - - public virtual PointF GetPositionFromValue ( float val ) - { - PointF pos = new PointF( 0.0F, 0.0F ); - - // Elimina la divisione per 0 - if ( ( this.MaxValue - this.MinValue ) == 0 ) - return pos; - - float _indicatorOffset = this.IndicatorOffset * this.drawRatio; - - float degree = 270F * val / ( this.MaxValue - this.MinValue ); - degree = (degree + 135F) * (float)Math.PI / 180F; - - pos.X = (int)(Math.Cos(degree) * ((this.knobRect.Width * 0.5F) - indicatorOffset) + this.knobRect.X + (this.knobRect.Width * 0.5F)); - pos.Y = (int)(Math.Sin(degree) * ((this.knobRect.Width * 0.5F) - indicatorOffset) + this.knobRect.Y + (this.knobRect.Height * 0.5F)); - - return pos; - } - #endregion - - #region (* Fire events *) - public event KnobChangeValue KnobChangeValue; - protected virtual void OnKnobChangeValue( LBKnobEventArgs e ) - { - if( this.KnobChangeValue != null ) - this.KnobChangeValue( this, e ); - } - #endregion - - #region (* Overrided method *) - protected override ILBRenderer CreateDefaultRenderer() - { - return new LBKnobRenderer(); - } - #endregion - } - - #region (* Classes for event and event delagates args *) - - #region (* Event args class *) - /// - /// Class for events delegates - /// - public class LBKnobEventArgs : EventArgs - { - private float val; - - public LBKnobEventArgs() - { - } - - public float Value - { - get { return this.val; } - set { this.val = value; } - } - } - #endregion - - #region (* Delegates *) - public delegate void KnobChangeValue ( object sender, LBKnobEventArgs e ); - #endregion - - #endregion -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.resx b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.resx deleted file mode 100644 index 7080a7d..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Knob/LBKnob.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/LBIndustrialCtrls.csproj b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/LBIndustrialCtrls.csproj deleted file mode 100644 index f53dc4f..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/LBIndustrialCtrls.csproj +++ /dev/null @@ -1,176 +0,0 @@ - - - {B4218BC9-9736-42B9-BC99-7903FDBEBA28} - Debug - AnyCPU - Library - LBIndustrialCtrls - LBIndustrialCtrls - False - False - 4 - false - - - - - 3.5 - v4.5.2 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - bin\Debug\ - true - Full - False - True - DEBUG;TRACE - - - bin\Release\ - False - None - True - False - TRACE - - - False - Auto - 4194304 - AnyCPU - 4096 - - - MinimumRecommendedRules.ruleset - false - - - MinimumRecommendedRules.ruleset - false - - - true - - - - - - - - - - - - UserControl - - - LBIndustrialCtrlBase.cs - - - - UserControl - - - LBButton.cs - - - - - UserControl - - - - UserControl - - - LBLed.cs - - - - UserControl - - - LB7SegmentDisplay.cs - - - - UserControl - - - - UserControl - - - LBDigitalMeter.cs - - - - - - - - LBButton.cs - - - LBKnob.cs - - - LBLed.cs - - - LB7SegmentDisplay.cs - - - LBDigitalMeter.cs - - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.Designer.cs deleted file mode 100644 index df31d58..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.Designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 26/03/2009 - * Ora: 10.42 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -namespace LBSoft.IndustrialCtrls.Leds - -{ - partial class LB7SegmentDisplay - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the control. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // LB7SegmentDisplay - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LB7SegmentDisplay"; - this.Size = new System.Drawing.Size(44, 65); - this.ResumeLayout(false); - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.cs deleted file mode 100644 index 7988a1c..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.cs +++ /dev/null @@ -1,59 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBLed.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Collections; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Leds -{ - /// - /// Description of LB7SegmentDisplay. - /// - public partial class LB7SegmentDisplay : LBIndustrialCtrlBase - { - #region (* Constructor *) - public LB7SegmentDisplay() - { - InitializeComponent(); - } - #endregion - - #region (* Properties *) - public int val = 0; - [ - Category("Display"), - Description("Value of the display") - ] - public int Value - { - set { this.val = value; this.Invalidate(); } - get { return this.val; } - } - - private bool showDp = false; - [ - Category("Display"), - Description("Show the point of the display") - ] - public bool ShowDP - { - set { this.showDp = value; this.Invalidate(); } - get { return this.showDp; } - } - #endregion - - #region (* Overrided methods *) - protected override ILBRenderer CreateDefaultRenderer() - { - return new LB7SegmentDisplayRenderer(); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.resx b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.resx deleted file mode 100644 index 7080a7d..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplay.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplayRenderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplayRenderer.cs deleted file mode 100644 index dc7f060..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LB7SegmentDisplayRenderer.cs +++ /dev/null @@ -1,608 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBLed.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -using LBSoft.IndustrialCtrls.Utils; - -namespace LBSoft.IndustrialCtrls.Leds -{ - /// - /// Description of LB7SegmentDisplayRenderer. - /// - public class LB7SegmentDisplayRenderer : LBRendererBase - { - #region (* Constants *) - public const int WIDTH_PIXEL = 11; - public const int HEIGHT_PIXELS = 18; - #endregion - - #region (* Variables *) - /// - /// Segments data array - /// - protected SegmentDictionary segments = new SegmentDictionary(); - /// - /// Defaults points coordinates - /// - protected PointsList defPoints = new PointsList(); - /// - /// List of the points coordinates - /// - protected PointsList points = new PointsList(); - /// - /// Segments list of a value - /// - protected SegmentsValueDictionary valuesSegments = new SegmentsValueDictionary(); - /// - /// Rectangle of the dp - /// - protected RectangleF rectDP = new RectangleF(); - #endregion - - #region (* Contructor *) - public LB7SegmentDisplayRenderer() - { - this.CreateSegmetsData(); - this.CreateDefPointsCoordinates(); - this.CreateSegmentsValuesList(); - this.UpdatePointsCoordinates(); - } - #endregion - - #region (* Overrided methods *) - public override bool Update() - { - this.UpdatePointsCoordinates(); - return true; - } - - public override void Draw(Graphics Gr) - { - if (Gr == null) - throw new ArgumentNullException("Gr"); - - LB7SegmentDisplay ctrl = this.Display; - if (ctrl == null) - throw new NullReferenceException("Associated control is not valid"); - - RectangleF _rc = new RectangleF(0, 0, ctrl.Width, ctrl.Height); - Gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; - - this.DrawBackground(Gr, _rc); - this.DrawOffSegments(Gr, _rc); - this.DrawValue(Gr, _rc); - } - #endregion - - #region (* Properies *) - [Browsable(false)] - public LB7SegmentDisplay Display - { - set { this.Control = value; } - get { return this.Control as LB7SegmentDisplay; } - } - - [Browsable(false)] - public SegmentDictionary Segments - { - get { return this.segments; } - } - #endregion - - #region (* Virtual methods *) - /// - /// Creation of the default points list of the - /// all segments - /// - protected virtual void CreateDefPointsCoordinates() - { - PointF pt = new PointF(3F, 1F); - this.defPoints.Add(pt); - pt = new PointF(8F, 1F); - this.defPoints.Add(pt); - pt = new PointF(9F, 2F); - this.defPoints.Add(pt); - pt = new PointF(10F, 3F); - this.defPoints.Add(pt); - pt = new PointF(10F, 8F); - this.defPoints.Add(pt); - pt = new PointF(9F, 9F); - this.defPoints.Add(pt); - pt = new PointF(10F, 10F); - this.defPoints.Add(pt); - pt = new PointF(10F, 15F); - this.defPoints.Add(pt); - pt = new PointF(9F, 16F); - this.defPoints.Add(pt); - pt = new PointF(8F, 17F); - this.defPoints.Add(pt); - pt = new PointF(3F, 17F); - this.defPoints.Add(pt); - pt = new PointF(2F, 16F); - this.defPoints.Add(pt); - pt = new PointF(1F, 15F); - this.defPoints.Add(pt); - pt = new PointF(1F, 10F); - this.defPoints.Add(pt); - pt = new PointF(2F, 9F); - this.defPoints.Add(pt); - pt = new PointF(1F, 8F); - this.defPoints.Add(pt); - pt = new PointF(1F, 3F); - this.defPoints.Add(pt); - pt = new PointF(2F, 2F); - this.defPoints.Add(pt); - pt = new PointF(3F, 3F); - this.defPoints.Add(pt); - pt = new PointF(8F, 3F); - this.defPoints.Add(pt); - pt = new PointF(8F, 8F); - this.defPoints.Add(pt); - pt = new PointF(8F, 10F); - this.defPoints.Add(pt); - pt = new PointF(8F, 15F); - this.defPoints.Add(pt); - pt = new PointF(3F, 15F); - this.defPoints.Add(pt); - pt = new PointF(3F, 10F); - this.defPoints.Add(pt); - pt = new PointF(3F, 8F); - this.defPoints.Add(pt); - } - - /// - /// Create the dictionary of the - /// segment coordinates - /// - protected virtual void CreateSegmetsData() - { - this.Segments.Clear(); - - Segment s = new Segment(); - s.PointsIndexs[0] = 0; - s.PointsIndexs[1] = 1; - s.PointsIndexs[2] = 2; - s.PointsIndexs[3] = 19; - s.PointsIndexs[4] = 18; - s.PointsIndexs[5] = 17; - this.Segments.Add('A', s); - - s = new Segment(); - s.PointsIndexs[0] = 2; - s.PointsIndexs[1] = 3; - s.PointsIndexs[2] = 4; - s.PointsIndexs[3] = 5; - s.PointsIndexs[4] = 20; - s.PointsIndexs[5] = 19; - this.Segments.Add('B', s); - - s = new Segment(); - s.PointsIndexs[0] = 6; - s.PointsIndexs[1] = 7; - s.PointsIndexs[2] = 8; - s.PointsIndexs[3] = 22; - s.PointsIndexs[4] = 21; - s.PointsIndexs[5] = 5; - this.Segments.Add('C', s); - - s = new Segment(); - s.PointsIndexs[0] = 9; - s.PointsIndexs[1] = 10; - s.PointsIndexs[2] = 11; - s.PointsIndexs[3] = 23; - s.PointsIndexs[4] = 22; - s.PointsIndexs[5] = 8; - this.Segments.Add('D', s); - - s = new Segment(); - s.PointsIndexs[0] = 12; - s.PointsIndexs[1] = 13; - s.PointsIndexs[2] = 14; - s.PointsIndexs[3] = 24; - s.PointsIndexs[4] = 23; - s.PointsIndexs[5] = 11; - this.Segments.Add('E', s); - - s = new Segment(); - s.PointsIndexs[0] = 15; - s.PointsIndexs[1] = 16; - s.PointsIndexs[2] = 17; - s.PointsIndexs[3] = 18; - s.PointsIndexs[4] = 25; - s.PointsIndexs[5] = 14; - this.Segments.Add('F', s); - - s = new Segment(); - s.PointsIndexs[0] = 25; - s.PointsIndexs[1] = 20; - s.PointsIndexs[2] = 5; - s.PointsIndexs[3] = 21; - s.PointsIndexs[4] = 24; - s.PointsIndexs[5] = 14; - this.Segments.Add('G', s); - } - - /// - /// Create the dictionary of the segments - /// for the number values - /// - protected virtual void CreateSegmentsValuesList() - { - SegmentsList list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('C'); - list.Add('D'); - list.Add('E'); - list.Add('F'); - this.valuesSegments.Add(0, list); - - list = new SegmentsList(); - list.Add('B'); - list.Add('C'); - this.valuesSegments.Add(1, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('G'); - list.Add('E'); - list.Add('D'); - this.valuesSegments.Add(2, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('G'); - list.Add('C'); - list.Add('D'); - this.valuesSegments.Add(3, list); - - list = new SegmentsList(); - list.Add('F'); - list.Add('G'); - list.Add('B'); - list.Add('C'); - this.valuesSegments.Add(4, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('F'); - list.Add('G'); - list.Add('C'); - list.Add('D'); - this.valuesSegments.Add(5, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('F'); - list.Add('G'); - list.Add('C'); - list.Add('D'); - list.Add('E'); - this.valuesSegments.Add(6, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('C'); - this.valuesSegments.Add(7, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('C'); - list.Add('D'); - list.Add('E'); - list.Add('F'); - list.Add('G'); - this.valuesSegments.Add(8, list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('B'); - list.Add('C'); - list.Add('D'); - list.Add('F'); - list.Add('G'); - this.valuesSegments.Add(9, list); - - list = new SegmentsList(); - list.Add('G'); - this.valuesSegments.Add((int)'-', list); - - list = new SegmentsList(); - list.Add('A'); - list.Add('D'); - list.Add('E'); - list.Add('F'); - list.Add('G'); - this.valuesSegments.Add((int)'E', list); - } - - /// - /// Calculate the points coordinates for drawing - /// with the ratio of the control - /// - protected virtual void UpdatePointsCoordinates() - { - this.points.Clear(); - - double rappW = 1; - double rappH = 1; - - if (this.Display != null) - { - rappW = (double)this.Display.Width / (double)WIDTH_PIXEL; - rappH = (double)this.Display.Height / (double)HEIGHT_PIXELS; - } - - for (int idx = 0; idx < this.defPoints.Count; idx++) - { - PointF ptDef = this.defPoints[idx]; - PointF pt = new PointF((float)((double)ptDef.X * rappW), (float)((double)ptDef.Y * rappH)); - this.points.Add ( pt ); - } - - this.rectDP.X = this.points[7].X - (float)(0.5 * rappW); - this.rectDP.Y = this.points[8].Y; - this.rectDP.Width = (float)rappW; - this.rectDP.Height = (float)rappH; - } - - /// - /// Draw the control background - /// - /// - /// - /// - protected virtual bool DrawBackground(Graphics gr, RectangleF rc) - { - if (this.Display == null) - return false; - - Color c = this.Display.BackColor; - SolidBrush br = new SolidBrush(c); - Pen pen = new Pen(c); - - Rectangle _rcTmp = new Rectangle(0, 0, this.Display.Width, this.Display.Height); - gr.DrawRectangle(pen, _rcTmp); - gr.FillRectangle(br, rc); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - /// - /// Draw all the segments in the off state - /// - /// - /// - /// - protected virtual bool DrawOffSegments(Graphics gr, RectangleF rc) - { - if (this.Display == null) - return false; - -// SolidBrush br = new SolidBrush(LBColorManager.StepColor(this.Display.ForeColor, 30)); - Color clr = Color.FromArgb(70, this.Display.ForeColor); - SolidBrush br = new SolidBrush(clr); - - foreach (Segment seg in this.Segments.Values) - { - GraphicsPath pth = new GraphicsPath(); - - for (int idx = 0; idx < seg.PointsIndexs.Length - 1; idx++) - { - PointF pt1 = this.points[seg.PointsIndexs[idx]]; - PointF pt2 = this.points[seg.PointsIndexs[idx + 1]]; - pth.AddLine(pt1, pt2); - } - pth.CloseFigure(); - - gr.FillPath(br, pth); - - pth.Dispose(); - } - - gr.FillEllipse(br, this.rectDP); - - br.Dispose(); - return true; - } - - /// - /// Draw the segments in on state - /// - /// - /// - /// - protected virtual bool DrawValue(Graphics gr, RectangleF rc) - { - if (this.Display == null) - return false; - - if (this.valuesSegments.Contains(this.Display.Value) == false) - return false; - - SegmentsList list = this.valuesSegments[this.Display.Value]; - if (list == null) - return false; - - SolidBrush br = new SolidBrush(this.Display.ForeColor); - - foreach (char ch in list) - { - Segment seg = this.segments[ch]; - if (seg != null) - { - GraphicsPath pth = new GraphicsPath(); - - for (int idx = 0; idx < seg.PointsIndexs.Length - 1; idx++) - { - PointF pt1 = this.points[seg.PointsIndexs[idx]]; - PointF pt2 = this.points[seg.PointsIndexs[idx + 1]]; - pth.AddLine(pt1, pt2); - } - pth.CloseFigure(); - - gr.FillPath(br, pth); - - pth.Dispose(); - } - } - - if (this.Display.ShowDP != false) - gr.FillEllipse(br, this.rectDP); - - br.Dispose(); - - return true; - } - #endregion - } - - /// - /// Dictionary for the segment associated - /// to the number - /// - public class SegmentDictionary : DictionaryBase - { - public Segment this[char ch] - { - set - { - if (Dictionary.Contains(ch) == false) - this.Add(ch, value); - else - Dictionary[ch] = value; - } - get - { - if (Dictionary.Contains(ch) == false) - return null; - - return (Segment)this.Dictionary[ch]; - } - } - - public void Add(char ch, Segment seg) - { - if (this.Contains(ch) == false) - this.Dictionary.Add(ch, seg); - else - this[ch] = seg; - } - - public bool Contains(char ch) - { - return this.Dictionary.Contains(ch); - } - - public ICollection Values - { - get { return this.Dictionary.Values; } - } - - public ICollection Keys - { - get { return this.Dictionary.Keys; } - } - } - - /// - /// Class for the segment data - /// - public class Segment - { - private int[] points = new int[6]; - public Segment() - { - } - - public int[] PointsIndexs - { - get { return this.points; } - } - } - - /// - /// Points list - /// - public class PointsList : List - { - public PointsList() - { - } - } - - /// - /// Segments list - /// - public class SegmentsList : List - { - public SegmentsList() - { - } - } - - /// - /// Dictionary for value to segments - /// - public class SegmentsValueDictionary : DictionaryBase - { - public SegmentsList this[int num] - { - set - { - if (Dictionary.Contains(num) == false) - this.Add(num, value); - else - Dictionary[num] = value; - } - get - { - if (Dictionary.Contains(num) == false) - return null; - - return (SegmentsList)this.Dictionary[num]; - } - } - - public void Add(int num, SegmentsList seg) - { - if (this.Contains(num) == false) - this.Dictionary.Add(num, seg); - else - this[num] = seg; - } - - public bool Contains(int ch) - { - return this.Dictionary.Contains(ch); - } - - public ICollection Values - { - get { return this.Dictionary.Values; } - } - - public ICollection Keys - { - get { return this.Dictionary.Keys; } - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.Designer.cs deleted file mode 100644 index 69428c4..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.Designer.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 26/02/2008 - * Ora: 11.44 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -namespace LBSoft.IndustrialCtrls.Leds -{ - public partial class LBLed - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the control. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.tmrBlink = new System.Windows.Forms.Timer(this.components); - this.SuspendLayout(); - // - // tmrBlink - // - this.tmrBlink.Interval = 500; - this.tmrBlink.Tick += new System.EventHandler(this.OnBlink); - // - // LBLed - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LBLed"; - this.ResumeLayout(false); - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.cs deleted file mode 100644 index 8ac2442..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.cs +++ /dev/null @@ -1,216 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBLed.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Leds -{ - /// - /// Class for the Led control. - /// - public partial class LBLed : LBIndustrialCtrlBase - { - #region (* Enumeratives *) - public enum LedState - { - Off = 0, - On, - Blink, - } - - public enum LedLabelPosition - { - Left = 0, - Top, - Right, - Bottom, - } - - public enum LedStyle - { - Circular = 0, - Rectangular, - } - - #endregion - - #region (* Properties variables *) - private Color ledColor; - private LedState state; - private LedStyle style; - private LedLabelPosition labelPosition; - private String label = "Led"; - private SizeF ledSize; - private int blinkInterval = 500; - #endregion - - #region (* Class variables *) - private Timer tmrBlink; - private bool blinkIsOn = false; - #endregion - - #region (* Constructor *) - public LBLed() - { - InitializeComponent(); - - this.Size = new Size(20, 20); - this.ledColor = Color.Red; - this.state = LBLed.LedState.Off; - this.style = LBLed.LedStyle.Circular; - this.blinkIsOn = false; - this.ledSize = new SizeF ( 10F, 10F ); - this.labelPosition = LedLabelPosition.Top; - } - #endregion - - #region (* Properties *) - [ - Category("Led"), - Description("Style of the led") - ] - public LedStyle Style - { - get { return style; } - set - { - style = value; - this.CalculateDimensions(); - } - } - [ - Category("Led"), - Description("Color of the led") - ] - public Color LedColor - { - get { return ledColor; } - set - { - ledColor = value; - Invalidate(); - } - } - - - [ - Category("Led"), - Description("State of the led") - ] - public LedState State - { - get { return state; } - set - { - state = value; - if ( state == LedState.Blink ) - { - this.blinkIsOn = true; - this.tmrBlink.Interval = this.BlinkInterval; - this.tmrBlink.Start(); - } - else - { - this.blinkIsOn = true; - this.tmrBlink.Stop(); - } - - Invalidate(); - } - } - - - [ - Category("Led"), - Description("Size of the led") - ] - public SizeF LedSize - { - get { return this.ledSize; } - set - { - this.ledSize = value; - this.CalculateDimensions(); - Invalidate(); - } - } - - - [ - Category("Led"), - Description("Label of the led") - ] - public String Label - { - get { return this.label; } - set - { - this.label = value; - Invalidate(); - } - } - - - [ - Category("Led"), - Description("Position of the label of the led") - ] - public LedLabelPosition LabelPosition - { - get { return this.labelPosition; } - set - { - this.labelPosition = value; - this.CalculateDimensions(); - Invalidate(); - } - } - - - [ - Category("Led"), - Description("Interval for the blink state of the led") - ] - public int BlinkInterval - { - get { return this.blinkInterval; } - set { this.blinkInterval = value; } - } - - [Browsable(false)] - public bool BlinkIsOn - { - get { return this.blinkIsOn; } - } - #endregion - - #region (* Events delegates *) - void OnBlink(object sender, EventArgs e) - { - if ( this.State == LedState.Blink ) - { - if ( this.blinkIsOn == false ) - this.blinkIsOn = true; - else - this.blinkIsOn = false; - - this.Invalidate(); - } - } - #endregion - - #region (* Overrided methods *) - protected override ILBRenderer CreateDefaultRenderer() - { - return new LBLedRenderer(); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.resx b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.resx deleted file mode 100644 index 59f96c4..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LBLed.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LedRenderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LedRenderer.cs deleted file mode 100644 index 60705bd..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Led/LedRenderer.cs +++ /dev/null @@ -1,275 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LedRenderer.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using LBSoft.IndustrialCtrls.Utils; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Leds -{ - /// - /// Base class for the led renderers - /// - public class LBLedRenderer : LBRendererBase - { - #region (* Variables *) - private RectangleF drawRect; - private RectangleF rectLed; - private RectangleF rectLabel; - #endregion - - #region (* Properies *) - /// - /// Get the associated led object - /// - public LBLed Led - { - get { return this.Control as LBLed; } - } - #endregion - - #region (* Overrided method *) - /// - /// Update the rectangles for drawing - /// - /// - public override bool Update() - { - // Check Led object - if (this.Led == null) - throw new NullReferenceException("Invalid 'Led' object"); - - // Dati del rettangolo - float x, y, w, h; - x = 0; - y = 0; - w = this.Led.Size.Width; - h = this.Led.Size.Height; - - // Rettangolo di disegno - drawRect.X = x; - drawRect.Y = y; - drawRect.Width = w - 2; - drawRect.Height = h - 2; - if (drawRect.Width <= 0) - drawRect.Width = 20; - if (drawRect.Height <= 0) - drawRect.Height = 20; - - this.rectLed = drawRect; - this.rectLabel = drawRect; - - if (this.Led.LabelPosition == LBLed.LedLabelPosition.Bottom) - { - this.rectLed.X = (this.rectLed.Width * 0.5F) - (this.Led.LedSize.Width * 0.5F); - this.rectLed.Width = this.Led.LedSize.Width; - this.rectLed.Height = this.Led.LedSize.Height; - - this.rectLabel.Y = this.rectLed.Bottom; - } - - else if (this.Led.LabelPosition == LBLed.LedLabelPosition.Top) - { - this.rectLed.X = (this.rectLed.Width * 0.5F) - (this.Led.LedSize.Width * 0.5F); - this.rectLed.Y = this.rectLed.Height - this.Led.LedSize.Height; - this.rectLed.Width = this.Led.LedSize.Width; - this.rectLed.Height = this.Led.LedSize.Height; - - this.rectLabel.Height = this.rectLed.Top; - } - - else if (this.Led.LabelPosition == LBLed.LedLabelPosition.Left) - { - this.rectLed.X = this.rectLed.Width - this.Led.LedSize.Width; - this.rectLed.Width = this.Led.LedSize.Width; - this.rectLed.Height = this.Led.LedSize.Height; - - this.rectLabel.Width = this.rectLabel.Width - this.rectLed.Width; - } - - else if (this.Led.LabelPosition == LBLed.LedLabelPosition.Right) - { - this.rectLed.Width = this.Led.LedSize.Width; - this.rectLed.Height = this.Led.LedSize.Height; - - this.rectLabel.X = this.rectLed.Right; - } - - return true; - } - - /// - /// Draw the led object - /// - /// - public override void Draw(Graphics Gr) - { - if (Gr == null) - throw new ArgumentNullException("Gr"); - - LBLed ctrl = this.Led; - if (ctrl == null) - throw new NullReferenceException("Associated control is not valid"); - - Rectangle rc = ctrl.Bounds; - - this.DrawBackground(Gr, rc); - - if (this.rectLed.Width <= 0) - this.rectLed.Width = rectLabel.Width; - if (this.rectLed.Height <= 0) - this.rectLed.Height = ctrl.LedSize.Height; - - this.DrawLed(Gr, this.rectLed); - - this.DrawLabel(Gr, this.rectLabel); - } - #endregion - - #region (* Virtual method *) - /// - /// Draw the background of the control - /// - /// - /// - /// - public virtual bool DrawBackground( Graphics Gr, RectangleF rc ) - { - if ( this.Led == null ) - return false; - - Color c = this.Led.BackColor; - SolidBrush br = new SolidBrush ( c ); - Pen pen = new Pen ( c ); - - Rectangle _rcTmp = new Rectangle(0, 0, this.Led.Width, this.Led.Height ); - Gr.DrawRectangle ( pen, _rcTmp ); - Gr.FillRectangle ( br, rc ); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - /// - /// Draw the body of the control - /// - /// - /// - /// - public virtual bool DrawLed( Graphics Gr, RectangleF rc ) - { - if ( this.Led == null ) - return false; - - Color cDarkOff = LBColorManager.StepColor ( Color.LightGray, 20 ); - Color cDarkOn = LBColorManager.StepColor ( this.Led.LedColor, 60 ); - - LinearGradientBrush brOff = new LinearGradientBrush ( rc, - Color.Gray, - cDarkOff, - 45 ); - - LinearGradientBrush brOn = new LinearGradientBrush ( rc, - this.Led.LedColor, - cDarkOn, - 45 ); - if ( this.Led.State == LBLed.LedState.Blink ) - { - if (this.Led.BlinkIsOn == false) - { - if (this.Led.Style == LBLed.LedStyle.Circular) - Gr.FillEllipse(brOff, rc); - else if (this.Led.Style == LBLed.LedStyle.Rectangular) - Gr.FillRectangle(brOff, rc); - } - else - { - if (this.Led.Style == LBLed.LedStyle.Circular) - Gr.FillEllipse(brOn, rc); - else if (this.Led.Style == LBLed.LedStyle.Rectangular) - Gr.FillRectangle(brOn, rc); - } - } - else - { - if (this.Led.State == LBLed.LedState.Off) - { - if (this.Led.Style == LBLed.LedStyle.Circular) - Gr.FillEllipse(brOff, rc); - else if (this.Led.Style == LBLed.LedStyle.Rectangular) - Gr.FillRectangle(brOff, rc); - } - else - { - if (this.Led.Style == LBLed.LedStyle.Circular) - Gr.FillEllipse(brOn, rc); - else if (this.Led.Style == LBLed.LedStyle.Rectangular) - Gr.FillRectangle(brOn, rc); - } - } - - brOff.Dispose(); - brOn.Dispose(); - - return true; - } - - /// - /// Draw the text of the control - /// - /// - /// - /// - public virtual bool DrawLabel( Graphics Gr, RectangleF rc ) - { - if ( this.Led == null ) - return false; - - if ( this.Led.Label == String.Empty ) - return false; - - SizeF size = Gr.MeasureString ( this.Led.Label, this.Led.Font ); - - SolidBrush br1 = new SolidBrush ( this.Led.ForeColor ); - - float hPos = 0; - float vPos = 0; - switch ( this.Led.LabelPosition ) - { - case LBLed.LedLabelPosition.Top: - hPos = (float)(rc.Width*0.5F)-(float)(size.Width*0.5F); - vPos = rc.Bottom - size.Height; - break; - - case LBLed.LedLabelPosition.Bottom: - hPos = (float)(rc.Width*0.5F)-(float)(size.Width*0.5F); - break; - - case LBLed.LedLabelPosition.Left: - hPos = rc.Width - size.Width; - vPos = (float)(rc.Height*0.5F)-(float)(size.Height*0.5F); - break; - - case LBLed.LedLabelPosition.Right: - vPos = (float)(rc.Height*0.5F)-(float)(size.Height*0.5F); - break; - } - - Gr.DrawString ( this.Led.Label, - this.Led.Font, - br1, - rc.Left + hPos, - rc.Top + vPos ); - - return true; - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.Designer.cs deleted file mode 100644 index b6f7632..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.Designer.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 03/04/2008 - * Ora: 14.34 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -namespace LBSoft.IndustrialCtrls.Meters -{ - public partial class LBAnalogMeter - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the form. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - // - // UserControl1 - // - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LBAnalogMeter"; - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.cs deleted file mode 100644 index a044b65..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBAnalogMeter.cs +++ /dev/null @@ -1,256 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBAnalogMeter.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Meters -{ - /// - /// Class for the analog meter control - /// - public partial class LBAnalogMeter : LBIndustrialCtrlBase - { - #region (* Enumerator *) - public enum AnalogMeterStyle - { - Circular = 0, - }; - #endregion - - #region (* Properties variables *) - private AnalogMeterStyle meterStyle; - private Color bodyColor; - private Color needleColor; - private Color scaleColor; - private bool viewGlass; - private double currValue; - private double minValue; - private double maxValue; - private int scaleDivisions; - private int scaleSubDivisions; - private LBMeterThresholdCollection listThreshold; - #endregion - - #region (* Class variables *) - protected float startAngle; - protected float endAngle; - #endregion - - #region (* Costructors *) - public LBAnalogMeter() - { - // Initialization - InitializeComponent(); - - // Properties initialization - this.bodyColor = Color.Red; - this.needleColor = Color.Yellow; - this.scaleColor = Color.White; - this.meterStyle = AnalogMeterStyle.Circular; - this.viewGlass = false; - this.startAngle = 135; - this.endAngle = 405; - this.minValue = 0; - this.maxValue = 1; - this.currValue = 0; - this.scaleDivisions = 10; - this.scaleSubDivisions = 10; - - // Create the sector list - this.listThreshold = new LBMeterThresholdCollection(); - - this.CalculateDimensions(); - } - #endregion - - #region (* Properties *) - [ - Category("Analog Meter"), - Description("Style of the control") - ] - public AnalogMeterStyle MeterStyle - { - get { return meterStyle;} - set - { - meterStyle = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Color of the body of the control") - ] - public Color BodyColor - { - get { return bodyColor; } - set - { - bodyColor = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Color of the needle") - ] - public Color NeedleColor - { - get { return needleColor; } - set - { - needleColor = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Show or hide the glass effect") - ] - public bool ViewGlass - { - get { return viewGlass; } - set - { - viewGlass = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Color of the scale of the control") - ] - public Color ScaleColor - { - get { return scaleColor; } - set - { - scaleColor = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Value of the data") - ] - public double Value - { - get { return currValue; } - set - { - double val = value; - if ( val > maxValue ) - val = maxValue; - - if ( val < minValue ) - val = minValue; - - currValue = val; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Minimum value of the data") - ] - public double MinValue - { - get { return minValue; } - set - { - minValue = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Maximum value of the data") - ] - public double MaxValue - { - get { return maxValue; } - set - { - maxValue = value; - Invalidate(); - } - } - - - [ - Category("Analog Meter"), - Description("Number of the scale divisions") - ] - public int ScaleDivisions - { - get { return scaleDivisions; } - set - { - scaleDivisions = value; - this.CalculateDimensions(); - } - } - - - [ - Category("Analog Meter"), - Description("Number of the scale subdivisions") - ] - public int ScaleSubDivisions - { - get { return scaleSubDivisions; } - set - { - scaleSubDivisions = value; - this.CalculateDimensions(); - } - } - - [Browsable(false)] - public LBMeterThresholdCollection Thresholds - { - get { return this.listThreshold; } - } - #endregion - - #region (* Public methods *) - public float GetStartAngle() - { - return this.startAngle; - } - - public float GetEndAngle() - { - return this.endAngle; - } - #endregion - - #region (* Overrided methods *) - protected override ILBRenderer CreateDefaultRenderer() - { - return new LBAnalogMeterRenderer(); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.Designer.cs deleted file mode 100644 index ec464cc..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.Designer.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace LBSoft.IndustrialCtrls.Meters -{ - partial class LBDigitalMeter - { - /// - /// Variabile di progettazione necessaria. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Liberare le risorse in uso. - /// - /// ha valore true se le risorse gestite devono essere eliminate, false in caso contrario. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Codice generato da Progettazione componenti - - /// - /// Metodo necessario per il supporto della finestra di progettazione. Non modificare - /// il contenuto del metodo con l'editor di codice. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // LBDigitalMeter - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "LBDigitalMeter"; - this.Size = new System.Drawing.Size(385, 150); - this.ResumeLayout(false); - - } - - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.cs deleted file mode 100644 index a3b8b6d..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.cs +++ /dev/null @@ -1,323 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBDigitalMeter.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls.Leds; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Meters -{ - /// - /// Class for the digital meter - /// - public partial class LBDigitalMeter : LBIndustrialCtrlBase - { - #region (* Class variables *) - protected int _dpPos = 0; - protected int _numDigits = 0; - #endregion - - #region (* Constructor *) - public LBDigitalMeter() - { - InitializeComponent(); - - // Transparent background - this.BackColor = Color.Black; - - this.Format = "000"; - } - #endregion - - #region (* Properties *) - /// - /// Background color - /// - public override Color BackColor - { - get - { - return base.BackColor; - } - set - { - base.BackColor = value; - - foreach (Control disp in this.Controls) - { - if (disp.GetType() == typeof(LB7SegmentDisplay)) - { - LB7SegmentDisplay d = disp as LB7SegmentDisplay; - - d.BackColor = value; - } - } - } - } - - /// - /// Color of the display - /// - public override Color ForeColor - { - get - { - return base.ForeColor; - } - set - { - base.ForeColor = value; - - foreach (Control disp in this.Controls) - { - if (disp.GetType() == typeof(LB7SegmentDisplay)) - { - LB7SegmentDisplay d = disp as LB7SegmentDisplay; - - d.ForeColor = value; - } - } - } - } - - /// - /// Set the sign of the display - /// - private bool _signed = false; - [ - Category("Digital meter"), - Description("Set the signed value of the meter") - ] - public bool Signed - { - set - { - if (this._signed == value) - return; - - this._signed = value; - - this.UpdateControls(); - } - - get { return this._signed; } - } - - /// - /// Set the format of the display, without the sign - /// - private string _format = string.Empty; - [ - Category("Digital meter"), - Description("Format of the display value") - ] - public string Format - { - set - { - if (this._format == value) - return; - - this._format = value; - - this.UpdateControls(); - - this.Value = this.Value; - } - - get { return this._format; } - } - - /// - /// Set the value of the display - /// - private double val = 0.0; - [ - Category("Digital meter"), - Description("Value to display") - ] - public double Value - { - set - { - this.val = value; - - string str = this.val.ToString(this.Format); - str = str.Replace ( ".", string.Empty ); - str = str.Replace ( ",", string.Empty ); - - bool sign = false; - if (str[0] == '-') - { - sign = true; - str = str.TrimStart(new char[] { '-' }); - } - - if ( str.Length > this._numDigits ) - { - foreach (LB7SegmentDisplay d in this.Controls) - d.Value = (int)'E'; - - return; - } - - int idx = 0; - for (idx = str.Length - 1; idx >= 0; idx--) - { - int id = idx; - if (this.Signed != false) - id++; - LB7SegmentDisplay d = this.Controls[id] as LB7SegmentDisplay; - d.Value = Convert.ToInt32(str[idx].ToString()); - } - - LB7SegmentDisplay s = this.Controls["digit_sign"] as LB7SegmentDisplay; - if (s != null) - { - if (sign != false) - s.Value = (int)'-'; - else - s.Value = -1; - } - } - - get { return this.val; } - } - #endregion - - #region (* Overrided methods *) - /// - /// Create the default renderer - /// - /// - protected override ILBRenderer CreateDefaultRenderer() - { - return new LBDigitalMeterRenderer(); - } - /// - /// Resize of the control - /// - /// - protected override void OnResize(EventArgs e) - { - base.OnResize(e); - this.RepositionControls(); - } - #endregion - - #region (* Protected methods *) - /// - /// Update the controls of the meter - /// - protected virtual void UpdateControls() - { - int count = this.Format.Length; - - this._dpPos = -1; - - char[] seps = new char[] { '.', ',' }; - int sepIndex = this.Format.IndexOfAny(seps); - if (sepIndex > 0) - { - count--; - this._dpPos = sepIndex - 1; - this._numDigits = count; - } - - this._numDigits = count; - - this.Controls.Clear(); - - if (this.Signed != false) - { - LB7SegmentDisplay disp = new LB7SegmentDisplay(); - disp.Name = "digit_sign"; - disp.Value = -1; - this.Controls.Add(disp); - } - - for (int idx = 0; idx < count; idx++) - { - LB7SegmentDisplay disp = new LB7SegmentDisplay(); - - disp.Name = "digit_" + idx.ToString(); - - disp.Click += this.DisplayClicked; - - if (sepIndex - 1 == idx) - disp.ShowDP = true; - - this.Controls.Add(disp); - } - - this.RepositionControls(); - } - - /// - /// Reposition of the digital displaies - /// - protected void RepositionControls() - { - Rectangle rc = this.ClientRectangle; - - if (this.Controls.Count <= 0) - return; - - int digitW = rc.Width / this.Controls.Count; - bool signFind = false; - foreach (Control disp in this.Controls) - { - if (disp.GetType() == typeof(LB7SegmentDisplay)) - { - LB7SegmentDisplay d = disp as LB7SegmentDisplay; - - int idDigit = 0; - if (d.Name.Contains("digit_sign") != false) - { - signFind = true; - } - else - { - if (d.Name.Contains("digit_") != false) - { - string s = d.Name.Remove(0, 6); - idDigit = Convert.ToInt32(s); - - if (signFind != false) - idDigit++; - } - } - - Point pos = new Point(); - pos.X = idDigit * digitW; - pos.Y = 0; - d.Location = pos; - - Size dim = new Size(); - dim.Width = digitW; - dim.Height = rc.Height; - d.Size = dim; - } - } - } - - /// - /// Event generate from the displaies in the control - /// - /// - /// - private void DisplayClicked(object sender, System.EventArgs e) - { - this.InvokeOnClick(this, e); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.resx b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.resx deleted file mode 100644 index 19dc0dd..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeter.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeterRenderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeterRenderer.cs deleted file mode 100644 index 130ced4..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBDigitalMeterRenderer.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Text; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Meters -{ - public class LBDigitalMeterRenderer : LBRendererBase - { - #region (* Constructor *) - public LBDigitalMeterRenderer() - { - } - #endregion - - #region (* Overrided methods *) - public override void Draw(Graphics Gr) - { - if (this.Meter == null) - return; - - RectangleF _rc = new RectangleF(0, 0, this.Meter.Width, this.Meter.Height); - Gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; - - this.DrawBackground(Gr, _rc); - this.DrawBorder(Gr, _rc); - } - #endregion - - #region (* Properties *) - public LBDigitalMeter Meter - { - get { return this.Control as LBDigitalMeter; } - } - #endregion - - #region (* Virtual methods *) - public virtual bool DrawBackground(Graphics gr, RectangleF rc) - { - if (this.Meter == null) - return false; - - Color c = this.Meter.BackColor; - SolidBrush br = new SolidBrush(c); - Pen pen = new Pen(c); - - Rectangle _rcTmp = new Rectangle(0, 0, this.Meter.Width, this.Meter.Height); - gr.DrawRectangle(pen, _rcTmp); - gr.FillRectangle(br, rc); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - public virtual bool DrawBorder(Graphics gr, RectangleF rc) - { - if (this.Meter == null) - return false; - - return true; - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBMeterThreshold.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBMeterThreshold.cs deleted file mode 100644 index 04a603d..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/LBMeterThreshold.cs +++ /dev/null @@ -1,165 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBMeterThreshold.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Collections; -using System.Drawing; - -namespace LBSoft.IndustrialCtrls.Meters -{ - /// - /// Class for the meter threshold - /// - public class LBMeterThreshold - { - #region (* Properties variables *) - private Color color = Color.Empty; - private double startValue = 0.0; - private double endValue = 1.0; - #endregion - - #region (* Constructor *) - public LBMeterThreshold() - { - } - #endregion - - #region (* Properties *) - public Color Color - { - set { this.color = value; } - get { return this.color; } - } - - public double StartValue - { - set { this.startValue = value; } - get { return this.startValue; } - } - - public double EndValue - { - set { this.endValue = value; } - get { return this.endValue; } - } - #endregion - - #region (* Public methods *) - public bool IsInRange ( double val ) - { - if ( val > this.EndValue ) - return false; - - if ( val < this.StartValue ) - return false; - - return true; - } - #endregion - } - - /// - /// Collection of the meter thresolds - /// - public class LBMeterThresholdCollection : CollectionBase - { - #region (* Properties variables *) - private bool _IsReadOnly = false; - #endregion - - #region (* Constructor *) - public LBMeterThresholdCollection() - { - } - #endregion - - #region (* Properties *) - public virtual LBMeterThreshold this[int index] - { - get { return (LBMeterThreshold)InnerList[index]; } - set { InnerList[index] = value; } - } - - public virtual bool IsReadOnly - { - get { return _IsReadOnly; } - } - #endregion - - #region (* Public methods *) - /// - /// Add an object to the collection - /// - /// - public virtual void Add(LBMeterThreshold sector) - { - InnerList.Add(sector); - } - - /// - /// Remove an object from the collection - /// - /// - /// - public virtual bool Remove(LBMeterThreshold sector) - { - bool result = false; - - //loop through the inner array's indices - for (int i = 0; i < InnerList.Count; i++) - { - //store current index being checked - LBMeterThreshold obj = (LBMeterThreshold)InnerList[i]; - - //compare the values of the objects - if ( ( obj.StartValue == sector.StartValue ) && - ( obj.EndValue == sector.EndValue ) ) - { - //remove item from inner ArrayList at index i - InnerList.RemoveAt(i); - result = true; - break; - } - } - - return result; - } - - /// - /// Check if the object is containing in the collection - /// - /// - /// - public bool Contains(LBMeterThreshold sector) - { - //loop through the inner ArrayList - foreach (LBMeterThreshold obj in InnerList) - { - //compare the values of the objects - if ( ( obj.StartValue == sector.StartValue ) && - ( obj.EndValue == sector.EndValue ) ) - { - //if it matches return true - return true; - } - } - - //no match - return false; - } - - /// - /// Copy the collection - /// - /// - /// - public virtual void CopyTo(LBMeterThreshold[] MeterThresholdArray, int index) - { - throw new Exception("This Method is not valid for this implementation."); - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/MeterRenderer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/MeterRenderer.cs deleted file mode 100644 index 9885408..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Meters/MeterRenderer.cs +++ /dev/null @@ -1,397 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: MeterRenderer.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Drawing; -using System.Drawing.Drawing2D; -using LBSoft.IndustrialCtrls.Utils; -using LBSoft.IndustrialCtrls.Base; - -namespace LBSoft.IndustrialCtrls.Meters -{ - /// - /// Base class for the renderers of the analog meter - /// - public class LBAnalogMeterRenderer : LBRendererBase - { - #region (* Variables *) - protected PointF needleCenter; - protected RectangleF drawRect; - protected RectangleF glossyRect; - protected RectangleF needleCoverRect; - protected float drawRatio; - #endregion - - #region (* Properties *) - public LBAnalogMeter AnalogMeter - { - get { return this.Control as LBAnalogMeter; } - } - #endregion - - #region (* Overrided method *) - public override bool Update() - { - // Check Button object - if (this.AnalogMeter == null) - throw new NullReferenceException("Invalid 'AnalogMeter' object"); - - // Rectangle - float x, y, w, h; - x = 0; - y = 0; - w = this.AnalogMeter.Size.Width; - h = this.AnalogMeter.Size.Height; - - // Calculate ratio - drawRatio = (Math.Min(w, h)) / 200; - if (drawRatio == 0.0) - drawRatio = 1; - - // Draw rectangle - drawRect.X = x; - drawRect.Y = y; - drawRect.Width = w - 2; - drawRect.Height = h - 2; - - if (w < h) - drawRect.Height = w; - else if (w > h) - drawRect.Width = h; - - if (drawRect.Width < 10) - drawRect.Width = 10; - if (drawRect.Height < 10) - drawRect.Height = 10; - - // Calculate needle center - needleCenter.X = drawRect.X + (drawRect.Width / 2); - needleCenter.Y = drawRect.Y + (drawRect.Height / 2); - - // Needle cover rect - needleCoverRect.X = needleCenter.X - (20 * drawRatio); - needleCoverRect.Y = needleCenter.Y - (20 * drawRatio); - needleCoverRect.Width = 40 * drawRatio; - needleCoverRect.Height = 40 * drawRatio; - - // Glass effect rect - glossyRect.X = drawRect.X + (20 * drawRatio); - glossyRect.Y = drawRect.Y + (10 * drawRatio); - glossyRect.Width = drawRect.Width - (40 * drawRatio); - glossyRect.Height = needleCenter.Y + (30 * drawRatio); - - return false; - } - - public override void Draw(Graphics Gr) - { - if (Gr == null) - throw new ArgumentNullException("Gr"); - - LBAnalogMeter ctrl = this.AnalogMeter; - if (ctrl == null) - throw new NullReferenceException("Associated control is not valid"); - - this.DrawBackground(Gr, ctrl.Bounds); - this.DrawBody(Gr, drawRect); - this.DrawThresholds(Gr, drawRect); - this.DrawDivisions(Gr, drawRect); - this.DrawUM(Gr, drawRect); - this.DrawValue(Gr, drawRect); - this.DrawNeedle(Gr, drawRect); - this.DrawNeedleCover(Gr, this.needleCoverRect); - this.DrawGlass(Gr, this.glossyRect); - } - #endregion - - #region (* Virtual method *) - public virtual bool DrawBackground( Graphics gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - Color c = this.AnalogMeter.BackColor; - SolidBrush br = new SolidBrush ( c ); - Pen pen = new Pen ( c ); - - Rectangle _rcTmp = new Rectangle(0, 0, this.AnalogMeter.Width, this.AnalogMeter.Height ); - gr.DrawRectangle ( pen, _rcTmp ); - gr.FillRectangle ( br, rc ); - - br.Dispose(); - pen.Dispose(); - - return true; - } - - public virtual bool DrawBody( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - Color bodyColor = this.AnalogMeter.BodyColor; - Color cDark = LBColorManager.StepColor ( bodyColor, 20 ); - - LinearGradientBrush br1 = new LinearGradientBrush ( rc, - bodyColor, - cDark, - 45 ); - Gr.FillEllipse ( br1, rc ); - - RectangleF _rc = rc; - _rc.X += 3 * drawRatio; - _rc.Y += 3 * drawRatio; - _rc.Width -= 6 * drawRatio; - _rc.Height -= 6 * drawRatio; - - LinearGradientBrush br2 = new LinearGradientBrush ( _rc, - cDark, - bodyColor, - 45 ); - Gr.FillEllipse ( br2, _rc ); - - return true; - } - - public virtual bool DrawThresholds( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - RectangleF _rc = rc; - _rc.Inflate ( -18F * drawRatio, -18F * drawRatio ); - - double w = _rc.Width; - double radius = w / 2 - ( w * 0.075); - - float startAngle = this.AnalogMeter.GetStartAngle(); - float endAngle = this.AnalogMeter.GetEndAngle(); - float rangeAngle = endAngle - startAngle; - float minValue = (float)this.AnalogMeter.MinValue; - float maxValue = (float)this.AnalogMeter.MaxValue; - - double stepVal = rangeAngle / ( maxValue - minValue ); - - foreach ( LBMeterThreshold sect in this.AnalogMeter.Thresholds ) - { - - float startPathAngle = ( (float)(startAngle + ( stepVal * sect.StartValue ))); - float endPathAngle = ( (float)( ( stepVal * ( sect.EndValue - sect.StartValue )))); - - GraphicsPath pth = new GraphicsPath(); - pth.AddArc ( _rc, startPathAngle, endPathAngle ); - - Pen pen = new Pen( sect.Color, 4.5F * drawRatio ); - - Gr.DrawPath ( pen, pth ); - - pen.Dispose(); - pth.Dispose(); - } - - return false; - } - - public virtual bool DrawDivisions( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - float startAngle = this.AnalogMeter.GetStartAngle(); - float endAngle = this.AnalogMeter.GetEndAngle(); - float scaleDivisions = this.AnalogMeter.ScaleDivisions; - float scaleSubDivisions = this.AnalogMeter.ScaleSubDivisions; - double minValue = this.AnalogMeter.MinValue; - double maxValue = this.AnalogMeter.MaxValue; - Color scaleColor = this.AnalogMeter.ScaleColor; - - float cx = needleCenter.X; - float cy = needleCenter.Y; - float w = rc.Width; - float h = rc.Height; - - float incr = LBMath.GetRadian(( endAngle - startAngle ) / (( scaleDivisions - 1 )* (scaleSubDivisions + 1))); - float currentAngle = LBMath.GetRadian( startAngle ); - float radius = (float)(w / 2 - ( w * 0.08)); - float rulerValue = (float)minValue; - - Pen pen = new Pen ( scaleColor, ( 1 * drawRatio ) ); - SolidBrush br = new SolidBrush ( scaleColor ); - - PointF ptStart = new PointF(0,0); - PointF ptEnd = new PointF(0,0); - int n = 0; - for( ; n < scaleDivisions; n++ ) - { - //Draw Thick Line - ptStart.X = (float)(cx + radius * Math.Cos(currentAngle)); - ptStart.Y = (float)(cy + radius * Math.Sin(currentAngle)); - ptEnd.X = (float)(cx + (radius - w/20) * Math.Cos(currentAngle)); - ptEnd.Y = (float)(cy + (radius - w/20) * Math.Sin(currentAngle)); - Gr.DrawLine( pen, ptStart, ptEnd ); - - //Draw Strings - Font font = new Font ( this.AnalogMeter.Font.FontFamily, (float)( 6F * drawRatio ) ); - - float tx = (float)(cx + (radius - ( 20 * drawRatio )) * Math.Cos(currentAngle)); - float ty = (float)(cy + (radius - ( 20 * drawRatio )) * Math.Sin(currentAngle)); - double val = Math.Round ( rulerValue ); - String str = String.Format( "{0,0:D}", (int)val ); - - SizeF size = Gr.MeasureString ( str, font ); - Gr.DrawString ( str, - font, - br, - tx - (float)( size.Width * 0.5 ), - ty - (float)( size.Height * 0.5 ) ); - - rulerValue += (float)(( maxValue - minValue) / (scaleDivisions - 1)); - - if ( n == scaleDivisions -1) - { - font.Dispose(); - break; - } - - if ( scaleDivisions <= 0 ) - currentAngle += incr; - else - { - for (int j = 0; j <= scaleSubDivisions; j++) - { - currentAngle += incr; - ptStart.X = (float)(cx + radius * Math.Cos(currentAngle)); - ptStart.Y = (float)(cy + radius * Math.Sin(currentAngle)); - ptEnd.X = (float)(cx + (radius - w/50) * Math.Cos(currentAngle)); - ptEnd.Y = (float)(cy + (radius - w/50) * Math.Sin(currentAngle)); - Gr.DrawLine( pen, ptStart, ptEnd ); - } - } - - font.Dispose(); - } - - return true; - } - - public virtual bool DrawUM( Graphics gr, RectangleF rc ) - { - return false; - } - - public virtual bool DrawValue( Graphics gr, RectangleF rc ) - { - return false; - } - - public virtual bool DrawNeedle( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - float w, h ; - w = rc.Width; - h = rc.Height; - - double minValue = this.AnalogMeter.MinValue; - double maxValue = this.AnalogMeter.MaxValue; - double currValue = this.AnalogMeter.Value; - float startAngle = this.AnalogMeter.GetStartAngle(); - float endAngle = this.AnalogMeter.GetEndAngle(); - - float radius = (float)(w / 2 - ( w * 0.12)); - float val = (float)(maxValue - minValue); - - val = (float)((100 * ( currValue - minValue )) / val); - val = (( endAngle - startAngle ) * val) / 100; - val += startAngle; - - float angle = LBMath.GetRadian ( val ); - - float cx = needleCenter.X; - float cy = needleCenter.Y; - - PointF ptStart = new PointF(0,0); - PointF ptEnd = new PointF(0,0); - - GraphicsPath pth1 = new GraphicsPath(); - - ptStart.X = cx; - ptStart.Y = cy; - angle = LBMath.GetRadian(val + 10); - ptEnd.X = (float)(cx + (w * .09F) * Math.Cos(angle)); - ptEnd.Y = (float)(cy + (w * .09F) * Math.Sin(angle)); - pth1.AddLine ( ptStart, ptEnd ); - - ptStart = ptEnd; - angle = LBMath.GetRadian(val); - ptEnd.X = (float)(cx + radius * Math.Cos(angle)); - ptEnd.Y = (float)(cy + radius * Math.Sin(angle)); - pth1.AddLine ( ptStart, ptEnd ); - - ptStart = ptEnd; - angle = LBMath.GetRadian(val - 10); - ptEnd.X = (float)(cx + (w * .09F) * Math.Cos(angle)); - ptEnd.Y = (float)(cy + (w * .09F) * Math.Sin(angle)); - pth1.AddLine ( ptStart, ptEnd ); - - pth1.CloseFigure(); - - SolidBrush br = new SolidBrush( this.AnalogMeter.NeedleColor ); - Pen pen = new Pen ( this.AnalogMeter.NeedleColor ); - Gr.DrawPath ( pen, pth1 ); - Gr.FillPath ( br, pth1 ); - - return true; - } - - public virtual bool DrawNeedleCover( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - Color clr = this.AnalogMeter.NeedleColor; - RectangleF _rc = rc; - - Color clr1 = Color.FromArgb( 70, clr ); - - _rc.Inflate ( 5 * drawRatio, 5 * drawRatio ); - - SolidBrush brTransp = new SolidBrush ( clr1 ); - Gr.FillEllipse ( brTransp, _rc ); - - clr1 = clr; - Color clr2 = LBColorManager.StepColor ( clr, 75 ); - LinearGradientBrush br1 = new LinearGradientBrush( rc, - clr1, - clr2, - 45 ); - Gr.FillEllipse ( br1, rc ); - return true; - } - - public virtual bool DrawGlass( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - if ( this.AnalogMeter.ViewGlass == false ) - return true; - - Color clr1 = Color.FromArgb( 40, 200, 200, 200 ); - - Color clr2 = Color.FromArgb( 0, 200, 200, 200 ); - LinearGradientBrush br1 = new LinearGradientBrush( rc, - clr1, - clr2, - 45 ); - Gr.FillEllipse ( br1, rc ); - - return true; - } - #endregion - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/ColorMng.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/ColorMng.cs deleted file mode 100644 index d740e57..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/ColorMng.cs +++ /dev/null @@ -1,62 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBLed.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; -using System.Drawing; - -namespace LBSoft.IndustrialCtrls.Utils -{ - /// - /// Manager for color - /// - public class LBColorManager : Object - { - public static double BlendColour ( double fg, double bg, double alpha ) - { - double result = bg + (alpha * (fg - bg)); - if (result < 0.0) - result = 0.0; - if (result > 255) - result = 255; - return result; - } - - public static Color StepColor ( Color clr, int alpha ) - { - if ( alpha == 100 ) - return clr; - - byte a = clr.A; - byte r = clr.R; - byte g = clr.G; - byte b = clr.B; - float bg = 0; - - int _alpha = Math.Min(alpha, 200); - _alpha = Math.Max(alpha, 0); - double ialpha = ((double)(_alpha - 100.0))/100.0; - - if (ialpha > 100) - { - // blend with white - bg = 255.0F; - ialpha = 1.0F - ialpha; // 0 = transparent fg; 1 = opaque fg - } - else - { - // blend with black - bg = 0.0F; - ialpha = 1.0F + ialpha; // 0 = transparent fg; 1 = opaque fg - } - - r = (byte)(LBColorManager.BlendColour(r, bg, ialpha)); - g = (byte)(LBColorManager.BlendColour(g, bg, ialpha)); - b = (byte)(LBColorManager.BlendColour(b, bg, ialpha)); - - return Color.FromArgb ( a, r, g, b ); - } - }; -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/MathFunc.cs b/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/MathFunc.cs deleted file mode 100644 index 1d35e26..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/LBIndustrialCtrls/Utils/MathFunc.cs +++ /dev/null @@ -1,21 +0,0 @@ -/*--------------------------------------------------------------------------- - * File: LBLed.cs - * Utente: lucabonotto - * Date: 05/04/2009 - *-------------------------------------------------------------------------*/ - -using System; - -namespace LBSoft.IndustrialCtrls.Utils -{ - /// - /// Mathematic Functions - /// - public class LBMath : Object - { - public static float GetRadian ( float val ) - { - return (float)(val * Math.PI / 180); - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp.sln b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp.sln deleted file mode 100644 index 7f57071..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.6.33801.468 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{AA498353-353F-46AE-B5D5-96A88CBEA6ED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LBIndustrialCtrls", "LBIndustrialCtrls\LBIndustrialCtrls.csproj", "{B4218BC9-9736-42B9-BC99-7903FDBEBA28}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AA498353-353F-46AE-B5D5-96A88CBEA6ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA498353-353F-46AE-B5D5-96A88CBEA6ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA498353-353F-46AE-B5D5-96A88CBEA6ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA498353-353F-46AE-B5D5-96A88CBEA6ED}.Release|Any CPU.Build.0 = Release|Any CPU - {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {C763B692-31EC-48FC-AACE-97C32273C42F} - EndGlobalSection -EndGlobal diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/AssemblyInfo.cs b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/AssemblyInfo.cs deleted file mode 100644 index 963bf0c..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/AssemblyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region Using directives - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -#endregion - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestApp")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TestApp")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// This sets the default COM visibility of types in the assembly to invisible. -// If you need to expose a type to COM, use [ComVisible(true)] on that type. -[assembly: ComVisible(false)] - -// The assembly version has following format : -// -// Major.Minor.Build.Revision -// -// You can specify all the values or you can use the default the Revision and -// Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("1.1.0.0")] diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.Designer.cs b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.Designer.cs deleted file mode 100644 index 31f9ba9..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.Designer.cs +++ /dev/null @@ -1,541 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 03/04/2008 - * Ora: 14.34 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System.Windows.Forms; - -namespace TestApp -{ - partial class MainForm - { - /// - /// Designer variable used to keep track of non-visual components. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Disposes resources used by the form. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing) { - if (components != null) { - components.Dispose(); - } - } - base.Dispose(disposing); - } - - /// - /// This method is required for Windows Forms designer support. - /// Do not change the method contents inside the source code editor. The Forms designer might - /// not be able to load this method if it was changed manually. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.sdRepeat = new LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay(); - this.label4 = new System.Windows.Forms.Label(); - this.lB7SegmentDisplay1 = new LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay(); - this.lB7SegmentDisplay2 = new LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay(); - this.lbLed4 = new LBSoft.IndustrialCtrls.Leds.LBLed(); - this.lbLed3 = new LBSoft.IndustrialCtrls.Leds.LBLed(); - this.lbLed2 = new LBSoft.IndustrialCtrls.Leds.LBLed(); - this.lbLed1 = new LBSoft.IndustrialCtrls.Leds.LBLed(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.btnRepeat = new LBSoft.IndustrialCtrls.Buttons.LBButton(); - this.lbButton3 = new LBSoft.IndustrialCtrls.Buttons.LBButton(); - this.lbButton2 = new LBSoft.IndustrialCtrls.Buttons.LBButton(); - this.lbButton1 = new LBSoft.IndustrialCtrls.Buttons.LBButton(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.propertyGrid1 = new System.Windows.Forms.PropertyGrid(); - this.labelCurrCtrl = new System.Windows.Forms.Label(); - this.lbDigitalMeter1 = new LBSoft.IndustrialCtrls.Meters.LBDigitalMeter(); - this.lbAnalogMeter2 = new LBSoft.IndustrialCtrls.Meters.LBAnalogMeter(); - this.lbKnob1 = new LBSoft.IndustrialCtrls.Knobs.LBKnob(); - this.lbAnalogMeter1 = new LBSoft.IndustrialCtrls.Meters.LBAnalogMeter(); - this.groupBox1.SuspendLayout(); - this.groupBox2.SuspendLayout(); - this.SuspendLayout(); - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.groupBox1.BackColor = System.Drawing.Color.Transparent; - this.groupBox1.Controls.Add(this.sdRepeat); - this.groupBox1.Controls.Add(this.label4); - this.groupBox1.Controls.Add(this.lB7SegmentDisplay1); - this.groupBox1.Controls.Add(this.lB7SegmentDisplay2); - this.groupBox1.Controls.Add(this.lbLed4); - this.groupBox1.Controls.Add(this.lbLed3); - this.groupBox1.Controls.Add(this.lbLed2); - this.groupBox1.Controls.Add(this.lbLed1); - this.groupBox1.Location = new System.Drawing.Point(143, 258); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(272, 337); - this.groupBox1.TabIndex = 6; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Leds"; - // - // sdRepeat - // - this.sdRepeat.BackColor = System.Drawing.Color.Black; - this.sdRepeat.ForeColor = System.Drawing.Color.Red; - this.sdRepeat.Location = new System.Drawing.Point(32, 256); - this.sdRepeat.Name = "sdRepeat"; - this.sdRepeat.Renderer = null; - this.sdRepeat.ShowDP = false; - this.sdRepeat.Size = new System.Drawing.Size(32, 50); - this.sdRepeat.TabIndex = 18; - this.sdRepeat.Value = 2; - // - // label4 - // - this.label4.Location = new System.Drawing.Point(145, 27); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(121, 14); - this.label4.TabIndex = 17; - this.label4.Text = "7 Segments display"; - // - // lB7SegmentDisplay1 - // - this.lB7SegmentDisplay1.BackColor = System.Drawing.Color.Black; - this.lB7SegmentDisplay1.ForeColor = System.Drawing.Color.Red; - this.lB7SegmentDisplay1.Location = new System.Drawing.Point(148, 44); - this.lB7SegmentDisplay1.Name = "lB7SegmentDisplay1"; - this.lB7SegmentDisplay1.Renderer = null; - this.lB7SegmentDisplay1.ShowDP = false; - this.lB7SegmentDisplay1.Size = new System.Drawing.Size(32, 50); - this.lB7SegmentDisplay1.TabIndex = 15; - this.lB7SegmentDisplay1.Value = 2; - this.lB7SegmentDisplay1.Click += new System.EventHandler(this.OnObjectClicked); - // - // lB7SegmentDisplay2 - // - this.lB7SegmentDisplay2.BackColor = System.Drawing.Color.Black; - this.lB7SegmentDisplay2.ForeColor = System.Drawing.Color.LawnGreen; - this.lB7SegmentDisplay2.Location = new System.Drawing.Point(148, 104); - this.lB7SegmentDisplay2.Name = "lB7SegmentDisplay2"; - this.lB7SegmentDisplay2.Renderer = null; - this.lB7SegmentDisplay2.ShowDP = false; - this.lB7SegmentDisplay2.Size = new System.Drawing.Size(99, 146); - this.lB7SegmentDisplay2.TabIndex = 16; - this.lB7SegmentDisplay2.Value = 3; - this.lB7SegmentDisplay2.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbLed4 - // - this.lbLed4.BackColor = System.Drawing.Color.Transparent; - this.lbLed4.BlinkInterval = 500; - this.lbLed4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbLed4.ForeColor = System.Drawing.Color.Black; - this.lbLed4.Label = "Fixed & Top"; - this.lbLed4.LabelPosition = LBSoft.IndustrialCtrls.Leds.LBLed.LedLabelPosition.Top; - this.lbLed4.LedColor = System.Drawing.Color.Red; - this.lbLed4.LedSize = new System.Drawing.SizeF(20F, 20F); - this.lbLed4.Location = new System.Drawing.Point(4, 59); - this.lbLed4.Margin = new System.Windows.Forms.Padding(7, 5, 7, 5); - this.lbLed4.Name = "lbLed4"; - this.lbLed4.Renderer = null; - this.lbLed4.Size = new System.Drawing.Size(103, 39); - this.lbLed4.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.On; - this.lbLed4.Style = LBSoft.IndustrialCtrls.Leds.LBLed.LedStyle.Circular; - this.lbLed4.TabIndex = 3; - this.lbLed4.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbLed3 - // - this.lbLed3.BackColor = System.Drawing.Color.Transparent; - this.lbLed3.BlinkInterval = 200; - this.lbLed3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbLed3.ForeColor = System.Drawing.Color.Black; - this.lbLed3.Label = "Left & Blink"; - this.lbLed3.LabelPosition = LBSoft.IndustrialCtrls.Leds.LBLed.LedLabelPosition.Left; - this.lbLed3.LedColor = System.Drawing.Color.Yellow; - this.lbLed3.LedSize = new System.Drawing.SizeF(30F, 30F); - this.lbLed3.Location = new System.Drawing.Point(10, 186); - this.lbLed3.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4); - this.lbLed3.Name = "lbLed3"; - this.lbLed3.Renderer = null; - this.lbLed3.Size = new System.Drawing.Size(112, 39); - this.lbLed3.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - this.lbLed3.Style = LBSoft.IndustrialCtrls.Leds.LBLed.LedStyle.Circular; - this.lbLed3.TabIndex = 2; - this.lbLed3.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbLed2 - // - this.lbLed2.BackColor = System.Drawing.Color.Transparent; - this.lbLed2.BlinkInterval = 500; - this.lbLed2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbLed2.ForeColor = System.Drawing.Color.Black; - this.lbLed2.Label = "Right & Fixed"; - this.lbLed2.LabelPosition = LBSoft.IndustrialCtrls.Leds.LBLed.LedLabelPosition.Right; - this.lbLed2.LedColor = System.Drawing.Color.Lime; - this.lbLed2.LedSize = new System.Drawing.SizeF(20F, 20F); - this.lbLed2.Location = new System.Drawing.Point(10, 118); - this.lbLed2.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); - this.lbLed2.Name = "lbLed2"; - this.lbLed2.Renderer = null; - this.lbLed2.Size = new System.Drawing.Size(112, 29); - this.lbLed2.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - this.lbLed2.Style = LBSoft.IndustrialCtrls.Leds.LBLed.LedStyle.Circular; - this.lbLed2.TabIndex = 1; - this.lbLed2.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbLed1 - // - this.lbLed1.BackColor = System.Drawing.Color.Transparent; - this.lbLed1.BlinkInterval = 500; - this.lbLed1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbLed1.ForeColor = System.Drawing.Color.Black; - this.lbLed1.Label = "Fixed & Bottom"; - this.lbLed1.LabelPosition = LBSoft.IndustrialCtrls.Leds.LBLed.LedLabelPosition.Bottom; - this.lbLed1.LedColor = System.Drawing.Color.Red; - this.lbLed1.LedSize = new System.Drawing.SizeF(20F, 20F); - this.lbLed1.Location = new System.Drawing.Point(4, 19); - this.lbLed1.Margin = new System.Windows.Forms.Padding(7, 5, 7, 5); - this.lbLed1.Name = "lbLed1"; - this.lbLed1.Renderer = null; - this.lbLed1.Size = new System.Drawing.Size(103, 39); - this.lbLed1.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - this.lbLed1.Style = LBSoft.IndustrialCtrls.Leds.LBLed.LedStyle.Circular; - this.lbLed1.TabIndex = 0; - this.lbLed1.Click += new System.EventHandler(this.OnObjectClicked); - // - // groupBox2 - // - this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.groupBox2.BackColor = System.Drawing.Color.Transparent; - this.groupBox2.Controls.Add(this.btnRepeat); - this.groupBox2.Controls.Add(this.lbButton3); - this.groupBox2.Controls.Add(this.lbButton2); - this.groupBox2.Controls.Add(this.lbButton1); - this.groupBox2.Location = new System.Drawing.Point(13, 258); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(124, 337); - this.groupBox2.TabIndex = 7; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Buttons"; - // - // btnRepeat - // - this.btnRepeat.BackColor = System.Drawing.Color.Transparent; - this.btnRepeat.ButtonColor = System.Drawing.Color.DodgerBlue; - this.btnRepeat.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnRepeat.Label = "Repeat"; - this.btnRepeat.Location = new System.Drawing.Point(6, 247); - this.btnRepeat.Name = "btnRepeat"; - this.btnRepeat.Renderer = null; - this.btnRepeat.RepeatInterval = 100; - this.btnRepeat.RepeatState = true; - this.btnRepeat.Size = new System.Drawing.Size(103, 70); - this.btnRepeat.StartRepeatInterval = 500; - this.btnRepeat.State = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Normal; - this.btnRepeat.Style = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonStyle.Rectangular; - this.btnRepeat.TabIndex = 3; - this.btnRepeat.ButtonChangeState += new LBSoft.IndustrialCtrls.Buttons.ButtonChangeState(this.btnRepeat_ButtonChangeState); - this.btnRepeat.ButtonRepeatState += new LBSoft.IndustrialCtrls.Buttons.ButtonRepeatState(this.btnRepeat_ButtonRepeatState); - this.btnRepeat.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbButton3 - // - this.lbButton3.BackColor = System.Drawing.Color.Transparent; - this.lbButton3.ButtonColor = System.Drawing.Color.Yellow; - this.lbButton3.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbButton3.Label = "Warn"; - this.lbButton3.Location = new System.Drawing.Point(15, 171); - this.lbButton3.Name = "lbButton3"; - this.lbButton3.Renderer = null; - this.lbButton3.RepeatInterval = 100; - this.lbButton3.RepeatState = false; - this.lbButton3.Size = new System.Drawing.Size(103, 70); - this.lbButton3.StartRepeatInterval = 500; - this.lbButton3.State = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Normal; - this.lbButton3.Style = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonStyle.Circular; - this.lbButton3.TabIndex = 2; - this.lbButton3.ButtonChangeState += new LBSoft.IndustrialCtrls.Buttons.ButtonChangeState(this.OnWarnStateChanged); - this.lbButton3.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbButton2 - // - this.lbButton2.BackColor = System.Drawing.Color.Transparent; - this.lbButton2.ButtonColor = System.Drawing.Color.Green; - this.lbButton2.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbButton2.Label = "Start"; - this.lbButton2.Location = new System.Drawing.Point(15, 95); - this.lbButton2.Name = "lbButton2"; - this.lbButton2.Renderer = null; - this.lbButton2.RepeatInterval = 100; - this.lbButton2.RepeatState = false; - this.lbButton2.Size = new System.Drawing.Size(103, 70); - this.lbButton2.StartRepeatInterval = 500; - this.lbButton2.State = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Normal; - this.lbButton2.Style = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonStyle.Elliptical; - this.lbButton2.TabIndex = 1; - this.lbButton2.ButtonChangeState += new LBSoft.IndustrialCtrls.Buttons.ButtonChangeState(this.OnStartStateChanged); - this.lbButton2.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbButton1 - // - this.lbButton1.BackColor = System.Drawing.Color.Transparent; - this.lbButton1.ButtonColor = System.Drawing.Color.Red; - this.lbButton1.Font = new System.Drawing.Font("Microsoft Sans Serif", 39.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbButton1.Label = "Stop"; - this.lbButton1.Location = new System.Drawing.Point(15, 19); - this.lbButton1.Name = "lbButton1"; - this.lbButton1.Renderer = null; - this.lbButton1.RepeatInterval = 100; - this.lbButton1.RepeatState = false; - this.lbButton1.Size = new System.Drawing.Size(103, 70); - this.lbButton1.StartRepeatInterval = 500; - this.lbButton1.State = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Normal; - this.lbButton1.Style = LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonStyle.Rectangular; - this.lbButton1.TabIndex = 0; - this.lbButton1.ButtonChangeState += new LBSoft.IndustrialCtrls.Buttons.ButtonChangeState(this.OnStopStateChanged); - this.lbButton1.Click += new System.EventHandler(this.OnObjectClicked); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(72, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(93, 29); - this.label1.TabIndex = 10; - this.label1.Text = "Analog meter with default renderer"; - this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(280, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(93, 29); - this.label2.TabIndex = 11; - this.label2.Text = "Analog meter with custom renderer"; - this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // label3 - // - this.label3.Location = new System.Drawing.Point(479, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(93, 29); - this.label3.TabIndex = 12; - this.label3.Text = "Knob for change the analog values"; - this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter; - // - // propertyGrid1 - // - this.propertyGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.propertyGrid1.HelpVisible = false; - this.propertyGrid1.Location = new System.Drawing.Point(424, 258); - this.propertyGrid1.Name = "propertyGrid1"; - this.propertyGrid1.Size = new System.Drawing.Size(251, 337); - this.propertyGrid1.TabIndex = 13; - this.propertyGrid1.ToolbarVisible = false; - // - // labelCurrCtrl - // - this.labelCurrCtrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelCurrCtrl.Location = new System.Drawing.Point(420, 233); - this.labelCurrCtrl.Name = "labelCurrCtrl"; - this.labelCurrCtrl.Size = new System.Drawing.Size(257, 14); - this.labelCurrCtrl.TabIndex = 14; - this.labelCurrCtrl.Text = "Click to the controls to view the properties"; - // - // lbDigitalMeter1 - // - this.lbDigitalMeter1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lbDigitalMeter1.BackColor = System.Drawing.Color.Black; - this.lbDigitalMeter1.ForeColor = System.Drawing.Color.Red; - this.lbDigitalMeter1.Format = "0000.00"; - this.lbDigitalMeter1.Location = new System.Drawing.Point(441, 147); - this.lbDigitalMeter1.Name = "lbDigitalMeter1"; - this.lbDigitalMeter1.Renderer = null; - this.lbDigitalMeter1.Signed = false; - this.lbDigitalMeter1.Size = new System.Drawing.Size(233, 71); - this.lbDigitalMeter1.TabIndex = 15; - this.lbDigitalMeter1.Value = 0; - this.lbDigitalMeter1.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbAnalogMeter2 - // - this.lbAnalogMeter2.BackColor = System.Drawing.Color.Transparent; - this.lbAnalogMeter2.BodyColor = System.Drawing.Color.DodgerBlue; - this.lbAnalogMeter2.Location = new System.Drawing.Point(12, 32); - this.lbAnalogMeter2.MaxValue = 100; - this.lbAnalogMeter2.MeterStyle = LBSoft.IndustrialCtrls.Meters.LBAnalogMeter.AnalogMeterStyle.Circular; - this.lbAnalogMeter2.MinValue = 0; - this.lbAnalogMeter2.Name = "lbAnalogMeter2"; - this.lbAnalogMeter2.NeedleColor = System.Drawing.Color.Yellow; - this.lbAnalogMeter2.Renderer = null; - this.lbAnalogMeter2.ScaleColor = System.Drawing.Color.GreenYellow; - this.lbAnalogMeter2.ScaleDivisions = 11; - this.lbAnalogMeter2.ScaleSubDivisions = 10; - this.lbAnalogMeter2.Size = new System.Drawing.Size(211, 201); - this.lbAnalogMeter2.TabIndex = 9; - this.lbAnalogMeter2.Value = 0; - this.lbAnalogMeter2.ViewGlass = true; - this.lbAnalogMeter2.Click += new System.EventHandler(this.OnObjectClicked); - // - // lbKnob1 - // - this.lbKnob1.BackColor = System.Drawing.Color.Transparent; - this.lbKnob1.DrawRatio = 0.415F; - this.lbKnob1.IndicatorColor = System.Drawing.Color.DarkRed; - this.lbKnob1.IndicatorOffset = 8F; - this.lbKnob1.KnobCenter = ((System.Drawing.PointF)(resources.GetObject("lbKnob1.KnobCenter"))); - this.lbKnob1.KnobColor = System.Drawing.Color.DarkOrange; - this.lbKnob1.KnobRect = ((System.Drawing.RectangleF)(resources.GetObject("lbKnob1.KnobRect"))); - this.lbKnob1.Location = new System.Drawing.Point(485, 32); - this.lbKnob1.MaxValue = 100F; - this.lbKnob1.MinValue = 0F; - this.lbKnob1.Name = "lbKnob1"; - this.lbKnob1.Renderer = null; - this.lbKnob1.ScaleColor = System.Drawing.Color.DimGray; - this.lbKnob1.Size = new System.Drawing.Size(87, 83); - this.lbKnob1.StepValue = 0.2F; - this.lbKnob1.Style = LBSoft.IndustrialCtrls.Knobs.LBKnob.KnobStyle.Circular; - this.lbKnob1.TabIndex = 8; - this.lbKnob1.Value = 0F; - this.lbKnob1.Click += new System.EventHandler(this.OnObjectClicked); - this.lbKnob1.KnobChangeValue += new LBSoft.IndustrialCtrls.Knobs.KnobChangeValue(this.OnKnobChangeValue); - // - // lbAnalogMeter1 - // - this.lbAnalogMeter1.BackColor = System.Drawing.Color.Transparent; - this.lbAnalogMeter1.BodyColor = System.Drawing.Color.DodgerBlue; - this.lbAnalogMeter1.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbAnalogMeter1.ForeColor = System.Drawing.Color.Red; - this.lbAnalogMeter1.Location = new System.Drawing.Point(228, 32); - this.lbAnalogMeter1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.lbAnalogMeter1.MaxValue = 100; - this.lbAnalogMeter1.MeterStyle = LBSoft.IndustrialCtrls.Meters.LBAnalogMeter.AnalogMeterStyle.Circular; - this.lbAnalogMeter1.MinValue = 0; - this.lbAnalogMeter1.Name = "lbAnalogMeter1"; - this.lbAnalogMeter1.NeedleColor = System.Drawing.Color.Yellow; - this.lbAnalogMeter1.Renderer = null; - this.lbAnalogMeter1.ScaleColor = System.Drawing.Color.GreenYellow; - this.lbAnalogMeter1.ScaleDivisions = 11; - this.lbAnalogMeter1.ScaleSubDivisions = 5; - this.lbAnalogMeter1.Size = new System.Drawing.Size(206, 201); - this.lbAnalogMeter1.TabIndex = 2; - this.lbAnalogMeter1.Value = 0; - this.lbAnalogMeter1.ViewGlass = true; - this.lbAnalogMeter1.Click += new System.EventHandler(this.OnObjectClicked); - // - // MainForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.DarkKhaki; - this.ClientSize = new System.Drawing.Size(688, 607); - this.Controls.Add(this.lbDigitalMeter1); - this.Controls.Add(this.labelCurrCtrl); - this.Controls.Add(this.propertyGrid1); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.lbAnalogMeter2); - this.Controls.Add(this.lbKnob1); - this.Controls.Add(this.groupBox2); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.lbAnalogMeter1); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "MainForm"; - this.Text = "TestApp"; - this.groupBox1.ResumeLayout(false); - this.groupBox2.ResumeLayout(false); - this.ResumeLayout(false); - - } - private System.Windows.Forms.Label labelCurrCtrl; - private System.Windows.Forms.PropertyGrid propertyGrid1; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label1; - private LBSoft.IndustrialCtrls.Leds.LBLed lbLed4; - private LBSoft.IndustrialCtrls.Meters.LBAnalogMeter lbAnalogMeter2; - private LBSoft.IndustrialCtrls.Knobs.LBKnob lbKnob1; - private LBSoft.IndustrialCtrls.Buttons.LBButton lbButton1; - private LBSoft.IndustrialCtrls.Buttons.LBButton lbButton2; - private LBSoft.IndustrialCtrls.Buttons.LBButton lbButton3; - private LBSoft.IndustrialCtrls.Leds.LBLed lbLed1; - private LBSoft.IndustrialCtrls.Leds.LBLed lbLed2; - private LBSoft.IndustrialCtrls.Leds.LBLed lbLed3; - private System.Windows.Forms.GroupBox groupBox2; - private System.Windows.Forms.GroupBox groupBox1; - private LBSoft.IndustrialCtrls.Meters.LBAnalogMeter lbAnalogMeter1; - - void OnWarnStateChanged(object sender, LBSoft.IndustrialCtrls.Buttons.LBButtonEventArgs e) - { - if ( e.State == LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Pressed ) - this.lbLed3.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Blink; - else - this.lbLed3.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - } - - void OnStartStateChanged(object sender, LBSoft.IndustrialCtrls.Buttons.LBButtonEventArgs e) - { - if ( e.State == LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Pressed ) - this.lbLed2.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.On; - else - this.lbLed2.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - } - - void OnStopStateChanged(object sender, LBSoft.IndustrialCtrls.Buttons.LBButtonEventArgs e) - { - if ( e.State == LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Pressed ) - { - this.lbLed1.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.On; - this.lbLed4.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - } - else - { - this.lbLed1.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.Off; - this.lbLed4.State = LBSoft.IndustrialCtrls.Leds.LBLed.LedState.On; - } - } - - void OnKnobChangeValue(object sender, LBSoft.IndustrialCtrls.Knobs.LBKnobEventArgs e) - { - this.lbAnalogMeter1.Value = e.Value; - this.lbAnalogMeter2.Value = e.Value; - this.lbDigitalMeter1.Value = e.Value * 10; - - int v = (int)(e.Value / 10) - 1; - if ( v < 0 ) - v = 0; - if ( v > 9 ) - v = 9; - this.lB7SegmentDisplay1.Value = v; - this.lB7SegmentDisplay2.Value = v; - } - - void OnObjectClicked(object sender, System.EventArgs e) - { - this.propertyGrid1.CollapseAllGridItems(); - this.propertyGrid1.Refresh(); - - this.propertyGrid1.SelectedObject = sender; - } - - private LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay lB7SegmentDisplay1; - private LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay lB7SegmentDisplay2; - private Label label4; - private LBSoft.IndustrialCtrls.Meters.LBDigitalMeter lbDigitalMeter1; - private LBSoft.IndustrialCtrls.Leds.LB7SegmentDisplay sdRepeat; - private LBSoft.IndustrialCtrls.Buttons.LBButton btnRepeat; - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.cs b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.cs deleted file mode 100644 index fe5be26..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 03/04/2008 - * Ora: 14.34 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Windows.Forms; -using LBSoft.IndustrialCtrls; -using LBSoft.IndustrialCtrls.Meters; -using LBSoft.IndustrialCtrls.Utils; - -namespace TestApp -{ - /// - /// Description of MainForm. - /// - public partial class MainForm : Form - { - private LBMyAnalogMeterRenderer myRenderer; - - public MainForm() - { - // - // The InitializeComponent() call is required for Windows Forms designer support. - // - InitializeComponent(); - - this.myRenderer = new LBMyAnalogMeterRenderer(); - - LBMeterThreshold threshold = new LBMeterThreshold(); - threshold.Color = Color.Yellow; - threshold.StartValue = 50; - threshold.EndValue = 70; - this.lbAnalogMeter1.Thresholds.Add ( threshold ); - threshold = new LBMeterThreshold(); - threshold.Color = Color.Red; - threshold.StartValue = 70; - threshold.EndValue = 100; - this.lbAnalogMeter1.Thresholds.Add ( threshold ); - this.lbAnalogMeter1.Renderer = this.myRenderer; - - threshold = new LBMeterThreshold(); - threshold.Color = Color.Yellow; - threshold.StartValue = 50; - threshold.EndValue = 70; - this.lbAnalogMeter2.Thresholds.Add ( threshold ); - threshold = new LBMeterThreshold(); - threshold.Color = Color.Red; - threshold.StartValue = 70; - threshold.EndValue = 100; - this.lbAnalogMeter2.Thresholds.Add ( threshold ); - } - - private void btnRepeat_ButtonChangeState(object sender, LBSoft.IndustrialCtrls.Buttons.LBButtonEventArgs e) - { - if (e.State != LBSoft.IndustrialCtrls.Buttons.LBButton.ButtonState.Normal) - return; - - this.sdRepeat.Value = 0; - } - - private void btnRepeat_ButtonRepeatState(object sender, LBSoft.IndustrialCtrls.Buttons.LBButtonEventArgs e) - { - int v = this.sdRepeat.Value; - v++; - if (v > 9) - v = 0; - - this.sdRepeat.Value = v; - } - } - - /// - /// Custom renderer class - /// - public class LBMyAnalogMeterRenderer : LBAnalogMeterRenderer - { - public override bool DrawBody( Graphics Gr, RectangleF rc ) - { - return true; - } - - public override bool DrawGlass( Graphics Gr, RectangleF rc ) - { - return true; - } - - public override bool DrawDivisions( Graphics Gr, RectangleF rc ) - { - if ( this.AnalogMeter == null ) - return false; - - float startAngle = this.AnalogMeter.GetStartAngle(); - float endAngle = this.AnalogMeter.GetEndAngle(); - float scaleDivisions = this.AnalogMeter.ScaleDivisions; - float scaleSubDivisions = this.AnalogMeter.ScaleSubDivisions; - double minValue = this.AnalogMeter.MinValue; - double maxValue = this.AnalogMeter.MaxValue; - Color scaleColor = this.AnalogMeter.ScaleColor; - - float cx = needleCenter.X; - float cy = needleCenter.Y; - float w = rc.Width; - float h = rc.Height; - - float incr = LBMath.GetRadian(( endAngle - startAngle ) / (( scaleDivisions - 1 )* (scaleSubDivisions + 1))); - float currentAngle = LBMath.GetRadian( startAngle ); - float radius = (float)(w / 2 - ( w * 0.08)); - float rulerValue = (float)minValue; - - Pen pen = new Pen ( scaleColor, ( 2 * drawRatio ) ); - SolidBrush br = new SolidBrush ( scaleColor ); - - PointF ptStart = new PointF(0,0); - PointF ptEnd = new PointF(0,0); - PointF ptCenter = new PointF(0,0); - RectangleF rcTick = new RectangleF(0,0,0,0); - SizeF sizeMax = new SizeF( 10 * drawRatio, 10 * drawRatio ); - SizeF sizeMin = new SizeF( 4 * drawRatio, 4 * drawRatio ); - - int n = 0; - for( ; n < scaleDivisions; n++ ) - { - //Draw Thick Line - ptCenter.X = (float)(cx + (radius - w/90) * Math.Cos(currentAngle)); - ptCenter.Y = (float)(cy + (radius - w/90) * Math.Sin(currentAngle)); - ptStart.X = ptCenter.X - ( 5 * drawRatio ); - ptStart.Y = ptCenter.Y - ( 5 * drawRatio ); - rcTick.Location = ptStart; - rcTick.Size = sizeMax; - Gr.FillEllipse( br, rcTick ); - - //Draw Strings - Font font = new Font ( this.AnalogMeter.Font.FontFamily, (float)( 8F * drawRatio ), FontStyle.Italic ); - - float tx = (float)(cx + (radius - ( 20 * drawRatio )) * Math.Cos(currentAngle)); - float ty = (float)(cy + (radius - ( 20 * drawRatio )) * Math.Sin(currentAngle)); - double val = Math.Round ( rulerValue ); - String str = String.Format( "{0,0:D}", (int)val ); - - SizeF size = Gr.MeasureString ( str, font ); - Gr.DrawString ( str, - font, - br, - tx - (float)( size.Width * 0.5 ), - ty - (float)( size.Height * 0.5 ) ); - - rulerValue += (float)(( maxValue - minValue) / (scaleDivisions - 1)); - - if ( n == scaleDivisions -1) - break; - - if ( scaleDivisions <= 0 ) - currentAngle += incr; - else - { - for (int j = 0; j <= scaleSubDivisions; j++) - { - currentAngle += incr; - - ptCenter.X = (float)(cx + (radius - w/90) * Math.Cos(currentAngle)); - ptCenter.Y = (float)(cy + (radius - w/90) * Math.Sin(currentAngle)); - ptStart.X = ptCenter.X - ( 2 * drawRatio ); - ptStart.Y = ptCenter.Y - ( 2 * drawRatio ); - rcTick.Location = ptStart; - rcTick.Size = sizeMin; - Gr.FillEllipse( br, rcTick ); - } - } - } - - return true; - } - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.resx b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.resx deleted file mode 100644 index 2674f1e..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/MainForm.resx +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj0yLjAuMC4wLCBDdWx0 - dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJh - d2luZy5Qb2ludEYCAAAAAXgBeQAACwsCAAAAAAAmQgAAIkIL - - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj0yLjAuMC4wLCBDdWx0 - dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABlTeXN0ZW0uRHJh - d2luZy5SZWN0YW5nbGVGBAAAAAF4AXkFd2lkdGgGaGVpZ2h0AAAAAAsLCwsCAAAAzcwEQc3MBEHNzIRC - zcyAQgs= - - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/Program.cs b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/Program.cs deleted file mode 100644 index e76f8ce..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Creato da SharpDevelop. - * Utente: lucabonotto - * Data: 03/04/2008 - * Ora: 14.34 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; -using System.Windows.Forms; - -namespace TestApp -{ - /// - /// Class with program entry point. - /// - internal sealed class Program - { - /// - /// Program entry point. - /// - [STAThread] - private static void Main(string[] args) - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } - - } -} diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/TestApp.csproj b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/TestApp.csproj deleted file mode 100644 index 70bda3e..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/TestApp.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - {AA498353-353F-46AE-B5D5-96A88CBEA6ED} - Debug - AnyCPU - WinExe - TestApp - TestApp - False - False - 4 - false - - - - - 3.5 - v4.5.2 - false - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - bin\Debug\ - true - Full - False - True - DEBUG;TRACE - - - bin\Release\ - False - None - True - False - TRACE - - - False - Auto - 4194304 - AnyCPU - 4096 - - - MinimumRecommendedRules.ruleset - false - - - MinimumRecommendedRules.ruleset - false - - - true - - - - - - - - - - - - - Form - - - MainForm.cs - - - - MainForm.cs - - - - - {B4218BC9-9736-42B9-BC99-7903FDBEBA28} - LBIndustrialCtrls - - - - - False - .NET Framework Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - false - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - \ No newline at end of file diff --git a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/app.config b/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/app.config deleted file mode 100644 index ff99501..0000000 --- a/MidiShapeShifter/LBIndustrialCtrls_src/TestApp/app.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/MidiShapeShifter/MidiShapeShifter.sln b/MidiShapeShifter/MidiShapeShifter.sln index bf70f8e..34e3af9 100644 --- a/MidiShapeShifter/MidiShapeShifter.sln +++ b/MidiShapeShifter/MidiShapeShifter.sln @@ -5,6 +5,7 @@ VisualStudioVersion = 17.2.32519.379 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MidiShapeShifter", "MidiShapeShifter\MidiShapeShifter.csproj", "{D19470F9-7D1E-4385-AD34-C7D826649F89}" ProjectSection(ProjectDependencies) = postProject + {2541686B-1673-43BF-AF89-3163945DB009} = {2541686B-1673-43BF-AF89-3163945DB009} {B4218BC9-9736-42B9-BC99-7903FDBEBA28} = {B4218BC9-9736-42B9-BC99-7903FDBEBA28} EndProjectSection EndProject @@ -18,7 +19,9 @@ Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "MidiShapeShifterInstaller", {D19470F9-7D1E-4385-AD34-C7D826649F89} = {D19470F9-7D1E-4385-AD34-C7D826649F89} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LBIndustrialCtrls", "LBIndustrialCtrls_src\LBIndustrialCtrls\LBIndustrialCtrls.csproj", "{B4218BC9-9736-42B9-BC99-7903FDBEBA28}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LBIndustrialCtrls", "..\SDK\LBIndustrialCtrls\LBIndustrialCtrls\LBIndustrialCtrls.csproj", "{B4218BC9-9736-42B9-BC99-7903FDBEBA28}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZedGraph", "..\SDK\ZedGraphs\ZedGraph.csproj", "{2541686B-1673-43BF-AF89-3163945DB009}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -93,6 +96,22 @@ Global {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Release|Any CPU.Build.0 = Release|Any CPU {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Release|x64.ActiveCfg = Release|Any CPU {B4218BC9-9736-42B9-BC99-7903FDBEBA28}.Release|x64.Build.0 = Release|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.All|Any CPU.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.All|Any CPU.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.All|x64.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.All|x64.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Debug|x64.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Debug|x64.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Deploy|Any CPU.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Deploy|Any CPU.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Deploy|x64.ActiveCfg = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Deploy|x64.Build.0 = Debug|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Release|Any CPU.Build.0 = Release|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Release|x64.ActiveCfg = Release|Any CPU + {2541686B-1673-43BF-AF89-3163945DB009}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MidiShapeShifter/MidiShapeShifter/MidiShapeShifter.csproj b/MidiShapeShifter/MidiShapeShifter/MidiShapeShifter.csproj index 51600dc..0eabd16 100644 --- a/MidiShapeShifter/MidiShapeShifter/MidiShapeShifter.csproj +++ b/MidiShapeShifter/MidiShapeShifter/MidiShapeShifter.csproj @@ -82,10 +82,6 @@ - - False - ..\lib\ZedGraph.dll - @@ -400,10 +396,14 @@ - + {b4218bc9-9736-42b9-bc99-7903fdbeba28} LBIndustrialCtrls + + {2541686b-1673-43bf-af89-3163945db009} + ZedGraph +