public virtual HScrollbar CreateHScrollbar(CompositeRange ViewRange)
        {
            HScrollbar NewScrollbar = new HScrollbar(ViewRange);

            NewScrollbar.SuspendLayout = true;
            NewScrollbar.Background    = CreateRectangle();
            NewScrollbar.ButtonUp      = CreateButtonLeft();
            NewScrollbar.ButtonDown    = CreateButtonRight();
            NewScrollbar.Thumb         = CreateThumb();
            NewScrollbar.SuspendLayout = false;
            return(NewScrollbar);
        }
Beispiel #2
0
        public Scrollbar(CompositeRange ExistingViewRange)
            : base()
        {
            #region Scrollbar()

            this.ViewRange = ExistingViewRange;

            Etalon.Pos       = 0;
            Etalon.Size      = 1000;
            Etalon.Span.Pos  = 0;
            Etalon.Span.Size = Etalon.Size;

            ButtonPushTimer.Interval = TimeIntervalLong;
            ButtonPushTimer.Tick    += ButtonPushTimer_Tick;

            #endregion
        }
Beispiel #3
0
        public void SetProportionalSpan(CompositeRange Sample)
        {
            if (Sample.Size == 0 || this.Size == 0)
            {
                return;
            }

            double Factor = this.Size / Sample.Size;

            this.Span.Pos  = Math.Round(Sample.Span.Pos * Factor, 6);
            this.Span.Size = Math.Round(Sample.Span.Size * Factor, 6);
            if (this.Span.Size != this.Size &&
                Math.Abs(this.Span.Size - this.Size) < Epsilon)
            {
                this.Span.Size = this.Size;
            }

            this.CheckSpan();
        }