Beispiel #1
0
        /// <summary>
        /// Initialize a new instance of the ViewDrawTrackBar class.
        /// </summary>
        /// <param name="stateNormal">Referenece to normal state values.</param>
        /// <param name="stateDisabled">Referenece to disabled state values.</param>
        /// <param name="stateTracking">Referenece to tracking state values.</param>
        /// <param name="statePressed">Referenece to pressed state values.</param>
        /// <param name="needPaint">Delegate used to request repainting.</param>
        public ViewDrawTrackBar(PaletteTrackBarStatesOverride stateNormal,
                                PaletteTrackBarStates stateDisabled,
                                PaletteTrackBarPositionStatesOverride stateTracking,
                                PaletteTrackBarPositionStatesOverride statePressed,
                                NeedPaintHandler needPaint)
            : base(stateNormal.Back)
        {
            // Default state
            _stateNormal   = stateNormal;
            _stateDisabled = stateDisabled;
            _stateTracking = stateTracking;
            _statePressed  = statePressed;
            _padding       = Padding.Empty;
            _orientation   = Orientation.Horizontal;
            _value         = 0;
            _minimum       = 0;
            _maximum       = 10;
            _smallChange   = 1;
            _largeChange   = 5;
            _tickFreq      = 1;
            _tickStyle     = TickStyle.BottomRight;
            _trackBarSize  = PaletteTrackBarSize.Medium;
            _volumeControl = false;
            _needPaint     = needPaint;

            // Create drawing/layout elements
            _trackPosition       = new ViewDrawTP(this);
            _ticksTop            = new ViewDrawTrackTicks(this, true);
            _ticksBottom         = new ViewDrawTrackTicks(this, false);
            _ticksTop.Visible    = false;
            _ticksBottom.Visible = true;

            // Connect up layout structure
            _layoutTop = new ViewLayoutDocker();
            _layoutTop.Add(_ticksTop, ViewDockStyle.Top);
            _layoutTop.Add(_trackPosition, ViewDockStyle.Top);
            _layoutTop.Add(_ticksBottom, ViewDockStyle.Top);
            _layoutTop.Padding = Padding;
            Add(_layoutTop);
        }
Beispiel #2
0
 /// <summary>
 /// Initialize a new instance of the TrackBarController class.
 /// </summary>
 /// <param name="drawTB">Associated drawing element.</param>
 public TrackBarController(ViewDrawTP drawTB)
 {
     _drawTB = drawTB;
 }
Beispiel #3
0
 /// <summary>
 /// Initialize a new instance of the TrackPositionController class.
 /// </summary>
 /// <param name="drawTB">Associated drawing element.</param>
 public TrackPositionController(ViewDrawTP drawTB)
 {
     _drawTB = drawTB;
 }