using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace pcd_g1
{
	public partial class Debug : Form
	{
		public Debug()
		{
			InitializeComponent();
			dbg = this;
		}

		bool power = true;
		static Debug dbg;
		public static void WriteLine(string msg)
		{
			if (!(dbg.power)) return;
			dbg.textBox2.Text += (msg + "\r\n");
			if (dbg.textBox2.Text.Length > 50000)
			{
				dbg.textBox2.Text = dbg.textBox2.Text.Remove(0, 40000);
			}
			dbg.textBox2.SelectionStart = dbg.textBox2.Text.Length;
			dbg.textBox2.ScrollToCaret();
		}

		private void textBox2_DoubleClick(object sender, EventArgs e)
		{
			this.textBox2.Text = "";
		}

		private void checkBox1_CheckedChanged(object sender, EventArgs e)
		{
			power = this.checkBox1.Checked;
			if (!power)
			{
				this.textBox2.Text = "";
			}
		}
	}
}
