Esempio n. 1
0
        void UpdatePathAccessibility()
        {
            if (!AccessibilityElementProxy.Enabled)
            {
                return;
            }

            var elements = new AtkCocoaHelper.AccessibilityElementProxy [leftPath.Length + rightPath.Length];
            int idx      = 0;

            foreach (var entry in leftPath)
            {
                elements [idx]             = entry.Accessible;
                entry.Accessible.GtkParent = this;
                entry.PerformShowMenu     += PerformShowMenu;
                idx++;
            }
            foreach (var entry in rightPath)
            {
                elements [idx]             = entry.Accessible;
                entry.Accessible.GtkParent = this;
                entry.PerformShowMenu     += PerformShowMenu;
                idx++;
            }

            Accessible.ReplaceAccessibilityElements(elements);
        }
Esempio n. 2
0
 PathEntry()
 {
     //Accessible = new AtkCocoaHelper.AccessibilityElementButtonProxy ();
     Accessible               = AccessibilityElementProxy.ButtonElementProxy();
     Accessible.Identifier    = "Breadcrumb";
     Accessible.PerformPress += OnPerformShowMenu;
 }
Esempio n. 3
0
        public Tab(Tabstrip parent, string label, TabPosition tabPosition)
        {
            this.parent = parent;
            this.Label  = label;

            layout = PangoUtil.CreateLayout(parent);
            layout.FontDescription = FontService.SansFont.CopyModified(Styles.FontScale11);
            layout.SetText(label);
            layout.Alignment = Pango.Alignment.Center;
            layout.GetPixelSize(out w, out h);

            if (IsSeparator)
            {
                w = SpacerWidth * 2;
            }

            this.TabPosition = tabPosition;

            if (AccessibilityElementProxy.Enabled)
            {
                Accessible = AccessibilityElementProxy.ButtonElementProxy();
                Accessible.SetRole(AtkCocoa.Roles.AXRadioButton, "tab");
                Accessible.Title         = label;
                Accessible.GtkParent     = parent;
                Accessible.Identifier    = "Tabstrip.Tab";
                Accessible.PerformPress += OnTabPressed;
            }
        }
Esempio n. 4
0
            void CalcAccessibility()
            {
                var columnElement = new AtkCocoaHelper.AccessibilityElementProxy();

                columnElement.GtkParent = this;
                columnElement.SetRole(AtkCocoa.Roles.AXColumn);
                Accessible.AddAccessibleElement(columnElement);

                for (int i = 0; i < win.DataProvider.IconCount; i++)
                {
                    var rowElement = new AtkCocoaHelper.AccessibilityElementProxy();
                    rowElement.GtkParent = this;
                    rowElement.SetRole(AtkCocoa.Roles.AXRow);
                    Accessible.AddAccessibleElement(rowElement);

                    var cellElement = new AtkCocoaHelper.AccessibilityElementProxy();
                    cellElement.GtkParent = this;
                    cellElement.SetRole(AtkCocoa.Roles.AXCell);
                    columnElement.AddAccessibleChild(cellElement);
                    rowElement.AddAccessibleChild(cellElement);

                    var textElement = new TextElement();
                    textElement.RowIndex      = i;
                    textElement.PerformPress += PerformPress;
                    textElement.GtkParent     = this;
                    textElement.Value         = win.DataProvider.GetMarkup(i);
                    cellElement.AddAccessibleChild(textElement);
                }
            }
Esempio n. 5
0
 public void Dispose()
 {
     if (accessible != null)
     {
         accessible.PerformPress -= OnPerformShowMenu;
         accessible = null;
     }
 }
Esempio n. 6
0
        void UpdateAccessibilityTabs()
        {
            int i       = 0;
            var proxies = new AtkCocoaHelper.AccessibilityElementProxy [tabs.Count];

            foreach (var tab in tabs)
            {
                proxies [i] = tab.Accessible;
                i++;
            }

            Accessible.SetTabs(proxies);
        }
        public static void AddAccessibleElement(this Atk.Object o, AccessibilityElementProxy child)
        {
            var nsa = GetNSAccessibilityElement(o) as NSAccessibilityElement;

            if (nsa == null)
            {
                return;
            }

            var p = child.Proxy as RealAccessibilityElementProxy;

            if (p == null)
            {
                throw new Exception($"Invalid proxy child type {p.GetType ()}");
            }
            nsa.AccessibilityAddChildElement(p);
        }
        public static void RemoveAccessibleElement(this Atk.Object o, AccessibilityElementProxy child)
        {
            var nsa = GetNSAccessibilityElement(o);

            if (nsa == null)
            {
                return;
            }

            var children = nsa.AccessibilityChildren;

            if (children == null || children.Length == 0)
            {
                return;
            }

            var p = child.Proxy as RealAccessibilityElementProxy;

            if (p == null)
            {
                throw new Exception($"Invalid proxy child type {p.GetType ()}");
            }

            var idx = children.IndexOf(p);

            if (idx == -1)
            {
                return;
            }

            var newChildren = new NSObject [children.Length - 1];

            for (int i = 0, j = 0; i < children.Length; i++)
            {
                if (i == idx)
                {
                    continue;
                }

                newChildren [j] = children [i];
                j++;
            }

            nsa.AccessibilityChildren = newChildren;
        }
Esempio n. 9
0
        void UpdateAccessibilityTabs()
        {
            if (!AccessibilityElementProxy.Enabled)
            {
                return;
            }

            int i       = 0;
            var proxies = new AtkCocoaHelper.AccessibilityElementProxy [tabs.Count];

            foreach (var tab in tabs)
            {
                proxies [i]          = tab.Accessible;
                tab.Accessible.Index = i;
                i++;
            }

            Accessible.SetTabs(proxies);
        }
Esempio n. 10
0
 public static void RemoveAccessibleElement(this Atk.Object o, AccessibilityElementProxy child)
 {
 }
Esempio n. 11
0
        public static void SetCurrentFocus(AccessibilityElementProxy focusElement)
        {
#if MAC
            AtkCocoaMacExtensions.SetCurrentFocus(focusElement);
#endif
        }