Beispiel #1
0
		internal void GotoTask (QuickTask quickTask)
		{
			if (quickTask == null)
				return;
			var line = quickTask.Location.Line;
			if (line < 1 || line >= TextEditor.LineCount)
				return;
			TextEditor.Caret.Location = new TextLocation (line, Math.Max (1, quickTask.Location.Column));
			TextEditor.CenterToCaret ();
			TextEditor.StartCaretPulseAnimation ();
			TextEditor.GrabFocus ();
		}
		void MoveToTask (QuickTask task)
		{
			if (task.Location.IsEmpty) {
				Console.WriteLine ("empty:" + task.Description);
			}
			var loc = new DocumentLocation (
				Math.Max (DocumentLocation.MinLine, task.Location.Line),
				Math.Max (DocumentLocation.MinColumn, task.Location.Column)
			);
			TextEditor.Caret.Location = loc;
			TextEditor.CenterToCaret ();
			TextEditor.StartCaretPulseAnimation ();
			TextEditor.GrabFocus ();
		}
Beispiel #3
0
            public QuickTaskAccessible(QuickTaskStrip parent, QuickTaskOverviewMode parentMode, QuickTask t) : this(parent, parentMode)
            {
                task  = t;
                usage = null;

                Accessible.Title = t.Description;
                Accessible.Help  = string.Format(GettextCatalog.GetString("Jump to line {0}"), strip.TextEditor.OffsetToLineNumber(t.Location));

                var line          = mode.TextEditor.OffsetToLineNumber(t.Location);
                var y             = mode.LineToY(line);
                var frameInParent = new Gdk.Rectangle(0, (int)y, mode.Allocation.Width, 2);

                Accessible.FrameInGtkParent = frameInParent;

                int   halfParentHeight = strip.Allocation.Height / 2;
                float dy = (float)y - halfParentHeight;

                y = (int)(halfParentHeight - dy);
                Accessible.FrameInParent = new Gdk.Rectangle(0, (int)y, mode.Allocation.Width, 2);
            }