⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outputpanel.cs

📁 C#实现DHTML编辑器功能!
💻 CS
字号:
// DINAMIC XML Editor
//
// Copyright (c) 2002-2003 Dusan Hlavaty
// mailto: duddo@atlas.cz
//
// This software is licensed under the terms of
// GNU General Public license
//
using System;

using XML_editor.MyForms;
using XML_editor.Common;

using Crownwood.Magic.Docking;

namespace XML_editor.DockingPanels
{
	/// <summary>
	/// Dokovaci panel do ktoreho sa budu vypisovat vysledky operacii - 
	/// ekvivalent 'Output' vo V.Studiu
	/// </summary>
	public class OutputPanel : Crownwood.Magic.Docking.Content
	{
	
		/// <summary>
		/// TextBox tohoto <see cref="OutputPanel"/>a
		/// </summary>
		private System.Windows.Forms.TextBox textBox = null;

		/// <summary>
		/// Odkaz na hlavny formular aplikacie
		/// </summary>
		private MainForm mainForm = null;

		// -------------------------------------------------------------------------
		/// <summary>
		/// Odkaz na hlavny formular aplikacie
		/// </summary>
		public MainForm MainForm
		{
			get 
			{
				return this.mainForm;
			}
		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// TextBox tohoto <see cref="OutputPanel"/>a
		/// </summary>
		private System.Windows.Forms.TextBox TextBox
		{
			get 
			{
				return this.textBox;
			}
		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// Inicializuje dokovaci panel obsahujuci Output - <see cref="OutputPanel"/>.
		/// </summary>
		/// <param name="mainForm"></param>
		/// <param name="manager"></param>
		public OutputPanel(MainForm mainForm, DockingManager manager) : base(manager)
		{
			this.mainForm = mainForm;
			this.FullTitle = this.Title = "Output";

			this.textBox = new System.Windows.Forms.TextBox();

			System.Windows.Forms.ImageList i = new System.Windows.Forms.ImageList();
			i.Images.Add( IconProvider.LoadBitmap(this, "XML_editor.Icons.OutputPanel.bmp", true, new System.Drawing.Point(0,0)) );
			this.ImageList = i;
			this.ImageIndex = 0;

			// 
			// textBox
			// 
			this.textBox.AcceptsReturn = true;
			this.textBox.ReadOnly = true;
			//this.textBox.Dock = System.Windows.Forms.DockStyle.Fill;
			this.textBox.BackColor = System.Drawing.SystemColors.Window;
			this.textBox.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(238)));
			this.textBox.Multiline = true;
			this.textBox.Name = "textBox1";
			this.textBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
			//this.textBox.Size = new System.Drawing.Size(384, 80);
			this.textBox.TabIndex = 1;
			this.textBox.Text = "textBox1";
			this.textBox.WordWrap = false;

			this.Control = this.textBox;

			// Zaradime sa do docking managera
			this.MainForm.DockingManager.Contents.Add(this);
			this.MainForm.DockingManager.AddContentWithState(this, Crownwood.Magic.Docking.State.DockBottom);
			this.MainForm.DockingManager.ToggleContentAutoHide(this);
		}
	
		// -------------------------------------------------------------------------
		/// <summary>
		/// Prida text do textboxu na koniec.
		/// </summary>
		/// <param name="text">text, ktory sa ma pridat</param>
		public void AppendText(string text)
		{
			this.TextBox.AppendText(text);
			if (this._autoHidden == true) 
			{
				this.MainForm.DockingManager.BringAutoHideIntoView(this);
			}
			this.BringToFront();
		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// Prida text do textboxu a ukonci ho 'KONCOM RIADKU'
		/// </summary>
		/// <param name="text">text, ktory sa ma pridat</param>
		public void AppendTextLine(string text)
		{
			this.TextBox.AppendText(text);
			this.TextBox.AppendText("\r\n");
			if (this._autoHidden == true) 
			{
				this.MainForm.DockingManager.BringAutoHideIntoView(this);
			}
			this.BringToFront();
		}

		// -------------------------------------------------------------------------
		/// <summary>
		/// Vymaze obsah TextBoxu
		/// </summary>
		public void Clear() 
		{
			this.TextBox.Clear();
		}
	
	} // public class OutputPanel
} // namespace XML_editor.DockingPanels

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -