Ejemplo n.º 1
0
        internal protected virtual void FocusIn()
        {
            HasFocus = true;

            // Set the margin as the current focused accessibility element
            AtkCocoaExtensions.SetCurrentFocus(Accessible);
        }
Ejemplo n.º 2
0
        protected internal override bool HandleItemCommand(ItemCommand command)
        {
            if (focusMarkers.Count == 0)
            {
                return(false);
            }

            var marker = focusMarkers[focusedIndex] as MarginMarker;

            if (marker == null)
            {
                return(false);
            }

            switch (command)
            {
            case ItemCommand.ActivateCurrentItem:
                var lineNumber = marker.LineSegment.LineNumber;
                var y          = editor.LineToY(lineNumber);
                MousePressed(new MarginMouseEventArgs(editor, EventType.ButtonPress, 1, 0, y, ModifierType.None));

                if (focusedIndex >= focusMarkers.Count)
                {
                    focusedIndex = focusMarkers.Count - 1;
                }

                editor.RedrawMargin(this);
                break;

            case ItemCommand.FocusNextItem:
                focusedIndex++;

                SanitizeFocusedIndex();

                marker = focusMarkers[focusedIndex] as MarginMarker;
                editor.CenterTo(marker.LineSegment.LineNumber, 1);
                break;

            case ItemCommand.FocusPreviousItem:
                focusedIndex--;

                SanitizeFocusedIndex();

                marker = focusMarkers[focusedIndex] as MarginMarker;
                editor.CenterTo(marker.LineSegment.LineNumber, 1);
                break;
            }

            if (marker != null && markerToAccessible != null)
            {
                var accessible = markerToAccessible[marker];
                if (accessible != null)
                {
                    AtkCocoaExtensions.SetCurrentFocus(accessible.Accessible);
                }
            }
            return(true);
        }
Ejemplo n.º 3
0
        void HighlightFold(FoldSegment segment)
        {
            var line = segment.GetStartLine(editor.Document);
            var list = new List <FoldSegment>(editor.Document.GetFoldingContaining(line));

            list.Sort((x, y) => x.Offset.CompareTo(y.Offset));

            editor.TextViewMargin.DisposeLayoutDict();
            editor.TextViewMargin.BackgroundRenderer = new FoldingScreenbackgroundRenderer(editor, list);
            editor.ScrollTo(line.LineNumber, 0);

            if (accessibles != null)
            {
                AtkCocoaExtensions.SetCurrentFocus(accessibles[segment].Accessible);
            }
        }
Ejemplo n.º 4
0
 internal protected virtual void FocusOut()
 {
     HasFocus = false;
     AtkCocoaExtensions.SetCurrentFocus(null);
 }