Exemplo n.º 1
0
 public void Paint(Graphics g, GraphControl c, bool hover, bool select)
 {
     g.FillEllipse((hover || select) ? c.ModSelectedBrush : Brush, HitRect);
 }
Exemplo n.º 2
0
            public void Paint(Graphics g, GraphControl c, bool hover, bool select)
            {
                var rect = HitRect;
                var x = rect.Left;
                var y = rect.Top;
                var w = rect.Width;
                var h = rect.Height;

                // draw rectangle
                PaintRoundedRect(g, rect, 10, c.ModBack, select ? c.ModSelectedPen : hover ? c.ModHoveredPen:c.ModBorder);

                // draw labels
                g.DrawString(Mod.Name, c.ModHeadFnt, c.ModText, new Rectangle(x + 5, y + 5, w - 10, 20), c.ModHeadFmt);
                for (int i = 0; i < Mod.Params.Length; i++)
                    g.DrawString(Mod.Definition.ParamNames[i], c.ModParamFnt, c.ModText, new PointF(x + 2, y + ParamY + i * ParamH));
            }
Exemplo n.º 3
0
            public TPin(TModule mod, bool output, int index, GraphControl c)
            {
                Module = mod;
                IsOutput = output;
                Index = index;

                if (output)
                {
                    HitRect = new Rectangle(mod.HitRect.Right - 2, mod.HitRect.Top + IOPinY - 4, 7, 7);
                    Brush = mod.Mod.Definition.OutChannels > 1 ? c.ModPinStereo : c.ModPinMono;
                }
                else if (Index>0)
                {
                    HitRect = new Rectangle(mod.HitRect.Left - 4, mod.HitRect.Top + ParamY + (index - 1) * ParamH + ParamPinY - 2, 5, 5);
                    Brush = c.ModPinMono;
                }
                else
                {
                    HitRect = new Rectangle(mod.HitRect.Left - 5, mod.HitRect.Top + IOPinY - 4, 7, 7);
                    Brush = mod.Mod.Definition.InChannels > 1 ? c.ModPinStereo : c.ModPinMono;
                }
            }
Exemplo n.º 4
0
            public TModule(Module mod, GraphControl c, Graphics g)
            {
                var hw = g.MeasureString(mod.Name, c.ModHeadFnt);
                var x = mod.X;
                var y = mod.Y;
                var w = (int)(hw.Width + 15);
                var h = ParamY + ParamH * (mod.Inputs.Length - 1);

                Mod = mod;
                HitRect = new Rectangle(x, y, w, h);
            }
Exemplo n.º 5
0
 public void Paint(Graphics g, GraphControl c, bool hover, bool select)
 {
     g.DrawLines(select ? c.ModSelectedPen : Pen, Points);
 }
Exemplo n.º 6
0
 public TCable(Point a, TModule dest, int index, GraphControl c)
 {
     Dest = dest;
     Index = index;
     var pb = new Point(Dest.HitRect.Left, (index > 0) ? (Dest.HitRect.Top + ParamY + ParamPinY + ParamH * (Index - 1)) : (Dest.HitRect.Top + IOPinY));
     Layout(a, pb, 0, 0, Dest.HitRect.Top, Dest.HitRect.Bottom);
     HitRect = RectFromPoints(Points, 2);
 }
Exemplo n.º 7
0
 public TCable(TModule src, Point b, GraphControl c)
 {
     Src = src;
     var pa = new Point(Src.HitRect.Right, Src.HitRect.Top + IOPinY);
     Layout(pa, b, Src.HitRect.Top, Src.HitRect.Bottom, 0, 0);
     HitRect = RectFromPoints(Points, 2);
 }
Exemplo n.º 8
0
            public TCable(TModule src, TModule dest, int index, GraphControl c)
            {
                Src = src;
                Dest = dest;
                Index = index;

                var pa = new Point(Src.HitRect.Right,Src.HitRect.Top + IOPinY);
                var pb = new Point(Dest.HitRect.Left,(index>0)?(Dest.HitRect.Top + ParamY + ParamPinY + ParamH * (Index - 1)):(Dest.HitRect.Top + IOPinY));

                Layout(pa, pb, Src.HitRect.Top, Src.HitRect.Bottom, Dest.HitRect.Top, Dest.HitRect.Bottom);
                Pen = Src.Mod.Definition.OutChannels > 1 ? c.CableStereo : c.CableMono;
                HitRect = RectFromPoints(Points, 2);
            }