Esempio n. 1
0
        /// <summary>Drops this select box down.</summary>
        public void Drop()
        {
            if (Dropped)
            {
                return;
            }

            // Focus if it isn't already:
            focus();

            // Get the CS of the HTML node:
            ComputedStyle computed = htmlDocument.html.Style.Computed;

            // Get/create it:
            Dropdown = computed.GetOrCreateVirtual(HtmlDropdownElement.Priority, "dropdown") as HtmlDropdownElement;

            // Act like the options are kids of the dropdown:
            Dropdown.childNodes_ = RawOptions;

            // Get my computed style:
            computed = Style.Computed;

            // Locate it to the select:
            LayoutBox box = computed.FirstBox;

            Dropdown.style.left  = box.X + "px";
            Dropdown.style.width = box.Width + "px";
            Dropdown.style.top   = (box.Y + box.PaddedHeight) + "px";
        }
Esempio n. 2
0
        /// <summary>Closes this dropdown.</summary>
        public void Hide()
        {
            if (!Dropped)
            {
                return;
            }

            // Clear the child nodes (we don't want them to think they've been removed from the DOM):
            Dropdown.childNodes_ = null;
            Dropdown             = null;

            // Get the CS of the HTML node:
            ComputedStyle computed = htmlDocument.html.Style.Computed;

            // Remove:
            computed.RemoveVirtual(HtmlDropdownElement.Priority);
        }