Beispiel #1
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;
            }
        }
Beispiel #2
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);
                }
            }