Forex_Strategy_Builder.Chart.ShortcutKeyUp C# (CSharp) Метод

ShortcutKeyUp() приватный Метод

Shortcut keys
private ShortcutKeyUp ( KeyEventArgs e ) : void
e System.Windows.Forms.KeyEventArgs
Результат void
        void ShortcutKeyUp(KeyEventArgs e)
        {
            // Zoom in
            if (!e.Control && (e.KeyCode == Keys.Add || e.KeyCode == Keys.Oemplus))
            {
                ZoomIn();
            }
            // Zoom out
            else if (!e.Control && (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.OemMinus))
            {
                ZoomOut();
            }
            // Vertical scale increase
            else if (e.Control && (e.KeyCode == Keys.Subtract || e.KeyCode == Keys.OemMinus))
            {
                VerticalScaleIncrease();
            }
            // Vertical scale decrease
            else if (e.Control && (e.KeyCode == Keys.Add || e.KeyCode == Keys.Oemplus))
            {
                VerticalScaleDecrease();
            }
            else if (e.KeyCode == Keys.Space)
            {
                isCandleChart = !isCandleChart;
                pnlPrice.Invalidate();
            }
            // Dynamic info scroll up
            else if (e.KeyCode == Keys.A)
            {
                if (!isInfoPanelShown)
                    return;
                dynInfoScrollValue -= 5;
                dynInfoScrollValue = dynInfoScrollValue < 0 ? 0 : dynInfoScrollValue;
                pnlInfo.Invalidate();

            }
            // Dynamic info scroll up fast
            else if (e.KeyCode == Keys.S)
            {
                if (!isInfoPanelShown)
                    return;
                dynInfoScrollValue -= 10;
                dynInfoScrollValue = dynInfoScrollValue < 0 ? 0 : dynInfoScrollValue;
                pnlInfo.Invalidate();

            }
            // Dynamic info scroll down
            else if (e.KeyCode == Keys.Z)
            {
                if (!isInfoPanelShown)
                    return;
                dynInfoScrollValue += 5;
                dynInfoScrollValue = dynInfoScrollValue > infoRows - 5 ? infoRows - 5 : dynInfoScrollValue;
                pnlInfo.Invalidate();
            }
            // Dynamic info scroll down fast
            else if (e.KeyCode == Keys.X)
            {
                if (!isInfoPanelShown)
                    return;
                dynInfoScrollValue += 10;
                dynInfoScrollValue = dynInfoScrollValue > infoRows - 5 ? infoRows - 5 : dynInfoScrollValue;
                pnlInfo.Invalidate();
            }
            // Grid
            else if (e.KeyCode == Keys.G)
            {
                isGridShown = !isGridShown;
                aChartButtons[(int)ChartButtons.Grid].Checked = isGridShown;
                InvalidateAllPanels();
            }
            // Cross
            else if (e.KeyCode == Keys.C)
            {
                isCrossShown = !isCrossShown;
                aChartButtons[(int)ChartButtons.Cross].Checked = isCrossShown;
                pnlPrice.Cursor = isCrossShown ? Cursors.Cross : Cursors.Default;
                InvalidateAllPanels();
            }
            // Volume
            else if (e.KeyCode == Keys.V)
            {
                isVolumeShown = !isVolumeShown;
                aChartButtons[(int)ChartButtons.Volume].Checked = isVolumeShown;
                pnlPrice.Invalidate();
            }
            // Lots
            else if (e.KeyCode == Keys.L)
            {
                isPositionLotsShown = !isPositionLotsShown;
                aChartButtons[(int)ChartButtons.PositionLots].Checked = isPositionLotsShown;
                pnlPrice.Invalidate();
            }
            // Orders
            else if (e.KeyCode == Keys.O)
            {
                isOrdersShown = !isOrdersShown;
                aChartButtons[(int)ChartButtons.Orders].Checked = isOrdersShown;
                pnlPrice.Invalidate();
            }
            // Position price
            else if (e.KeyCode == Keys.P)
            {
                isPositionPriceShown = !isPositionPriceShown;
                aChartButtons[(int)ChartButtons.PositionPrice].Checked = isPositionPriceShown;
                pnlPrice.Invalidate();
            }
            // Ambiguous bars mark
            else if (e.KeyCode == Keys.M)
            {
                isAmbiguousBarsShown = !isAmbiguousBarsShown;
                aChartButtons[(int)ChartButtons.AmbiguousBars].Checked = isAmbiguousBarsShown;
                pnlPrice.Invalidate();
            }
            // True Charts
            else if (e.KeyCode == Keys.T)
            {
                isTrueChartsShown = !isTrueChartsShown;
                aChartButtons[(int)ChartButtons.TrueCharts].Checked = isTrueChartsShown;
                InvalidateAllPanels();
            }
            // Indicator Charts
            else if (e.KeyCode == Keys.D)
            {
                isIndicatorsShown = !isIndicatorsShown;
                aChartButtons[(int)ChartButtons.Indicators].Checked = isIndicatorsShown;
                if (isIndicatorsShown)
                {
                    scroll.Parent = null;
                    for (int i = 0; i < indPanels; i++)
                    {
                        splitterInd[i].Parent = pnlCharts;
                        pnlInd[i].Parent = pnlCharts;
                    }
                    scroll.Parent = pnlCharts;
                }
                else
                {
                    for (int i = 0; i < indPanels; i++)
                    {
                        pnlInd[i].Parent = null;
                        splitterInd[i].Parent = null;
                    }
                }
                SetAllPanelsHeight();
                InvalidateAllPanels();
                scroll.Focus();
            }
            // FloatingPL Charts
            else if (e.KeyCode == Keys.F)
            {
                isFloatingPLShown = !isFloatingPLShown;
                aChartButtons[(int)ChartButtons.FloatingPL].Checked = isFloatingPLShown;
                if (isFloatingPLShown)
                {
                    scroll.Parent = null;
                    spliterFloatingPL.Parent = pnlCharts;
                    pnlFloatingPLChart.Parent = pnlCharts;
                    scroll.Parent = pnlCharts;
                }
                else
                {
                    spliterFloatingPL.Parent = null;
                    pnlFloatingPLChart.Parent = null;
                }
                SetAllPanelsHeight();
                InvalidateAllPanels();
                scroll.Focus();
            }
            // Balance/Equity Charts
            else if (e.KeyCode == Keys.B)
            {
                isBalanceEquityShown = !isBalanceEquityShown;
                aChartButtons[(int)ChartButtons.BalanceEquity].Checked = isBalanceEquityShown;
                if (isBalanceEquityShown)
                {
                    scroll.Parent = null;
                    spliterBalance.Parent = pnlCharts;
                    pnlBalanceChart.Parent = pnlCharts;
                    scroll.Parent = pnlCharts;
                }
                else
                {
                    spliterBalance.Parent = null;
                    pnlBalanceChart.Parent = null;
                }
                SetAllPanelsHeight();
                InvalidateAllPanels();
                scroll.Focus();
            }
            // Show info panel
            else if (e.KeyCode == Keys.I)
            {
                isInfoPanelShown = !isInfoPanelShown;
                pnlInfo.Visible   = isInfoPanelShown;
                pnlCharts.Padding = isInfoPanelShown ? new Padding(0, 0, 2, 0) : new Padding(0);
                Text = isInfoPanelShown ? Language.T("Chart") + " " + Data.Symbol + " " + Data.PeriodString : Data.ProgramName + @"   http://forexsb.com";
                aChartButtons[(int)ChartButtons.DynamicInfo].Checked = isInfoPanelShown;
                aChartButtons[(int)ChartButtons.DInfoUp].Visible     = isInfoPanelShown;
                aChartButtons[(int)ChartButtons.DInfoDwn].Visible    = isInfoPanelShown;
                if (isInfoPanelShown)
                {
                    GenerateDynamicInfo(lastBar);
                    SetupDynamicInfo();
                    isDrawDinInfo = true;
                    pnlInfo.Invalidate();
                }
            }
            // Debug
            else if (e.KeyCode == Keys.F12)
            {
                isDEBUG = !isDEBUG;
                SetupDynInfoWidth();
                SetupDynamicInfo();
                pnlInfo.Invalidate();
            }

            return;
        }