Ejemplo n.º 1
0
 private void writeID(LogBox box, params object[] data)
 {
     writeTextBox(box, data);
     focusBox(box);
 }
Ejemplo n.º 2
0
 // LOG GUI LOW LEVEL
 private void writeTextBox(LogBox box, params object[] data)
 {
     box.AppendLogEntry(data);
 }
Ejemplo n.º 3
0
 private void focusBox(LogBox box)
 {
     if (box == null) { return; };
     if (InvokeRequired)
     {
         BoxDelegate registerBoxTextDelegate = new BoxDelegate(focusBox);
         BeginInvoke(registerBoxTextDelegate, new object[] { box });
     }
     else
     {
         tabControlAll.SelectedTab = (TabPage)box.Parent;
         box.Focus();
     }
 }
Ejemplo n.º 4
0
        private void TextBoxSave(string fileNameBase, LogBox box)
        {
            saveFileDialog.FileName = fileNameBase + ".txt";

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                Stream myStream = saveFileDialog.OpenFile();
                StreamWriter wText = new StreamWriter(myStream);
                wText.Write(box.ExportAsString());
                wText.Flush();
                myStream.Close();
            }
        }
Ejemplo n.º 5
0
        private LogBox[] findAllTextBox()
        {
            IList list = new ArrayList();
            LogBox box;

            foreach (Control control in tabControlAll.Controls)
            {
                if (control.Tag != null)
                {
                    box = findControlTextBox(control.Controls);
                    if (box != null) { list.Add(box); }
                }
            }

            LogBox[] result = new LogBox[list.Count];
            list.CopyTo(result, 0);
            return result;
        }
Ejemplo n.º 6
0
        private LogBox createIDTab(string ID, bool closeable, bool filtering)
        {
            //
            // contextMenuStripID
            //
            System.Windows.Forms.ContextMenuStrip contextMenuStripID = new System.Windows.Forms.ContextMenuStrip();
            contextMenuStripID.Enabled = true;
            contextMenuStripID.GripMargin = new System.Windows.Forms.Padding(2);
            contextMenuStripID.Location = new System.Drawing.Point(25, 59);
            contextMenuStripID.Name = "contextMenuStrip" + ID;
            contextMenuStripID.RightToLeft = System.Windows.Forms.RightToLeft.No;
            contextMenuStripID.Size = new System.Drawing.Size(115, 26);
            contextMenuStripID.Tag = ID;

            //
            // toolStripMenuItemIDSave
            //
            System.Windows.Forms.ToolStripMenuItem toolStripMenuItemIDSave = new System.Windows.Forms.ToolStripMenuItem();
            toolStripMenuItemIDSave.Name = "toolStripMenuItem" + ID + "Save";
            toolStripMenuItemIDSave.Text = "Save as";
            toolStripMenuItemIDSave.Click += new System.EventHandler(this.toolStripMenuItemIDSave_Click);
            toolStripMenuItemIDSave.Tag = ID;
            contextMenuStripID.Items.Add(toolStripMenuItemIDSave);

            //
            // toolStripSeparatorID1
            //
            System.Windows.Forms.ToolStripSeparator toolStripSeparatorID1 = new System.Windows.Forms.ToolStripSeparator();
            toolStripSeparatorID1.Name = "toolStripSeparator"+ID+"1";
            contextMenuStripID.Items.Add(toolStripSeparatorID1);

            //
            // toolStripMenuItemIDAdjust
            //
            System.Windows.Forms.ToolStripMenuItem toolStripMenuItemIDAdjust = new System.Windows.Forms.ToolStripMenuItem();
            toolStripMenuItemIDAdjust.Name = "toolStripMenuItem" + ID + "Adjust";
            toolStripMenuItemIDAdjust.Text = "Adjust columns width";
            toolStripMenuItemIDAdjust.Click += new System.EventHandler(this.toolStripMenuItemIDAdjust_Click);
            toolStripMenuItemIDAdjust.Tag = ID;
            contextMenuStripID.Items.Add(toolStripMenuItemIDAdjust);

            //
            // toolStripMenuItemIDClose
            //
            if (closeable)
            {
                System.Windows.Forms.ToolStripMenuItem toolStripMenuItemIDClose = new System.Windows.Forms.ToolStripMenuItem();
                toolStripMenuItemIDClose.Name = "toolStripMenuItem" + ID + "Close";
                toolStripMenuItemIDClose.Text = "Close";
                toolStripMenuItemIDClose.Click += new System.EventHandler(this.toolStripMenuItemIDClose_Click);
                toolStripMenuItemIDClose.Tag = ID;
                contextMenuStripID.Items.Add(toolStripMenuItemIDClose);
            }
            else
            {
                //
                // toolStripMenuItemIDClear
                //
                System.Windows.Forms.ToolStripMenuItem toolStripMenuItemIDClear = new System.Windows.Forms.ToolStripMenuItem();
                toolStripMenuItemIDClear.Name = "toolStripMenuItem" + ID + "Clear";
                toolStripMenuItemIDClear.Text = "Clear";
                toolStripMenuItemIDClear.Click += new System.EventHandler(this.toolStripMenuItemIDClear_Click);
                toolStripMenuItemIDClear.Tag = ID;
                contextMenuStripID.Items.Add(toolStripMenuItemIDClear);
            }

            //
            // tabPageID
            //
            System.Windows.Forms.TabPage tabPageID = new System.Windows.Forms.TabPage();
            tabPageID.ContextMenuStrip = contextMenuStripID;
            tabPageID.Name = "tabPage" + ID;
            tabPageID.Text = ID;
            tabPageID.Tag = ID;
            //tabPageID.Location = new System.Drawing.Point(4, 22);
            //tabPageID.Size = new System.Drawing.Size(576, 339);
            //tabPageID.TabIndex = 0;

            //
            // TextBoxID
            //
            QIT.UI.Windows.Controls.LogBox textBoxID = new QIT.UI.Windows.Controls.LogBox();
            textBoxID.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            textBoxID.AutoSize = false;
            textBoxID.Font = this.Logger.LoggerFont;
            textBoxID.BackColor = this.Logger.BackColor;
            textBoxID.ForeColor = this.Logger.ForeColor;
            textBoxID.Location = new System.Drawing.Point(0, 0);
            textBoxID.Size = new System.Drawing.Size(tabPageID.ClientRectangle.Width, tabPageID.ClientRectangle.Height);
            textBoxID.ContextMenuStrip = contextMenuStripID;
            textBoxID.Name = "TextBox" + ID;
            textBoxID.Text = "";
            textBoxID.Tag = ID;
            textBoxID.Filtering = filtering;
            //TextBoxID.TabIndex = 0;
            tabPageID.Controls.Add(textBoxID);

            // tabControlAll
            this.tabControlAll.Controls.Add(tabPageID);

            return textBoxID;
        }
Ejemplo n.º 7
0
 public void TextBoxClose(LogBox box)
 {
     Control tabPage = (Control)(box.Parent);
     //tabPage.Controls.Remove(box);
     tabControlAll.Controls.Remove(tabPage);
     _hashtable.Remove(box.Tag);
 }
Ejemplo n.º 8
0
 //private void writeMulti(string text)
 //{
 //    LogBox[] array = findAllTextBox();
 //    foreach (LogBox box in array)
 //    {
 //        writeID(box, text);
 //    }
 //}
 public void TextBoxClear(LogBox box)
 {
     box.Clear();
 }
Ejemplo n.º 9
0
 public void TextBoxAdjust(LogBox box)
 {
     box.AdjustColumnsSizesEqually();
 }