Exemplo n.º 1
0
        /*
         * InitializeRightBottomTrack
         */

        private void InitializeRightBottomTrack(ScrollTrack rightBottomTrack)
        {
            Debug.Assert(rightBottomTrack != null, "rightBottomTrack != null");

            rightBottomTrack.MouseDown += _rightBottomTrack_MouseDown;
            rightBottomTrack.MouseUp   += _rightBottomTrack_MouseUp;
        }
Exemplo n.º 2
0
        /*
         * InitializeLeftTopTrack
         */

        private void InitializeLeftTopTrack(ScrollTrack leftTopTrack)
        {
            Debug.Assert(leftTopTrack != null, "leftTopTrack != null");

            leftTopTrack.MouseDown += _leftTopTrack_MouseDown;
            leftTopTrack.MouseUp   += _leftTopTrack_MouseUp;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenScrollBar"/> class.
        /// </summary>
        /// <param name="serviceProvider">
        /// Requires:<para/>
        /// <see cref="INuGenButtonStateService"/><para/>
        /// <see cref="INuGenControlStateService"/><para/>
        /// <see cref="INuGenValueTrackerService"/><para/>
        /// <see cref="INuGenScrollBarRenderer"/><para/>
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para>
        /// </exception>
        public NuGenScrollBar(INuGenServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            _components = new Container();

            _smallChangeDownTimer = new Timer(_components);
            _smallChangeUpTimer   = new Timer(_components);
            _largeChangeDownTimer = new Timer(_components);
            _largeChangeUpTimer   = new Timer(_components);

            _leftTopButton     = new NuGenScrollButton(serviceProvider);
            _rightBottomButton = new NuGenScrollButton(serviceProvider);
            _leftTopTrack      = new ScrollTrack(serviceProvider);
            _rightBottomTrack  = new ScrollTrack(serviceProvider);
            _sizeBox           = new SizeBox(serviceProvider);

            this.InitializeSizeBox(_sizeBox);
            this.InitializeLeftTopButton(_leftTopButton);
            this.InitializeRightBottomButton(_rightBottomButton);
            this.InitializeLeftTopTrack(_leftTopTrack);
            this.InitializeRightBottomTrack(_rightBottomTrack);

            this.InitializeLargeChangeDownTimer(_largeChangeDownTimer);
            this.InitializeLargeChangeUpTimer(_largeChangeUpTimer);
            this.InitializeSmallChangeDownTimer(_smallChangeDownTimer);
            this.InitializeSmallChangeUpTimer(_smallChangeUpTimer);

            this.Controls.AddRange(
                new Control[] {
                _sizeBox
                , _leftTopTrack
                , _rightBottomTrack
                , _leftTopButton
                , _rightBottomButton
            }
                );

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.BackColor = Color.Transparent;

            this.ValueTracker.LargeChange = this.DefaultLargeChange;
            this.ValueTracker.Maximum     = this.DefaultMaximum;
            this.ValueTracker.Minimum     = this.DefaultMinimum;
            this.ValueTracker.SmallChange = this.DefaultSmallChange;
            this.ValueTracker.Value       = this.DefaultValue;

            this.BuildLayout();
        }
Exemplo n.º 4
0
		/*
		 * InitializeRightBottomTrack
		 */

		private void InitializeRightBottomTrack(ScrollTrack rightBottomTrack)
		{
			Debug.Assert(rightBottomTrack != null, "rightBottomTrack != null");

			rightBottomTrack.MouseDown += _rightBottomTrack_MouseDown;
			rightBottomTrack.MouseUp += _rightBottomTrack_MouseUp;
		}
Exemplo n.º 5
0
		/*
		 * InitializeLeftTopTrack
		 */

		private void InitializeLeftTopTrack(ScrollTrack leftTopTrack)
		{
			Debug.Assert(leftTopTrack != null, "leftTopTrack != null");

			leftTopTrack.MouseDown += _leftTopTrack_MouseDown;
			leftTopTrack.MouseUp += _leftTopTrack_MouseUp;
		}
Exemplo n.º 6
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenScrollBar"/> class.
		/// </summary>
		/// <param name="serviceProvider">
		/// Requires:<para/>
		/// <see cref="INuGenButtonStateService"/><para/>
		/// <see cref="INuGenControlStateService"/><para/>
		/// <see cref="INuGenValueTrackerService"/><para/>
		/// <see cref="INuGenScrollBarRenderer"/><para/>
		/// </param>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="serviceProvider"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenScrollBar(INuGenServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			_components = new Container();

			_smallChangeDownTimer = new Timer(_components);
			_smallChangeUpTimer = new Timer(_components);
			_largeChangeDownTimer = new Timer(_components);
			_largeChangeUpTimer = new Timer(_components);

			_leftTopButton = new NuGenScrollButton(serviceProvider);
			_rightBottomButton = new NuGenScrollButton(serviceProvider);
			_leftTopTrack = new ScrollTrack(serviceProvider);
			_rightBottomTrack = new ScrollTrack(serviceProvider);
			_sizeBox = new SizeBox(serviceProvider);

			this.InitializeSizeBox(_sizeBox);
			this.InitializeLeftTopButton(_leftTopButton);
			this.InitializeRightBottomButton(_rightBottomButton);
			this.InitializeLeftTopTrack(_leftTopTrack);
			this.InitializeRightBottomTrack(_rightBottomTrack);

			this.InitializeLargeChangeDownTimer(_largeChangeDownTimer);
			this.InitializeLargeChangeUpTimer(_largeChangeUpTimer);
			this.InitializeSmallChangeDownTimer(_smallChangeDownTimer);
			this.InitializeSmallChangeUpTimer(_smallChangeUpTimer);

			this.Controls.AddRange(
				new Control[] {
					_sizeBox
					, _leftTopTrack
					, _rightBottomTrack
					, _leftTopButton
					, _rightBottomButton
				}
			);

			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
			this.SetStyle(ControlStyles.UserPaint, true);
			this.BackColor = Color.Transparent;

			this.ValueTracker.LargeChange = this.DefaultLargeChange;
			this.ValueTracker.Maximum = this.DefaultMaximum;
			this.ValueTracker.Minimum = this.DefaultMinimum;
			this.ValueTracker.SmallChange = this.DefaultSmallChange;
			this.ValueTracker.Value = this.DefaultValue;

			this.BuildLayout();
		}