/// <summary>
        /// Sets the selected bar number
        /// </summary>
        private void PnlJournalSelectedBarChange(object sender, EventArgs e)
        {
            var panel = sender as Panel;

            if (panel == null)
            {
                return;
            }

            switch (panel.Name)
            {
            case "JournalByBars":
                SelectedBarNumber         = JournalByBars.SelectedBar;
                JournalOrders.SelectedBar = SelectedBarNumber;
                JournalOrders.SetUpJournal();
                JournalOrders.Invalidate();
                JournalPositions.SelectedBar = SelectedBarNumber;
                JournalPositions.SetUpJournal();
                JournalPositions.Invalidate();
                break;

            case "JournalByPositions":
                SelectedBarNumber = JournalByPositions.SelectedBar;
                break;
            }
        }
 /// <summary>
 /// Sets the journal data
 /// </summary>
 protected void SetupJournal()
 {
     if (!Configs.ShowJournal)
     {
         return;
     }
     if (Configs.JournalByBars)
     {
         JournalByBars.SetUpJournal();
         JournalByBars.UpdateJournalData();
         JournalByBars.Invalidate();
         SelectedBarNumber         = JournalByBars.SelectedBar;
         JournalOrders.SelectedBar = SelectedBarNumber;
         JournalOrders.SetUpJournal();
         JournalOrders.Invalidate();
         JournalPositions.SelectedBar = SelectedBarNumber;
         JournalPositions.SetUpJournal();
         JournalPositions.Invalidate();
     }
     else
     {
         JournalByPositions.ShowTransfers = Configs.JournalShowTransfers;
         JournalByPositions.SetUpJournal();
         JournalByPositions.Invalidate();
         SelectedBarNumber = JournalByBars.SelectedBar;
     }
 }
        /// <summary>
        /// Initializes the controls in panel pnlJournal.
        /// </summary>
        private void InitializeJournal()
        {
            var toolTip = new ToolTip();

            // Journal Right
            PanelJournalRight = new Panel {Parent = PanelJournal, Dock = DockStyle.Fill};

            // Journal Orders
            JournalOrders = new JournalOrders {Parent = PanelJournalRight, Dock = DockStyle.Fill, Cursor = Cursors.Hand};
            JournalOrders.Click += PnlJournalMouseClick;
            JournalOrders.CloseButton.Visible = true;
            JournalOrders.CloseButton.Click += ContextMenuCloseJournalClick;
            toolTip.SetToolTip(JournalOrders, Language.T("Click to view Bar Explorer."));
            toolTip.SetToolTip(JournalOrders.CloseButton, Language.T("Close Journal"));

            new Splitter {Parent = PanelJournalRight, Dock = DockStyle.Bottom, Height = Gap};

            // Journal Position
            JournalPositions = new JournalPositions {Parent = PanelJournalRight, Dock = DockStyle.Bottom, Cursor = Cursors.Hand};
            JournalPositions.Click += PnlJournalMouseClick;
            toolTip.SetToolTip(JournalPositions, Language.T("Click to view Bar Explorer."));

            VerticalSplitter = new Splitter {Parent = PanelJournal, Dock = DockStyle.Left, Width = Gap};

            // Journal by Bars
            JournalByBars = new JournalByBars {Name = "JournalByBars", Parent = PanelJournal, Dock = DockStyle.Left};
            JournalByBars.PopUpContextMenu.Items.AddRange(GetJournalContextMenuItems());
            JournalByBars.IsContextButtonVisible = true;
            JournalByBars.SelectedBarChange += PnlJournalSelectedBarChange;
            JournalByBars.MouseDoubleClick += PnlJournalMouseDoubleClick;
            toolTip.SetToolTip(JournalByBars, Language.T("Click to select a bar.") + Environment.NewLine + Language.T("Double click to view Bar Explorer."));

            // Journal by Positions
            JournalByPositions = new JournalByPositions {Name = "JournalByPositions", Parent = PanelJournal, Dock = DockStyle.Fill};
            JournalByPositions.PopUpContextMenu.Items.AddRange(GetJournalContextMenuItems());
            JournalByPositions.IsContextButtonVisible = true;
            JournalByPositions.CloseButton.Visible = true;
            JournalByPositions.CloseButton.Click += ContextMenuCloseJournalClick;
            JournalByPositions.SelectedBarChange += PnlJournalSelectedBarChange;
            JournalByPositions.MouseDoubleClick += PnlJournalMouseDoubleClick;
            toolTip.SetToolTip(JournalByPositions, Language.T("Click to select a bar.") + Environment.NewLine + Language.T("Double click to view Bar Explorer."));
            toolTip.SetToolTip(JournalByPositions.CloseButton, Language.T("Close Journal"));

            PanelJournal.Resize += PnlJournalResize;

            PanelJournalRight.Visible = Configs.JournalByBars;
            JournalByBars.Visible = Configs.JournalByBars;
            VerticalSplitter.Visible = Configs.JournalByBars;
            JournalByPositions.Visible = !Configs.JournalByBars;
            JournalByPositions.ShowTransfers = Configs.JournalShowTransfers;
        }
        /// <summary>
        /// Initializes the controls in panel pnlJournal.
        /// </summary>
        private void InitializeJournal()
        {
            var toolTip = new ToolTip();

            // Journal Right
            PanelJournalRight = new Panel {
                Parent = PanelJournal, Dock = DockStyle.Fill
            };

            // Journal Orders
            JournalOrders = new JournalOrders {
                Parent = PanelJournalRight, Dock = DockStyle.Fill, Cursor = Cursors.Hand
            };
            JournalOrders.Click += PnlJournalMouseClick;
            JournalOrders.CloseButton.Visible = true;
            JournalOrders.CloseButton.Click  += ContextMenuCloseJournalClick;
            toolTip.SetToolTip(JournalOrders, Language.T("Click to view Bar Explorer."));
            toolTip.SetToolTip(JournalOrders.CloseButton, Language.T("Close Journal"));

            new Splitter {
                Parent = PanelJournalRight, Dock = DockStyle.Bottom, Height = Gap
            };

            // Journal Position
            JournalPositions = new JournalPositions {
                Parent = PanelJournalRight, Dock = DockStyle.Bottom, Cursor = Cursors.Hand
            };
            JournalPositions.Click += PnlJournalMouseClick;
            toolTip.SetToolTip(JournalPositions, Language.T("Click to view Bar Explorer."));

            VerticalSplitter = new Splitter {
                Parent = PanelJournal, Dock = DockStyle.Left, Width = Gap
            };

            // Journal by Bars
            JournalByBars = new JournalByBars {
                Name = "JournalByBars", Parent = PanelJournal, Dock = DockStyle.Left
            };
            JournalByBars.PopUpContextMenu.Items.AddRange(GetJournalContextMenuItems());
            JournalByBars.IsContextButtonVisible = true;
            JournalByBars.SelectedBarChange     += PnlJournalSelectedBarChange;
            JournalByBars.MouseDoubleClick      += PnlJournalMouseDoubleClick;
            toolTip.SetToolTip(JournalByBars, Language.T("Click to select a bar.") + Environment.NewLine + Language.T("Double click to view Bar Explorer."));

            // Journal by Positions
            JournalByPositions = new JournalByPositions {
                Name = "JournalByPositions", Parent = PanelJournal, Dock = DockStyle.Fill
            };
            JournalByPositions.PopUpContextMenu.Items.AddRange(GetJournalContextMenuItems());
            JournalByPositions.IsContextButtonVisible = true;
            JournalByPositions.CloseButton.Visible    = true;
            JournalByPositions.CloseButton.Click     += ContextMenuCloseJournalClick;
            JournalByPositions.SelectedBarChange     += PnlJournalSelectedBarChange;
            JournalByPositions.MouseDoubleClick      += PnlJournalMouseDoubleClick;
            toolTip.SetToolTip(JournalByPositions, Language.T("Click to select a bar.") + Environment.NewLine + Language.T("Double click to view Bar Explorer."));
            toolTip.SetToolTip(JournalByPositions.CloseButton, Language.T("Close Journal"));

            PanelJournal.Resize += PnlJournalResize;

            PanelJournalRight.Visible        = Configs.JournalByBars;
            JournalByBars.Visible            = Configs.JournalByBars;
            VerticalSplitter.Visible         = Configs.JournalByBars;
            JournalByPositions.Visible       = !Configs.JournalByBars;
            JournalByPositions.ShowTransfers = Configs.JournalShowTransfers;
        }