This is a migrated thread and some comments may be shown as answers.

Possible to indicate mouse location on ruler

7 Answers 246 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
HDC
Top achievements
Rank 1
HDC asked on 07 Nov 2012, 08:11 AM
Hi,

The ruler is a great addition to the diagram.

Is it possible to indicate the mouse position on the ruler?
 
In other applications with a ruler, when the user moves the mouse, the ruler will display a small line at the exact position of the mouse cursor. This helps the user into understanding where exactly on the ruler he is pointing.

If it is possible to customize the behavior and create the feature myself, can somebody then help me on my way?

Best Regards,

Peter

7 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 08 Nov 2012, 07:37 AM
Hi Heli,

We had that idea long time ago but did not face customer requests about it. Thus we did not implement it till now. Unfortunately extending the ruler to provide this behavior would cost you as much effort as if you implement it separately from the ruler.
I would recommend you to place a transparent container over the ruler and place a red tick in it. An event handler to the RadDiagram MouseMove event would be enough to move the tick on the proper position. This would be the most straightforward way to do it. Also, when we implement the feature you could just remove the additional user control from your application.

Could you provide us some time-frame information about when would you need the feature?

Kind regards,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
HDC
Top achievements
Rank 1
answered on 08 Nov 2012, 10:20 AM
Hi Hristo,

Thank you for the suggestion, i will try to make it work as you described.

It would be great if it could be implemented on the next release Q1 2013?

Best Regards,

Peter

0
Hristo
Telerik team
answered on 08 Nov 2012, 01:08 PM
Hi,

Let us know if you face any difficulties.
I've created a feature request in our public issue tracking system (PITS). You could track and vote for the item under following link: http://www.telerik.com/support/pits.aspx#/public/silverlight/13335.
Also I've updated you Telerik point +1000.

Kind regards,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
HDC
Top achievements
Rank 1
answered on 09 Nov 2012, 07:28 AM
Hi hristo,

I got it to work, i'm posting the demo for anyone that may be interested.

It's a primitive design, but i'm sure people could "prettyfy" it easily.

Just one remark, as i calculate the position of the mouse within the diagram, i noticed the GetPosition method would return the position Right,Under of the mouse cursor, not the Left,Top position, which seems a bit odd to me. For this reason i will subtract 20 from each axis.

You can find the solution on my skydrive:

https://skydrive.live.com/redir?resid=B8AA36071C47A567!944

Looking forward to your comments and suggestions.

Peter

0
Hristo
Telerik team
answered on 14 Nov 2012, 06:38 AM
Hello Heli,

That is exactly what I had in mind. I got through your code and noticed a slight modification that could be done (to cache the GetPosition function call).
Also the differences of the position is caused by the horizontal ruler height and vertical ruler width. The GetPosition is returning coordinates relative to the whole grid, but you are positioning the red marks is grid column and row shifted with 20 pixels. Thus if you get the coordinate relative to the Diagram you should not need to subtract these values. Here is my suggestion:

private void ScrollViewer_MouseMove(object sender, MouseEventArgs e)
    {
        var position = e.GetPosition(diagram);
 
        if (position.X > 0 && position.X < Scroller.ActualWidth)
        {
            HorizontalIndicator.X1 = position.X;
            HorizontalIndicator.X2 = position.X;
        }
 
        if (position.Y > 0 && position.Y < Scroller.ActualHeight)
        {
            VerticalIndicator.Y1 = position.Y;
            VerticalIndicator.Y2 = position.Y;
        }
    }

Let us know if you have any comments.All the best,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
TheGramix
Top achievements
Rank 2
answered on 09 Jan 2013, 12:57 PM
Hi Hristo,
I did the same request in a ticket long time ago (12 June 2012)
Ticket ID:
553607


See my request
5. Show a red line on the rulers when user move the mouse or drag a control (like visio or paint)

and your answer
5. Show a red line on the rulers when user move the mouse or drag a control (like visio or paint) - currently we do not have this feature implemented but we are planning to introduce it in future release. So if you need it you should implement it by yourself for now.
0
Tina Stancheva
Telerik team
answered on 10 Jan 2013, 12:27 PM
Hi Dino,

We will do our best to implement this feature for the Q1 2013 release. In the meantime you can track the progress of the task in our PITS.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
HDC
Top achievements
Rank 1
Answers by
Hristo
Telerik team
HDC
Top achievements
Rank 1
TheGramix
Top achievements
Rank 2
Tina Stancheva
Telerik team
Share this question
or