Draw the track for the track bar.
Наследование: ViewLeaf
Пример #1
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawTrackPosition class.
        /// </summary>
        /// <param name="drawTrackBar">Reference to owning track bar.</param>
        public ViewDrawTP(ViewDrawTrackBar drawTrackBar)
        {
            _drawTrackBar = drawTrackBar;

            // Create child view elements
            _drawTrack = new ViewDrawTrackTrack(_drawTrackBar);
            _drawPosition = new ViewDrawTrackPosition(_drawTrackBar);
            Add(_drawTrack);
            Add(_drawPosition);

            // Use controller for the entire track area
            TrackBarController tbController = new TrackBarController(this);
            drawTrackBar.MouseController = tbController;
            drawTrackBar.KeyController = tbController;
            drawTrackBar.SourceController = tbController;

            // Use controller for dragging the position indicator
            TrackPositionController tpController = new TrackPositionController(this);
            _drawPosition.MouseController = tpController;
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawTrackPosition class.
        /// </summary>
        /// <param name="drawTrackBar">Reference to owning track bar.</param>
        public ViewDrawTP(ViewDrawTrackBar drawTrackBar)
        {
            ViewDrawTrackBar = drawTrackBar;

            // Create child view elements
            _drawTrack = new ViewDrawTrackTrack(ViewDrawTrackBar);
            ViewDrawTrackPosition = new ViewDrawTrackPosition(ViewDrawTrackBar);
            Add(_drawTrack);
            Add(ViewDrawTrackPosition);

            // Use controller for the entire track area
            TrackBarController tbController = new TrackBarController(this);
            drawTrackBar.MouseController = tbController;
            drawTrackBar.KeyController = tbController;
            drawTrackBar.SourceController = tbController;

            // Use controller for dragging the position indicator
            TrackPositionController tpController = new TrackPositionController(this);
            ViewDrawTrackPosition.MouseController = tpController;
        }