Example #1
0
        public ColorPicker(Root root,
                           string id,
                           ColorPickerProperties properties,
                           ColorStyle[] colors)
            : base(root, id, properties)
        {
            AddDisplayMode("Menu");

            _colors = colors;
            _colorTable = new Table();
        }
Example #2
0
        protected override HtmlElement CreateDOMElementForDisplayMode(string displayMode)
        {
            switch (displayMode)
            {
                case "Menu":
                    _elmDefault = new Table();
                    _elmDefault.SetAttribute("mscui:controltype", ControlType);

                    _elmDefaultTbody = new TableBody();
                    _elmDefaultTbody.ClassName = "ms-cui-it";
                    _elmDefault.SetAttribute("cellspacing", "0");
                    _elmDefault.SetAttribute("cellpadding", "0");
                    _elmDefaultTbody.SetAttribute("cellspacing", "0");
                    _elmDefaultTbody.SetAttribute("cellpadding", "0");

                    _elmDefault.MouseOut += OnControlMouseOut;

                    EnsureDivArrays();

                    TableRow elmRow;
                    TableCell elmCell;
                    Anchor elmCellA;
                    Div elmDiv;
                    Div elmDivOuter;
                    int idx = 0;
                    for (int i = 0; i < 10; i++)
                    {
                        elmRow = new TableRow();
                        _elmDefaultTbody.AppendChild(elmRow);
                        for (int j = 0; j < 10; j++)
                        {
                            elmCell = new TableCell();
                            elmCell.Style.Padding = "0px";
                            elmRow.AppendChild(elmCell);

                            elmCellA = new Anchor();

                            Utility.NoOpLink(elmCellA);
                            Utility.SetAriaTooltipProperties(Properties, elmCellA);

                            elmCellA.Focus += OnCellFocus;
                            elmDiv = new Div();
                            elmDiv.ClassName = "ms-cui-it-inactiveCell";

                            elmDivOuter = new Div();
                            elmDivOuter.Id = this.Id + "-" + idx;
                            elmDivOuter.ClassName = "ms-cui-it-inactiveCellOuter";

                            elmCell.MouseOver += OnCellHover;
                            elmCell.Click += OnCellClick;
                            elmCell.AppendChild(elmDivOuter);
                            elmDivOuter.AppendChild(elmDiv);
                            elmDiv.AppendChild(elmCellA);

                            _innerDivs[idx] = elmDiv;
                            _outerDivs[idx] = elmDivOuter;
                            idx++;
                        }
                    }

                    _elmDefault.AppendChild(_elmDefaultTbody);
                    return _elmDefault;
                default:
                    EnsureValidDisplayMode(displayMode);
                    break;
            }
            return null;
        }
Example #3
0
 public override void Dispose()
 {
     base.Dispose();
     _elmDefault = null;
     _elmDefaultTbody = null;
 }
Example #4
0
        public TestPageComponent()
        {
            _selectionCount = 0;
            _itemSelected = new Dictionary<int, bool>();
            _itemCbxCache = new Dictionary<int, Input>();
            _listViewTable = (Table)Browser.Document.GetById("onetidDoclibViewTbl0");

            _selectAllCheckbox = (Input)Browser.Document.GetById("selectAllCbx");
            _selectAllCheckbox.Click += OnSelectAllCbxClick;

            for (int i = 1; i < 5; i++)
            {
                // Set that each item is unselected and add event handler
                _itemSelected[i] = false;

                string cbxName = "item" + i.ToString() + "cbx";
                Input itemcbx = (Input)Browser.Document.GetById(cbxName);
                itemcbx.Click += OnItemCbxClick;
                _itemCbxCache[i] = itemcbx;
            }
        }