Exemplo n.º 1
0
        public QuotePartButton(float scaleX, float scaleY, BrushesStorage brushes, PenStorage pens, bool isLeft = true)
        {
            brushesStor = brushes;
            pensStor    = pens;
            colorScheme.Add(ButtonFigureColorScheme.Normal, Color.FromArgb(255, 180, 247, 180));
            colorScheme.Add(ButtonFigureColorScheme.Pressed, Color.FromArgb(255, 200, 247, 210));
            colorScheme.Add(ButtonFigureColorScheme.Light, Color.FromArgb(255, 160, 195, 180));

            currentBrush = brushesStor.GetBrush(colorScheme[ButtonFigureColorScheme.Normal]) as SolidBrush;

            ScaleX          = scaleX;
            ScaleY          = scaleY;
            this.isLeft     = isLeft;
            translateMatrix = new Matrix();

            string buySellIndicatorHaderText;

            if (isLeft)
            {
                translateMatrix.Translate(paddingLeftRightProportion / 2, PaddingTopProportion);
                buySellIndicatorHaderText = "Bid";
            }
            else
            {
                translateMatrix.Translate(QuotePartButtonFigure.OriginalWidth * 2 + paddingLeftRightProportion / 2, PaddingTopProportion);
                translateMatrix.Scale(-1, 1);
                buySellIndicatorHaderText = "Ask";
            }

            buySellIndicator = new BuySellIndicator
            {
                ScaleX           = scaleX,
                ScaleY           = scaleY,
                OriginalLocation = isLeft
                                            ?
                                   new Point(
                    Convert.ToInt32(paddingLeftRightProportion),
                    Convert.ToInt32(PaddingTopProportion + PaddingTopBuySellIndicator))
                                            :
                                   new Point(
                    Convert.ToInt32(QuotePartButtonFigure.OriginalWidth + paddingLeftRightProportion),
                    Convert.ToInt32(PaddingTopProportion + PaddingTopBuySellIndicator)),
                HaderText = buySellIndicatorHaderText,
                Volume    = null
            };


            arrowTrend = new ArrowTrend
            {
                Sx               = ScaleX,
                Sy               = ScaleY,
                Brushes          = brushes,
                Pens             = pens,
                OriginalLocation = isLeft ? new PointF(QuotePartButtonFigure.OriginalWidth - paddingLeftRightProportion - 2, PaddingTopArrow) :
                                   new PointF(QuotePartButtonFigure.OriginalWidth * 2 - paddingLeftRightProportion - 2, PaddingTopArrow)
            };
        }
Exemplo n.º 2
0
        public QuotePartButton(float scaleX, float scaleY, BrushesStorage brushes, PenStorage pens, bool isLeft = true)
        {
            brushesStor = brushes;
            pensStor = pens;
            colorScheme.Add(ButtonFigureColorScheme.Normal, Color.FromArgb(255, 180, 247, 180));
            colorScheme.Add(ButtonFigureColorScheme.Pressed, Color.FromArgb(255, 200, 247, 210));
            colorScheme.Add(ButtonFigureColorScheme.Light, Color.FromArgb(255, 160, 195, 180));

            currentBrush = brushesStor.GetBrush(colorScheme[ButtonFigureColorScheme.Normal]) as SolidBrush;

            ScaleX = scaleX;
            ScaleY = scaleY;
            this.isLeft = isLeft;
            translateMatrix = new Matrix();

            string buySellIndicatorHaderText;
            if (isLeft)
            {
                translateMatrix.Translate(paddingLeftRightProportion / 2, PaddingTopProportion);
                buySellIndicatorHaderText = "Bid";
            }
            else
            {
                translateMatrix.Translate(QuotePartButtonFigure.OriginalWidth * 2 + paddingLeftRightProportion / 2, PaddingTopProportion);
                translateMatrix.Scale(-1, 1);
                buySellIndicatorHaderText = "Ask";
            }

            buySellIndicator = new BuySellIndicator
                                   {
                                       ScaleX = scaleX,
                                       ScaleY = scaleY,
                                       OriginalLocation = isLeft
                                            ?
                                            new Point(
                                                Convert.ToInt32(paddingLeftRightProportion),
                                                Convert.ToInt32(PaddingTopProportion + PaddingTopBuySellIndicator))
                                            :
                                            new Point(
                                                Convert.ToInt32(QuotePartButtonFigure.OriginalWidth + paddingLeftRightProportion),
                                                Convert.ToInt32(PaddingTopProportion + PaddingTopBuySellIndicator)),
                                       HaderText = buySellIndicatorHaderText,
                                       Volume = null
                                   };

            arrowTrend = new ArrowTrend
                             {
                                 Sx = ScaleX,
                                 Sy = ScaleY,
                                 Brushes = brushes,
                                 Pens = pens,
                                 OriginalLocation = isLeft ? new PointF(QuotePartButtonFigure.OriginalWidth - paddingLeftRightProportion - 2, PaddingTopArrow) :
                                                             new PointF(QuotePartButtonFigure.OriginalWidth * 2 - paddingLeftRightProportion - 2, PaddingTopArrow)
                             };
        }