コード例 #1
0
        /// <summary>
        ///     Initialize the controls in panel pnlMarket
        /// </summary>
        private void InitializeMarket()
        {
            var toolTip = new ToolTip();

            // Symbol
            ComboBoxSymbol = new ToolStripComboBox
            {
                Name          = "ComboBoxSymbol",
                AutoSize      = false,
                DropDownStyle = ComboBoxStyle.DropDownList,
                ToolTipText   = Language.T("Symbol"),
                Overflow      = ToolStripItemOverflow.Never
            };
            foreach (string symbol in Instruments.SymbolList)
            {
                ComboBoxSymbol.Items.Add(symbol);
            }
            ComboBoxSymbol.SelectedIndex         = 0;
            ComboBoxSymbol.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxSymbol);

            // Period
            var periods = new[]
            {
                "  1 " + Language.T("Minute"),
                "  5 " + Language.T("Minutes"),
                "15 " + Language.T("Minutes"),
                "30 " + Language.T("Minutes"),
                "  1 " + Language.T("Hour"),
                "  4 " + Language.T("Hours"),
                "  1 " + Language.T("Day"),
                "  1 " + Language.T("Week")
            };

            ComboBoxPeriod = new ToolStripComboBox
            {
                Name          = "ComboBoxPeriod",
                AutoSize      = false,
                DropDownStyle = ComboBoxStyle.DropDownList,
                ToolTipText   = Language.T("Data time frame."),
                Overflow      = ToolStripItemOverflow.Never
            };
            foreach (string period in periods)
            {
                ComboBoxPeriod.Items.Add(period);
            }
            ComboBoxPeriod.SelectedIndex         = 6;
            ComboBoxPeriod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxPeriod);

            // Button Market Properties
            ButtonCharges = new ToolStripButton
            {
                Text        = Language.T("Charges"),
                Name        = "Charges",
                ToolTipText = Language.T("Spread, Swap numbers, Slippage."),
                Overflow    = ToolStripItemOverflow.Never
            };
            ButtonCharges.Click += BtnToolsOnClick;
            ToolStripMarket.Items.Add(ButtonCharges);

            ToolStripMarket.Resize += TsMarketResize;

            // Info Panel Market Statistics
            InfoPanelMarketStatistics = new InfoPanel {
                Parent = PanelMarket, Dock = DockStyle.Fill
            };

            // Splitter
            new Splitter {
                Parent = PanelMarket, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap
            };

            // Panel Charts Base
            marketChartsBase = new Panel
            {
                Parent      = PanelMarket,
                Dock        = DockStyle.Bottom,
                MinimumSize = new Size(100, 50)
            };

            // Small Indicator Chart
            IndicatorChart = new SmallIndicatorChart
            {
                Parent                 = marketChartsBase,
                Cursor                 = Cursors.Hand,
                Dock                   = DockStyle.Fill,
                ShowDynamicInfo        = true,
                IsContextButtonVisible = true
            };
            IndicatorChart.PopUpContextMenu.Items.AddRange(GetIndicatorChartContextMenuItems());
            IndicatorChart.MouseUp    += IndicatorChartMouseUp;
            IndicatorChart.MouseMove  += IndicatorChartMouseMove;
            IndicatorChart.MouseLeave += IndicatorChartMouseLeave;
            toolTip.SetToolTip(IndicatorChart, Language.T("Click to view the full chart."));

            // Small Histogram Chart
            HistogramChart = new SmallHistogramChart
            {
                Parent                 = marketChartsBase,
                Dock                   = DockStyle.Fill,
                ShowDynamicInfo        = true,
                Visible                = false,
                IsContextButtonVisible = true
            };
            HistogramChart.PopUpContextMenu.Items.AddRange(GetHistogramChartContextMenuItems());
            HistogramChart.AddContextMenuItems();
            HistogramChart.MouseMove  += HistogramChartMouseMove;
            HistogramChart.MouseLeave += IndicatorChartMouseLeave;

            PanelMarket.Resize += PnlMarketResize;
        }
コード例 #2
0
        /// <summary>
        ///     Initialize the controls in panel pnlMarket
        /// </summary>
        private void InitializeMarket()
        {
            var toolTip = new ToolTip();

            // Symbol
            ComboBoxSymbol = new ToolStripComboBox
                {
                    Name = "ComboBoxSymbol",
                    AutoSize = false,
                    DropDownStyle = ComboBoxStyle.DropDownList,
                    ToolTipText = Language.T("Symbol"),
                    Overflow = ToolStripItemOverflow.Never
                };
            foreach (string symbol in Instruments.SymbolList)
                ComboBoxSymbol.Items.Add(symbol);
            ComboBoxSymbol.SelectedIndex = 0;
            ComboBoxSymbol.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxSymbol);

            // Period
            var periods = new[]
                {
                    "  1 " + Language.T("Minute"),
                    "  5 " + Language.T("Minutes"),
                    "15 " + Language.T("Minutes"),
                    "30 " + Language.T("Minutes"),
                    "  1 " + Language.T("Hour"),
                    "  4 " + Language.T("Hours"),
                    "  1 " + Language.T("Day"),
                    "  1 " + Language.T("Week")
                };
            ComboBoxPeriod = new ToolStripComboBox
                {
                    Name = "ComboBoxPeriod",
                    AutoSize = false,
                    DropDownStyle = ComboBoxStyle.DropDownList,
                    ToolTipText = Language.T("Data time frame."),
                    Overflow = ToolStripItemOverflow.Never
                };
            foreach (string period in periods)
                ComboBoxPeriod.Items.Add(period);
            ComboBoxPeriod.SelectedIndex = 6;
            ComboBoxPeriod.SelectedIndexChanged += SelectedIndexChanged;
            ToolStripMarket.Items.Add(ComboBoxPeriod);

            // Button Market Properties
            ButtonCharges = new ToolStripButton
                {
                    Text = Language.T("Charges"),
                    Name = "Charges",
                    ToolTipText = Language.T("Spread, Swap numbers, Slippage."),
                    Overflow = ToolStripItemOverflow.Never
                };
            ButtonCharges.Click += BtnToolsOnClick;
            ToolStripMarket.Items.Add(ButtonCharges);

            ToolStripMarket.Resize += TsMarketResize;

            // Info Panel Market Statistics
            InfoPanelMarketStatistics = new InfoPanel {Parent = PanelMarket, Dock = DockStyle.Fill};

            // Splitter
            new Splitter {Parent = PanelMarket, Dock = DockStyle.Bottom, BorderStyle = BorderStyle.None, Height = Gap};

            // Panel Charts Base
            marketChartsBase = new Panel
                {
                    Parent = PanelMarket,
                    Dock = DockStyle.Bottom,
                    MinimumSize = new Size(100, 50)
                };

            // Small Indicator Chart
            IndicatorChart = new SmallIndicatorChart
                {
                    Parent = marketChartsBase,
                    Cursor = Cursors.Hand,
                    Dock = DockStyle.Fill,
                    ShowDynamicInfo = true,
                    IsContextButtonVisible = true
                };
            IndicatorChart.PopUpContextMenu.Items.AddRange(GetIndicatorChartContextMenuItems());
            IndicatorChart.MouseUp += IndicatorChartMouseUp;
            IndicatorChart.MouseMove += IndicatorChartMouseMove;
            IndicatorChart.MouseLeave += IndicatorChartMouseLeave;
            toolTip.SetToolTip(IndicatorChart, Language.T("Click to view the full chart."));

            // Small Histogram Chart
            HistogramChart = new SmallHistogramChart
                {
                    Parent = marketChartsBase,
                    Dock = DockStyle.Fill,
                    ShowDynamicInfo = true,
                    Visible = false,
                    IsContextButtonVisible = true
                };
            HistogramChart.PopUpContextMenu.Items.AddRange(GetHistogramChartContextMenuItems());
            HistogramChart.AddContextMenuItems();
            HistogramChart.MouseMove += HistogramChartMouseMove;
            HistogramChart.MouseLeave += IndicatorChartMouseLeave;

            PanelMarket.Resize += PnlMarketResize;
        }