Ejemplo n.º 1
0
        private void DoDrawTrack(Graphics gr, Rectangle drawRect, Rectangle visibleRect, Rectangle trackRect, ScrollBarElementState state, ScrollBarTrackType type)
        {
            ScrollBarTrack defaultHighlight = null;
            switch (state)
            {
                case ScrollBarElementState.Normal:
                    defaultHighlight = (type == ScrollBarTrackType.Low) ? this.LowTrack : this.HighTrack;
                    break;

                case ScrollBarElementState.Pressed:
                    defaultHighlight = (type == ScrollBarTrackType.Low) ? this.LowTrackHighlight : this.HighTrackHighlight;
                    break;

                case ScrollBarElementState.Disabled:
                    defaultHighlight = (type == ScrollBarTrackType.Low) ? this.LowTrackDisabled : this.HighTrackDisabled;
                    break;
            }
            if (defaultHighlight == null)
            {
                switch (state)
                {
                    case ScrollBarElementState.Normal:
                        defaultHighlight = ScrollBarTrack.Default;
                        break;

                    case ScrollBarElementState.Pressed:
                        defaultHighlight = ScrollBarTrack.DefaultHighlight;
                        break;

                    case ScrollBarElementState.Disabled:
                        defaultHighlight = ScrollBarTrack.DefaultDisabled;
                        break;
                }
            }
            Color window = SystemColors.Window;
            if (base.Parent != null)
            {
                window = base.Parent.BackColor;
            }
            defaultHighlight.Draw(gr, drawRect, visibleRect, trackRect, type, this._scrollBarOrientation, window);
        }
Ejemplo n.º 2
0
        private void DoDrawArrowButton(Graphics gr, Rectangle drawRect, ScrollBarArrow type, ScrollBarElementState state)
        {
            ScrollBarButton leftUpButton = null;
            if ((type == ScrollBarArrow.Left) || (type == ScrollBarArrow.Up))
            {
                switch (state)
                {
                    case ScrollBarElementState.Normal:
                        leftUpButton = this.LeftUpButton;
                        goto Label_006B;

                    case ScrollBarElementState.Pressed:
                        leftUpButton = this.LeftUpButtonHighlight;
                        goto Label_006B;

                    case ScrollBarElementState.Disabled:
                        leftUpButton = this.LeftUpButtonDisabled;
                        goto Label_006B;
                }
            }
            else
            {
                switch (state)
                {
                    case ScrollBarElementState.Normal:
                        leftUpButton = this.RightDownButton;
                        goto Label_006B;

                    case ScrollBarElementState.Pressed:
                        leftUpButton = this.RightDownButtonHighlight;
                        goto Label_006B;

                    case ScrollBarElementState.Disabled:
                        leftUpButton = this.RightDownButtonDisabled;
                        goto Label_006B;
                }
            }
            Label_006B:
            if (leftUpButton == null)
            {
                switch (state)
                {
                    case ScrollBarElementState.Normal:
                        leftUpButton = ScrollBarButton.Default;
                        break;

                    case ScrollBarElementState.Pressed:
                        leftUpButton = ScrollBarButton.DefaultHighlight;
                        break;

                    case ScrollBarElementState.Disabled:
                        leftUpButton = ScrollBarButton.DefaultDisabled;
                        break;
                }
            }
            Color window = SystemColors.Window;
            if (base.Parent != null)
            {
                window = base.Parent.BackColor;
            }
            leftUpButton.Draw(gr, drawRect, type, window);
        }
Ejemplo n.º 3
0
        private void DoDrawThumb(Graphics gr, Rectangle drawRect, ScrollBarElementState state)
        {
            ScrollBarThumb thumbHighlight = null;
            switch (state)
            {
                case ScrollBarElementState.Normal:
                    thumbHighlight = this.Thumb;
                    break;

                case ScrollBarElementState.Pressed:
                    thumbHighlight = this.ThumbHighlight;
                    break;

                case ScrollBarElementState.Disabled:
                    thumbHighlight = this.ThumbDisabled;
                    break;
            }
            if (thumbHighlight == null)
            {
                switch (state)
                {
                    case ScrollBarElementState.Normal:
                        thumbHighlight = ScrollBarThumb.Default;
                        break;

                    case ScrollBarElementState.Pressed:
                        thumbHighlight = ScrollBarThumb.DefaultHighlight;
                        break;
                }
            }
            if (thumbHighlight != null)
            {
                thumbHighlight.Draw(gr, drawRect, this._scrollBarOrientation);
            }
        }
Ejemplo n.º 4
0
 public DrawEventArgs(System.Drawing.Graphics graphics, Rectangle bounds, ScrollBarElementState state)
 {
     this._graphics = graphics;
     this._bounds = bounds;
     this._state = state;
 }
Ejemplo n.º 5
0
 public DrawArrowButtonEventArgs(Graphics graphics, Rectangle bounds, ScrollBarElementState state, ScrollBarArrow type) : base(graphics, bounds, state)
 {
     this._type = type;
 }
Ejemplo n.º 6
0
 public DrawEventArgs(System.Drawing.Graphics graphics, Rectangle bounds, ScrollBarElementState state)
 {
     this._graphics = graphics;
     this._bounds   = bounds;
     this._state    = state;
 }
Ejemplo n.º 7
0
 public DrawTrackEventArgs(Graphics graphics, Rectangle bounds, ScrollBarElementState state, Rectangle visibleRect, Rectangle trackRect, ScrollBarTrackType track) : base(graphics, bounds, state)
 {
     this._visibleRect = visibleRect;
     this._trackRect   = trackRect;
     this._track       = track;
 }
Ejemplo n.º 8
0
 public DrawArrowButtonEventArgs(Graphics graphics, Rectangle bounds, ScrollBarElementState state, ScrollBarArrow type)
     : base(graphics, bounds, state)
 {
     this._type = type;
 }