/// <summary>
 /// Sets the colors of tab page Journal.
 /// </summary>
 private void SetJournalColors()
 {
     TabPageJournal.BackColor = LayoutColors.ColorFormBack;
     Journal.SetColors();
 }
        /// <summary>
        /// Initializes page Chart.
        /// </summary>
        private void InitializePageJournal()
        {
            // tabPageJournal
            TabPageJournal.Name       = "tabPageJournal";
            TabPageJournal.Text       = Language.T("Journal");
            TabPageJournal.ImageIndex = 4;

            Journal = new Journal {
                Parent = TabPageJournal, Dock = DockStyle.Fill
            };

            TsJournal = new ToolStrip {
                Parent = TabPageJournal, Dock = DockStyle.Top
            };

            var      fontMessage = new Font(Font.FontFamily, 9);
            Graphics g           = CreateGraphics();
            float    fTimeWidth  = g.MeasureString(DateTime.Now.ToString(Data.DF + " HH:mm:ss"), fontMessage).Width;

            g.Dispose();

            var lblTime = new ToolStripLabel(Language.T("Time"))
            {
                AutoSize = false, Width = 16 + (int)fTimeWidth - 5
            };

            TsJournal.Items.Add(lblTime);

            TsJournal.Items.Add(new ToolStripSeparator());

            var lblMessage = new ToolStripLabel(Language.T("Message"))
            {
                AutoSize = false, Width = 250
            };

            TsJournal.Items.Add(lblMessage);

            // Tool strip buttons
            var tsbClear = new ToolStripButton
            {
                Image        = Resources.clear,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Alignment    = ToolStripItemAlignment.Right,
                ToolTipText  = Language.T("Clear journal's messages.")
            };

            tsbClear.Click += TsbClearClick;
            TsJournal.Items.Add(tsbClear);

            var sep = new ToolStripSeparator {
                Alignment = ToolStripItemAlignment.Right
            };

            TsJournal.Items.Add(sep);

            var tscbxJounalLength = new ToolStripComboBox
            {
                Alignment     = ToolStripItemAlignment.Right,
                DropDownStyle = ComboBoxStyle.DropDownList,
                AutoSize      = false,
                Size          = new Size(60, 25)
            };

            tscbxJounalLength.Items.AddRange(new object[] { "20", "200", "500", "1000", "5000", "10000" });
            tscbxJounalLength.SelectedItem          = Configs.JournalLength.ToString(CultureInfo.InvariantCulture);
            tscbxJounalLength.ToolTipText           = Language.T("Maximum messages in the journal.");
            tscbxJounalLength.SelectedIndexChanged += TscbxJounalLenghtSelectedIndexChanged;
            TsJournal.Items.Add(tscbxJounalLength);

            var tsbShowTicks = new ToolStripButton
            {
                Image        = Resources.show_ticks,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Alignment    = ToolStripItemAlignment.Right,
                Checked      = _isShowTicks,
                ToolTipText  = Language.T("Show incoming ticks.")
            };

            tsbShowTicks.Click += TsbShowTicksClick;
            TsJournal.Items.Add(tsbShowTicks);

            var tsbShowSystemMessages = new ToolStripButton
            {
                Image        = Resources.show_system_messages,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Alignment    = ToolStripItemAlignment.Right,
                Checked      = _isShowSystemMessages,
                ToolTipText  = Language.T("Show system messages.")
            };

            tsbShowSystemMessages.Click += TsbShowSystemsClick;
            TsJournal.Items.Add(tsbShowSystemMessages);

            var sep1 = new ToolStripSeparator {
                Alignment = ToolStripItemAlignment.Right
            };

            TsJournal.Items.Add(sep1);

            var tsbSaveJournal = new ToolStripButton
            {
                Image        = Resources.save,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Alignment    = ToolStripItemAlignment.Right,
                Checked      = _isShowSystemMessages,
                ToolTipText  = Language.T("Save journal.")
            };

            tsbSaveJournal.Click += TsbSaveJournalClick;
            TsJournal.Items.Add(tsbSaveJournal);
        }
 /// <summary>
 /// Clears the journal messages.
 /// </summary>
 private void TsbClearClick(object sender, EventArgs e)
 {
     _messages.Clear();
     Journal.ClearMessages();
 }
 /// <summary>
 /// Page journal was selected.
 /// </summary>
 private void PageJournalSelected()
 {
     Journal.SelectVScrollBar();
 }
        /// <summary>
        /// Initializes page Chart.
        /// </summary>
        private void InitializePageJournal()
        {
            // tabPageJournal
            TabPageJournal.Name = "tabPageJournal";
            TabPageJournal.Text = Language.T("Journal");
            TabPageJournal.ImageIndex = 4;

            Journal = new Journal {Parent = TabPageJournal, Dock = DockStyle.Fill};

            TsJournal = new ToolStrip {Parent = TabPageJournal, Dock = DockStyle.Top};

            var fontMessage = new Font(Font.FontFamily, 9);
            Graphics g = CreateGraphics();
            float fTimeWidth = g.MeasureString(DateTime.Now.ToString(Data.DF + " HH:mm:ss"), fontMessage).Width;
            g.Dispose();

            var lblTime = new ToolStripLabel(Language.T("Time")) {AutoSize = false, Width = 16 + (int) fTimeWidth - 5};
            TsJournal.Items.Add(lblTime);

            TsJournal.Items.Add(new ToolStripSeparator());

            var lblMessage = new ToolStripLabel(Language.T("Message")) {AutoSize = false, Width = 250};
            TsJournal.Items.Add(lblMessage);

            // Tool strip buttons
            var tsbClear = new ToolStripButton
                               {
                                   Image = Resources.clear,
                                   DisplayStyle = ToolStripItemDisplayStyle.Image,
                                   Alignment = ToolStripItemAlignment.Right,
                                   ToolTipText = Language.T("Clear journal's messages.")
                               };
            tsbClear.Click += TsbClearClick;
            TsJournal.Items.Add(tsbClear);

            var sep = new ToolStripSeparator {Alignment = ToolStripItemAlignment.Right};
            TsJournal.Items.Add(sep);

            var tscbxJounalLength = new ToolStripComboBox
                                        {
                                            Alignment = ToolStripItemAlignment.Right,
                                            DropDownStyle = ComboBoxStyle.DropDownList,
                                            AutoSize = false,
                                            Size = new Size(60, 25)
                                        };
            tscbxJounalLength.Items.AddRange(new object[] {"20", "200", "500", "1000", "5000", "10000"});
            tscbxJounalLength.SelectedItem = Configs.JournalLength.ToString(CultureInfo.InvariantCulture);
            tscbxJounalLength.ToolTipText = Language.T("Maximum messages in the journal.");
            tscbxJounalLength.SelectedIndexChanged += TscbxJounalLenghtSelectedIndexChanged;
            TsJournal.Items.Add(tscbxJounalLength);

            var tsbShowTicks = new ToolStripButton
                                   {
                                       Image = Resources.show_ticks,
                                       DisplayStyle = ToolStripItemDisplayStyle.Image,
                                       Alignment = ToolStripItemAlignment.Right,
                                       Checked = _isShowTicks,
                                       ToolTipText = Language.T("Show incoming ticks.")
                                   };
            tsbShowTicks.Click += TsbShowTicksClick;
            TsJournal.Items.Add(tsbShowTicks);

            var tsbShowSystemMessages = new ToolStripButton
                                            {
                                                Image = Resources.show_system_messages,
                                                DisplayStyle = ToolStripItemDisplayStyle.Image,
                                                Alignment = ToolStripItemAlignment.Right,
                                                Checked = _isShowSystemMessages,
                                                ToolTipText = Language.T("Show system messages.")
                                            };
            tsbShowSystemMessages.Click += TsbShowSystemsClick;
            TsJournal.Items.Add(tsbShowSystemMessages);

            var sep1 = new ToolStripSeparator {Alignment = ToolStripItemAlignment.Right};
            TsJournal.Items.Add(sep1);

            var tsbSaveJournal = new ToolStripButton
                                     {
                                         Image = Resources.save,
                                         DisplayStyle = ToolStripItemDisplayStyle.Image,
                                         Alignment = ToolStripItemAlignment.Right,
                                         Checked = _isShowSystemMessages,
                                         ToolTipText = Language.T("Save journal.")
                                     };
            tsbSaveJournal.Click += TsbSaveJournalClick;
            TsJournal.Items.Add(tsbSaveJournal);
        }
        /// <summary>
        /// Initializes page Chart.
        /// </summary>
        public void Initialize_PageJournal()
        {
            // tabPageJournal
            tabPageJournal.Name = "tabPageJournal";
            tabPageJournal.Text = Language.T("Journal");
            tabPageJournal.ImageIndex = 4;

            journal = new Journal();
            journal.Parent = tabPageJournal;
            journal.Dock   = DockStyle.Fill;

            tsJournal = new ToolStrip();
            tsJournal.Parent = tabPageJournal;
            tsJournal.Dock   = DockStyle.Top;

            Font fontMessage = new Font(Font.FontFamily, 9);
            Graphics g = CreateGraphics();
            float fTimeWidth = g.MeasureString(DateTime.Now.ToString(Data.DF + " HH:mm:ss"), fontMessage).Width;
            g.Dispose();

            ToolStripLabel lblTime = new ToolStripLabel(Language.T("Time"));
            lblTime.AutoSize = false;
            lblTime.Width    = 16 + (int)fTimeWidth - 5;
            tsJournal.Items.Add(lblTime);

            tsJournal.Items.Add(new ToolStripSeparator());

            ToolStripLabel lblMessage = new ToolStripLabel(Language.T("Message"));
            lblMessage.AutoSize = false;
            lblMessage.Width    = 250;
            tsJournal.Items.Add(lblMessage);

            // Tool strip buttons
            ToolStripButton tsbClear = new ToolStripButton();
            tsbClear.Image        = Properties.Resources.clear;
            tsbClear.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbClear.Alignment    = ToolStripItemAlignment.Right;
            tsbClear.ToolTipText  = Language.T("Clear journal's messages.");
            tsbClear.Click       += new EventHandler(TsbClear_Click);
            tsJournal.Items.Add(tsbClear);

            ToolStripSeparator sep = new ToolStripSeparator();
            sep.Alignment = ToolStripItemAlignment.Right;
            tsJournal.Items.Add(sep);

            ToolStripComboBox tscbxJounalLength = new ToolStripComboBox();
            tscbxJounalLength.Alignment = ToolStripItemAlignment.Right;
            tscbxJounalLength.DropDownStyle = ComboBoxStyle.DropDownList;
            tscbxJounalLength.AutoSize = false;
            tscbxJounalLength.Size = new System.Drawing.Size(60, 25);
            tscbxJounalLength.Items.AddRange(new object[] { "20", "200", "500", "1000", "5000", "10000" });
            tscbxJounalLength.SelectedItem = Configs.JournalLength.ToString();
            tscbxJounalLength.ToolTipText  = Language.T("Maximum messages in the journal.");
            tscbxJounalLength.SelectedIndexChanged += new EventHandler(TscbxJounalLenght_SelectedIndexChanged);
            tsJournal.Items.Add(tscbxJounalLength);

            ToolStripButton tsbShowTicks = new ToolStripButton();
            tsbShowTicks.Image        = Properties.Resources.show_ticks;
            tsbShowTicks.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbShowTicks.Alignment    = ToolStripItemAlignment.Right;
            tsbShowTicks.Checked      = isShowTicks;
            tsbShowTicks.ToolTipText  = Language.T("Show incoming ticks.");
            tsbShowTicks.Click       += new EventHandler(TsbShowTicks_Click);
            tsJournal.Items.Add(tsbShowTicks);

            ToolStripButton tsbShowSystemMessages = new ToolStripButton();
            tsbShowSystemMessages.Image        = Properties.Resources.show_system_messages;
            tsbShowSystemMessages.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbShowSystemMessages.Alignment    = ToolStripItemAlignment.Right;
            tsbShowSystemMessages.Checked      = isShowSystemMessages;
            tsbShowSystemMessages.ToolTipText  = Language.T("Show system messages.");
            tsbShowSystemMessages.Click       += new EventHandler(TsbShowSystems_Click);
            tsJournal.Items.Add(tsbShowSystemMessages);

            ToolStripSeparator sep1 = new ToolStripSeparator();
            sep1.Alignment = ToolStripItemAlignment.Right;
            tsJournal.Items.Add(sep1);

            ToolStripButton tsbSaveJournal = new ToolStripButton();
            tsbSaveJournal.Image = Properties.Resources.save;
            tsbSaveJournal.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbSaveJournal.Alignment = ToolStripItemAlignment.Right;
            tsbSaveJournal.Checked = isShowSystemMessages;
            tsbSaveJournal.ToolTipText = Language.T("Save journal.");
            tsbSaveJournal.Click += new EventHandler(TsbSaveJournalClick);
            tsJournal.Items.Add(tsbSaveJournal);

            return;
        }
示例#7
0
        /// <summary>
        /// Initializes page Chart.
        /// </summary>
        public void Initialize_PageJournal()
        {
            // tabPageJournal
            tabPageJournal.Name       = "tabPageJournal";
            tabPageJournal.Text       = Language.T("Journal");
            tabPageJournal.ImageIndex = 4;

            journal        = new Journal();
            journal.Parent = tabPageJournal;
            journal.Dock   = DockStyle.Fill;

            tsJournal        = new ToolStrip();
            tsJournal.Parent = tabPageJournal;
            tsJournal.Dock   = DockStyle.Top;

            Font     fontMessage = new Font(Font.FontFamily, 9);
            Graphics g           = CreateGraphics();
            float    fTimeWidth  = g.MeasureString(DateTime.Now.ToString(Data.DF + " HH:mm:ss"), fontMessage).Width;

            g.Dispose();

            ToolStripLabel lblTime = new ToolStripLabel(Language.T("Time"));

            lblTime.AutoSize = false;
            lblTime.Width    = 16 + (int)fTimeWidth - 5;
            tsJournal.Items.Add(lblTime);

            tsJournal.Items.Add(new ToolStripSeparator());

            ToolStripLabel lblMessage = new ToolStripLabel(Language.T("Message"));

            lblMessage.AutoSize = false;
            lblMessage.Width    = 250;
            tsJournal.Items.Add(lblMessage);

            // Tool strip buttons
            ToolStripButton tsbClear = new ToolStripButton();

            tsbClear.Image        = Properties.Resources.clear;
            tsbClear.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbClear.Alignment    = ToolStripItemAlignment.Right;
            tsbClear.ToolTipText  = Language.T("Clear journal's messages.");
            tsbClear.Click       += new EventHandler(TsbClear_Click);
            tsJournal.Items.Add(tsbClear);

            ToolStripSeparator sep = new ToolStripSeparator();

            sep.Alignment = ToolStripItemAlignment.Right;
            tsJournal.Items.Add(sep);

            ToolStripComboBox tscbxJounalLength = new ToolStripComboBox();

            tscbxJounalLength.Alignment     = ToolStripItemAlignment.Right;
            tscbxJounalLength.DropDownStyle = ComboBoxStyle.DropDownList;
            tscbxJounalLength.AutoSize      = false;
            tscbxJounalLength.Size          = new System.Drawing.Size(60, 25);
            tscbxJounalLength.Items.AddRange(new object[] { "20", "200", "500", "1000", "5000", "10000" });
            tscbxJounalLength.SelectedItem          = Configs.JournalLength.ToString();
            tscbxJounalLength.ToolTipText           = Language.T("Maximum messages in the journal.");
            tscbxJounalLength.SelectedIndexChanged += new EventHandler(TscbxJounalLenght_SelectedIndexChanged);
            tsJournal.Items.Add(tscbxJounalLength);

            ToolStripButton tsbShowTicks = new ToolStripButton();

            tsbShowTicks.Image        = Properties.Resources.show_ticks;
            tsbShowTicks.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbShowTicks.Alignment    = ToolStripItemAlignment.Right;
            tsbShowTicks.Checked      = isShowTicks;
            tsbShowTicks.ToolTipText  = Language.T("Show incoming ticks.");
            tsbShowTicks.Click       += new EventHandler(TsbShowTicks_Click);
            tsJournal.Items.Add(tsbShowTicks);

            ToolStripButton tsbShowSystemMessages = new ToolStripButton();

            tsbShowSystemMessages.Image        = Properties.Resources.show_system_messages;
            tsbShowSystemMessages.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbShowSystemMessages.Alignment    = ToolStripItemAlignment.Right;
            tsbShowSystemMessages.Checked      = isShowSystemMessages;
            tsbShowSystemMessages.ToolTipText  = Language.T("Show system messages.");
            tsbShowSystemMessages.Click       += new EventHandler(TsbShowSystems_Click);
            tsJournal.Items.Add(tsbShowSystemMessages);

            ToolStripSeparator sep1 = new ToolStripSeparator();

            sep1.Alignment = ToolStripItemAlignment.Right;
            tsJournal.Items.Add(sep1);

            return;
        }