Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tageditor.cs « monodoc-qt « doctools « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8c231ce07491b9d7a51987d16069940d75bdd430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// doceditbar.cs - Qt# Mono Documentation Tool
//
// Author: Adam Treat <manyoso@yahoo.com>
// (c) 2002 Adam Treat
// Licensed under the terms of the GNU GPL

namespace Mono.Document.Editor {

	using Qt;
	using System;

	public class TagContext : QPopupMenu {

		QTextEdit edit;

		public TagContext (QTextEdit edit) : base (edit)
		{
			this.edit = edit;
			InsertItem ("<see>", this, SLOT ("OnSee ()"));
			InsertItem ("<code>", this, SLOT ("OnCode ()"));
			InsertItem ("<data>", this, SLOT ("OnData ()"));
			InsertItem ("<list>", this, SLOT ("OnList ()"));
			InsertItem ("<example>", this, SLOT ("OnExample ()"));
			InsertItem ("<exception>", this, SLOT ("OnException ()"));
		}

		public void OnSee ()
		{
			edit.Insert ("<see></see>");
			BackUp ("</see>");
		}
		
		public void OnCode ()
		{
			edit.Insert ("<code></code>");
			BackUp ("</code>");
		}
		
		public void OnData ()
		{
			edit.Insert ("<data></data>");
			BackUp ("</data>");
		}
		
		public void OnList ()
		{
			edit.Insert ("<list></list>");
			BackUp ("</list>");
		}
		
		public void OnExample ()
		{
			edit.Insert ("<example></example>");
			BackUp ("</example>");
		}
		
		public void OnException ()
		{
			edit.Insert ("<exception></exception>");
			BackUp ("</exception>");
		}
		
		public void BackUp (string back)
		{
			foreach (char c in back)
				edit.MoveCursor (QTextEdit.CursorAction.MoveBackward, false);
		}
	}
}