예제 #1
0
        protected internal virtual void OnTickFormatting(TrackBarTickElement tickElement)
        {
            TickFormattingEventHandler tickFormatting = this.TickFormatting;

            if (tickFormatting == null)
            {
                return;
            }
            tickFormatting((object)this, new TickFormattingEventArgs(tickElement, tickElement.TickNumber));
        }
예제 #2
0
        protected internal void UpdateTickElements()
        {
            this.Children.Clear();
            this.Invalidate();
            bool isTopLeft = (this.Parent as TrackBarScaleElement).IsTopLeft;

            for (int index = 0; index <= this.TrackBarElement.MaxTickNumber; ++index)
            {
                TrackBarTickElement tickElement = new TrackBarTickElement();
                tickElement.IsTopLeft = isTopLeft;
                tickElement.NotifyParentOnMouseInput = true;
                tickElement.ShouldHandleMouseInput   = false;
                if (this.TrackBarElement.Orientation == Orientation.Horizontal)
                {
                    tickElement.Orientation = Orientation.Vertical;
                }
                else
                {
                    tickElement.Orientation = Orientation.Horizontal;
                }
                if (this.largeTickFrequency != 0 && index % this.largeTickFrequency == 0)
                {
                    if (tickElement.Orientation == Orientation.Vertical)
                    {
                        tickElement.MinSize = new Size(tickElement.Line1.LineWidth + tickElement.Line2.LineWidth, this.LargeTickHeight);
                    }
                    else
                    {
                        tickElement.MinSize = new Size(this.LargeTickHeight, tickElement.Line1.LineWidth + tickElement.Line2.LineWidth);
                    }
                    tickElement.IsLargeTick = true;
                    tickElement.TickNumber  = index;
                    this.OnTickFormatting(tickElement);
                    this.Children.Add((RadElement)tickElement);
                }
                else if (this.smallTickFrequency != 0 && index % this.smallTickFrequency == 0)
                {
                    if (tickElement.Orientation == Orientation.Vertical)
                    {
                        tickElement.MinSize = new Size(tickElement.Line1.LineWidth + tickElement.Line2.LineWidth, this.SmallTickHeight);
                    }
                    else
                    {
                        tickElement.MinSize = new Size(this.SmallTickHeight, tickElement.Line1.LineWidth + tickElement.Line2.LineWidth);
                    }
                    tickElement.IsLargeTick = false;
                    tickElement.TickNumber  = index;
                    this.OnTickFormatting(tickElement);
                    this.Children.Add((RadElement)tickElement);
                }
            }
        }
예제 #3
0
 protected virtual void OnTickFormatting(TrackBarTickElement tickElement)
 {
     this.TrackBarElement.OnTickFormatting(tickElement);
 }
예제 #4
0
 public TickFormattingEventArgs(TrackBarTickElement tickElement, int tickNumber)
 {
     this.tickElement = tickElement;
     this.tickNumber  = tickNumber;
 }
예제 #5
0
 public TickFormattingEventArgs(TrackBarTickElement tickElement)
     : this(tickElement, -1)
 {
 }