Beispiel #1
0
        public override void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
        {
            base.Arrange(x, y, hostElement);

            if (_dom == null)
            {
                _dom = jQuery.FromHtml("<div class='ui-vertical-scrollbar' style='position: absolute;'></div>").AppendTo(hostElement);
                _near = jQuery.FromHtml("<div class='ui-scroll-up-button'></div>").AppendTo(_dom).MouseDown(LineNear);
                _track = jQuery.FromHtml("<div class='ui-scroll-vertical-track'></div>").AppendTo(_dom).MouseDown(Page);
                _thumb = jQuery.FromHtml("<div class='ui-scroll-vertical-thumb' style='position: relative'></div>").AppendTo(_track).MouseDown(Scrub);
                _far = jQuery.FromHtml("<div class='ui-scroll-down-button'></div>").AppendTo(_dom).MouseDown(LineFar);
            }

            int buttonLength = (y.Length > 2*x.Length) ? x.Length : (int)Math.Floor(y.Length/2);
            int trackHeight = y.Length - 2*buttonLength;

            _minThumbLength = Math.Min(buttonLength, trackHeight);
            _dom.CSS("width", x.Length + "px").CSS("height", y.Length + "px").CSS("top", y.Position + "px").CSS("left", x.Position + "px");
            _near.CSS("width", x.Length + "px").CSS("height", buttonLength + "px");
            _far.CSS("width", x.Length + "px").CSS("height", buttonLength + "px");
            _track.CSS("width", x.Length + "px").CSS("height", trackHeight + "px");
            _thumb.CSS("width", x.Length + "px");

            ScrollableAxisChanged();
        }
Beispiel #2
0
 public override void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
 {
     base.Arrange(x, y, hostElement);
     /* TODO
     if (_stackPanel != null)
     {
         _stackPanel.Arrange(horizontal, vertical, hostElement);
     }
      */
 }
Beispiel #3
0
        public override void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
        {
            base.Arrange(x, y, hostElement);

            if (_domContent != null)
            {
                if (!_isReal)
                {
                    _domContent.AppendTo(hostElement);
                }
                _domContent.CSS("position", "absolute")
                    .CSS("left", x.Position + "px")
                    .CSS("top", y.Position + "px")
                    .CSS("width", x.Length + "px")
                    .CSS("height", y.Length + "px");
            }
        }
Beispiel #4
0
 public override void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
 {
     // do nothing; this control has no physical representation.
 }
Beispiel #5
0
 public virtual void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
 {
     YArrangement = y.Clone();
     XArrangement = x.Clone();
 }
Beispiel #6
0
        public override void Arrange(AxisArrangement x, AxisArrangement y, Element hostElement)
        {
            base.Arrange(x, y, hostElement);

            int scrollbarWidth = 18; // TODO: from scrollbar?

            if (_scroller == null)
            {
                _scroller = jQuery.FromHtml(
                    "<div style='overflow: hidden; -khtml-user-select: none; -moz-user-select: none; position: absolute'></div>")
                    .AppendTo(hostElement);

                _content = jQuery.FromHtml("<div style='overflow: hidden; -khtml-user-select: none; -moz-user-select: none; position: absolute'></div>").AppendTo(_scroller);

                _scrollbar = new ScrollBar();
                _scrollbar.ScrollableAxis = this;
                _scrollbar.InputSource = _scroller[0];
            }

            _content.Width(x.Length).Height(GetAvailableItemCount() * _fixedItemHeight);
            _scroller.Width(x.Length).Height(y.Length)
                .CSS("top", y.Position + "px").CSS("left", x.Position + "px");

            _viewportLines = Math.Floor(_scroller.GetInnerHeight() / (double)_fixedItemHeight);

            AxisArrangement h = x.Clone();
            h.Position = h.Position + h.Length - scrollbarWidth;
            h.Length = scrollbarWidth;

            _scrollbar.Arrange(h, y, _scroller[0]);

            Synchronize(true);
        }