public override ApplyState Apply(ComputedStyle style, Value value) { // Request a shortform redraw: style.RequestFastLayout(); // Grab the virtual elements: VirtualElements virts = style.RenderData.Virtuals; // Update them: if (virts != null) { // H: HtmlScrollbarElement scroll = virts.Get(ComputedStyle.HorizontalScrollPriority) as HtmlScrollbarElement; if (scroll != null) { scroll.ElementScrolled(); } // V: scroll = virts.Get(ComputedStyle.VerticalScrollPriority) as HtmlScrollbarElement; if (scroll != null) { scroll.ElementScrolled(); } } // Ok! return(ApplyState.Ok); }
protected override bool HandleLocalEvent(Dom.Event e, bool bubblePhase) { if (e.type == "mousedown") { // Get the scroll bar: HtmlScrollbarElement scroll = parentElement as HtmlScrollbarElement; // And scroll it: scroll.ScrollBy(IsStart?-1:1); } // Handle locally: return(base.HandleLocalEvent(e, bubblePhase)); }
protected override bool HandleLocalEvent(Dom.Event e, bool bubblePhase) { if (base.HandleLocalEvent(e, bubblePhase)) { // It was blocked. Don't run the default. return(true); } if (e.type == "mousedown") { // Get the scroll bar: HtmlScrollbarElement scroll = parentElement as HtmlScrollbarElement; // And scroll it: scroll.ScrollBy(IsStart?-1:1); } return(false); }
public override void OnChildrenLoaded() { IsStart = (this == parentNode.firstChild); // Set attribs for CSS: setAttribute("part", IsStart ? "start" : "end"); HtmlScrollbarElement bar = parentElement as HtmlScrollbarElement; string type; if (bar.IsVertical) { type = IsStart?"up":"down"; } else { type = IsStart?"left":"right"; } setAttribute("orient", type); }