Draw and operate a track bar.
상속: ViewDrawPanel
예제 #1
0
        /// <summary>
        /// Initialize a new instance of the KryptonTrackBar class.
        /// </summary>
        public KryptonTrackBar()
        {
            // Default values
            _autoSize = true;
            _requestedDim = 0;

            // Create the palette storage
            _stateCommon = new PaletteTrackBarRedirect(Redirector, NeedPaintDelegate);
            _stateFocus = new PaletteTrackBarRedirect(Redirector, NeedPaintDelegate);
            _stateDisabled = new PaletteTrackBarStates(_stateCommon, NeedPaintDelegate);
            _stateNormal = new PaletteTrackBarStates(_stateCommon, NeedPaintDelegate);
            _stateTracking = new PaletteTrackBarPositionStates(_stateCommon, NeedPaintDelegate);
            _statePressed = new PaletteTrackBarPositionStates(_stateCommon, NeedPaintDelegate);

            // Create the override handling classes
            _overrideNormal = new PaletteTrackBarStatesOverride(_stateFocus, _stateNormal, PaletteState.FocusOverride);
            _overrideTracking = new PaletteTrackBarPositionStatesOverride(_stateFocus, _stateTracking, PaletteState.FocusOverride);
            _overridePressed = new PaletteTrackBarPositionStatesOverride(_stateFocus, _statePressed, PaletteState.FocusOverride);

            // Create the view manager instance
            _drawTrackBar = new ViewDrawTrackBar(_overrideNormal, _stateDisabled, _overrideTracking, _overridePressed, NeedPaintDelegate);
            _drawTrackBar.ValueChanged += new EventHandler(OnDrawValueChanged);
            _drawTrackBar.Scroll += new EventHandler(OnDrawScroll);
            _drawTrackBar.RightToLeft = RightToLeft;
            ViewManager = new ViewManager(this, _drawTrackBar);
        }
예제 #2
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 ViewDrawTrackTicks class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 /// <param name="topRight">Showing ticks to the top/right or bottom/left.</param>
 public ViewDrawTrackTicks(ViewDrawTrackBar drawTrackBar, bool topRight)
 {
     _drawTrackBar = drawTrackBar;
     _topRight     = topRight;
 }
예제 #4
0
 /// <summary>
 /// Initialize a new instance of the ViewDrawTrackTrack class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 public ViewDrawTrackTrack(ViewDrawTrackBar drawTrackBar)
 {
     _drawTrackBar = drawTrackBar;
 }
예제 #5
0
 /// <summary>
 /// Initialize a new instance of the ViewDrawTrackPosition class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 public ViewDrawTrackPosition(ViewDrawTrackBar drawTrackBar)
 {
     _drawTrackBar = drawTrackBar;
 }
예제 #6
0
 /// <summary>
 /// Initialize a new instance of the ViewDrawTrackTicks class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 /// <param name="topRight">Showing ticks to the top/right or bottom/left.</param>
 public ViewDrawTrackTicks(ViewDrawTrackBar drawTrackBar, bool topRight)
 {
     _drawTrackBar = drawTrackBar;
     _topRight = topRight;
 }
 /// <summary>
 /// Initialize a new instance of the ViewDrawTrackPosition class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 public ViewDrawTrackPosition(ViewDrawTrackBar drawTrackBar)
 {
     _drawTrackBar = drawTrackBar;
 }
 /// <summary>
 /// Initialize a new instance of the ViewDrawTrackTrack class.
 /// </summary>
 /// <param name="drawTrackBar">Reference to owning track bar.</param>
 public ViewDrawTrackTrack(ViewDrawTrackBar drawTrackBar)
 {
     _drawTrackBar = drawTrackBar;
 }