Example #1
0
		/// <summary>
		/// Creates a GotoLineForm that will be assigned to a specific Owner control.
		/// </summary>
		/// <param name="Owner">The SyntaxBox that will use the GotoLineForm</param>
		/// <param name="RowCount">The number of lines in the owner control</param>
		public GotoLineForm(EditViewControl Owner, int RowCount)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			lblLines.Text = "Line number (1-" + (RowCount).ToString() + "):";
			mOwner = Owner;
		}
		/// <summary>
		/// Creates a FindReplaceForm that will be assigned to a specific Owner control.
		/// </summary>
		/// <param name="Owner">The SyntaxBox that will use the FindReplaceForm</param>
		public FindReplaceForm(EditViewControl Owner)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//

			mOwner = Owner;
		}
Example #3
0
		/// <summary>
		/// Caret constructor
		/// </summary>
		/// <param name="control">The control that will use the caret</param>
		public Caret(EditViewControl control)
		{
			this.Position = new TextPoint(0, 0);
			Control = control;
		}
		private void View_Enter(object sender, EventArgs e)
		{
			this._ActiveView = (EditViewControl) sender;
		}
		private void ActivateSplits()
		{
			if (this.UpperLeft == null)
			{
				this.UpperLeft = new EditViewControl(this);
				this.UpperRight = new EditViewControl(this);
				this.LowerLeft = new EditViewControl(this);


				// 
				// UpperLeft
				// 
				this.UpperLeft.AllowDrop = true;
				this.UpperLeft.Name = "UpperLeft";
				this.UpperLeft.TabIndex = 6;
				// 
				// UpperRight
				// 
				this.UpperRight.AllowDrop = true;
				this.UpperRight.Name = "UpperRight";
				this.UpperRight.TabIndex = 4;
				// 
				// LowerLeft
				// 
				this.LowerLeft.AllowDrop = true;
				this.LowerLeft.Name = "LowerLeft";
				this.LowerLeft.TabIndex = 5;


				this.splitView1.Controls.AddRange(new Control[]
					{
						this.UpperLeft,
						this.LowerLeft,
						this.UpperRight
					});

				this.splitView1.UpperRight = this.LowerLeft;
				this.splitView1.UpperLeft = this.UpperLeft;
				this.splitView1.LowerLeft = this.UpperRight;

				CreateViews();

				this.AutoListIcons = this.AutoListIcons;
				this.InfoTipImage = this.InfoTipImage;
				this.ChildBorderStyle = this.ChildBorderStyle;
				this.ChildBorderColor = this.ChildBorderColor;
				this.BackColor = this.BackColor;
				this.Document = this.Document;
				this.Redraw();
			}
		}
		/// <summary>
		/// Default constructor for the SyntaxBoxControl
		/// </summary>
		public CodeEditorControl() : base()
		{
			this.Document = new SyntaxDocument();
			//this.OnCreate();

			if (!DisableSplitView)
			{
				this.splitView1 = new SplitViewWidget();

				this.LowerRight = new EditViewControl(this);

			}
			else
			{
				this.LowerRight = new EditViewControl(this);
				this.Controls.Add(LowerRight);
				LowerRight.HideThumbs();
				LowerRight.Dock = DockStyle.Fill;
			}

//			this.UpperLeft.Visible = false;
//			this.UpperRight.Visible = false;
//			this.LowerLeft.Visible = false;
//			this.LowerRight.Visible = false;
//			this.splitView1.Visible = false;


			this.SuspendLayout();
			// 
			// splitView1
			// 

			if (!this.DisableSplitView)
			{
				this.splitView1.SuspendLayout();
				this.splitView1.BackColor = SystemColors.Control;
				this.splitView1.Controls.AddRange(new Control[]
					{
						this.LowerRight
					});
				this.splitView1.Dock = DockStyle.Fill;
				this.splitView1.Location = new Point(0, 0);
				this.splitView1.LowerRight = this.LowerRight;
				this.splitView1.Name = "splitView1";
				this.splitView1.Size = new Size(500, 364);
				this.splitView1.TabIndex = 0;


			}
			// 
			// LowerRight
			// 
			this.LowerRight.AllowDrop = true;
			this.LowerRight.BorderColor = Color.White;
            this.LowerRight.BorderStyle = ControlBorderStyle.None;
			this.LowerRight.Location = new Point(148, 124);
			this.LowerRight.Name = "LowerRight";
			this.LowerRight.Size = new Size(352, 240);
			this.LowerRight.TabIndex = 3;
			this.LowerRight.TextDrawStyle = TextDrawType.StarBorder;

			// 
			// SyntaxBoxControl
			// 

			if (!this.DisableSplitView)
				this.Controls.AddRange(new Control[]
					{
						this.splitView1
					});

			this.Name = "SyntaxBoxControl";
			this.Size = new Size(504, 368);
			if (!this.DisableSplitView)
			{
				this.splitView1.ResumeLayout(false);
				this.splitView1.Resizing += new EventHandler(this.SplitView_Resizing);
				this.splitView1.HideLeft += new EventHandler(this.SplitView_HideLeft);
				this.splitView1.HideTop += new EventHandler(this.SplitView_HideTop);
			}

			this.ResumeLayout(false);


			this.Views = new ArrayList();
			CreateViews();
			_ActiveView = LowerRight;
            

			InitializeComponent();
			this.SetStyle(ControlStyles.Selectable, true);

			//assign keys
			KeyboardActions.Add(new KeyboardAction(Keys.Z, false, true, false, false, new ActionDelegate(this.Undo)));
			KeyboardActions.Add(new KeyboardAction(Keys.Y, false, true, false, false, new ActionDelegate(this.Redo)));

			KeyboardActions.Add(new KeyboardAction(Keys.F3, false, false, false, true, new ActionDelegate(this.FindNext)));

			KeyboardActions.Add(new KeyboardAction(Keys.C, false, true, false, true, new ActionDelegate(this.Copy)));
			KeyboardActions.Add(new KeyboardAction(Keys.X, false, true, false, false, new ActionDelegate(this.CutClear)));
			KeyboardActions.Add(new KeyboardAction(Keys.V, false, true, false, false, new ActionDelegate(this.Paste)));

			KeyboardActions.Add(new KeyboardAction(Keys.Insert, false, true, false, true, new ActionDelegate(this.Copy)));
			KeyboardActions.Add(new KeyboardAction(Keys.Delete, true, false, false, false, new ActionDelegate(this.Cut)));
			KeyboardActions.Add(new KeyboardAction(Keys.Insert, true, false, false, false, new ActionDelegate(this.Paste)));

			KeyboardActions.Add(new KeyboardAction(Keys.A, false, true, false, true, new ActionDelegate(this.SelectAll)));

			KeyboardActions.Add(new KeyboardAction(Keys.F, false, true, false, false, new ActionDelegate(this.ShowFind)));
			KeyboardActions.Add(new KeyboardAction(Keys.H, false, true, false, false, new ActionDelegate(this.ShowReplace)));
			KeyboardActions.Add(new KeyboardAction(Keys.G, false, true, false, true, new ActionDelegate(this.ShowGotoLine)));
			KeyboardActions.Add(new KeyboardAction(Keys.T, false, true, false, false, new ActionDelegate(this.ShowSettings)));

			KeyboardActions.Add(new KeyboardAction(Keys.F2, false, true, false, true, new ActionDelegate(this.ToggleBookmark)));
			KeyboardActions.Add(new KeyboardAction(Keys.F2, false, false, false, true, new ActionDelegate(this.GotoNextBookmark)));
			KeyboardActions.Add(new KeyboardAction(Keys.F2, true, false, false, true, new ActionDelegate(this.GotoPreviousBookmark)));

			KeyboardActions.Add(new KeyboardAction(Keys.Escape, false, false, false, true, new ActionDelegate(this.ClearSelection)));

			KeyboardActions.Add(new KeyboardAction(Keys.Tab, false, false, false, false, new ActionDelegate(Selection.Indent)));
			KeyboardActions.Add(new KeyboardAction(Keys.Tab, true, false, false, false, new ActionDelegate(Selection.Outdent)));

			AutoListIcons = _AutoListIcons;
			this.SplitView = true;
			this.ScrollBars = ScrollBars.Both;
            this.BorderStyle = ControlBorderStyle.None;
			this.ChildBorderColor = SystemColors.ControlDark;
            this.ChildBorderStyle = ControlBorderStyle.FixedSingle;
			this.BackColor = SystemColors.Window;

//			this.UpperLeft.Visible = true;
//			this.UpperRight.Visible = true;
//			this.LowerLeft.Visible = true;
//			this.LowerRight.Visible = true;
//			this.splitView1.Visible = true;

		}
Example #7
0
		/// <summary>
		/// Selection Constructor.
		/// </summary>
		/// <param name="control">Control that will use this selection</param>
		public Selection(EditViewControl control)
		{
			Control = control;
			this.Bounds = new TextRange();
		}