Exemple #1
0
        public override void OnTagLoaded()
        {
            // Append the text,dropdown and button.

            // Append the special 'placeholder' and dropdown button (virtual elements):
            ComputedStyle computed = Style.Computed;

            computed.GetOrCreateVirtual(HtmlSelectButtonElement.Priority - 1, "div");
            computed.GetOrCreateVirtual(HtmlSelectButtonElement.Priority, "selectbutton");

            // Selects are unusual in that they don't draw their own childnodes:
            RenderData.Virtuals.AllowDrawKids = false;
        }
Exemple #2
0
        public override void OnTagLoaded()
        {
            // Append the internal green bar:
            ComputedStyle computed = Style.Computed;

            Bar_ = computed.GetOrCreateVirtual(Priority, "div") as HtmlDivElement;
        }
Exemple #3
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";
        }