Page 1 of 1

Magnifying Glass icon for zooming in?

Posted: Tue Jul 22, 2008 8:39 pm
by 9641609
Hi,

It's useful to be able to use the arrow cursors to show the user he's panning in certain directions (e.g. left and right joined arrow cursor for horizontal panning). For consistency, I'd like to show a 'Zoom in magnifying glass' cursor when the user is dragging down and right, and a 'Zoom out magnifying glass' cursor when the user is dragging up and left.

As far as I can tell, there is no + or - magnifying cursor?

Is it possible to create a custom cursor?

If so, is there some easy code to tell (I'm assuming it'd be OnMouseMove) whether the user is currently zooming in or out?

Many thanks for any help anyone can give.

Cheers,
Phil.

Posted: Wed Jul 23, 2008 8:08 am
by yeray
Hi Phil,

We are not sure to understand what are you exactly trying to do here. Please, take a look at the Tutorial 11 - Zoom and Scroll and at the demo What's New/New Chart Tools/Magnify.

If you still have problems with it, please, feel free to explain it.

You will find both tutorials and demos at TeeChart's program group.

Posted: Thu Jul 24, 2008 8:28 am
by 9641609
Hi,

Thanks for the response. I obviously didn't explain myself brilliantly.

What I'd like to do is set the cursor to a magnifying glass when the user has the left mouse button down and is in the process of selecting a zoom rectangle.

I'm doing something similar for the panning - i.e. when the user holds down the right mouse button, the cursor is set to arrows...

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If Button = mbRight Then
' ScrollDirection is one of 0 = pmNone, pmHorizontal, pmVertical, 3 = pmBoth
If ScrollDirection = pmHorizontal Then
TChart1.Cursor = -9 ' crSizeWE
ElseIf ScrollDirection = pmVertical Then
TChart1.Cursor = -7 ' crSizeNS
ElseIf ScrollDirection = pmBoth Then
TChart1.Cursor = -5 ' crSize
End If
End If
End Sub

So what I'd like to know is, is there a TChart1.Cursor = ? setting that is a magnifying glass cursor? If not, is it possible to create a new cursor using a bmp or other drawing object?

I hope this is explained better.

Many thanks,
Phil.

Posted: Thu Jul 24, 2008 9:18 am
by narcis
Hi Phil,

Thanks for the information.

I'm afraid there's no such a cursor style. However, you could try using Screen.MouseIcon and Screen.MousePointer properties and assign its cursor to TeeChart.

Hope this helps!

Posted: Thu Jul 24, 2008 9:47 am
by 9641609
Ah, that sounds like what I need to do. However, I'm not familiar with the Screen object. Can you point me in the direction of more help on this? Or how I'd set the TeeChart cursor to one these Screen objects?

Many thanks,
Phil.

Posted: Thu Jul 24, 2008 9:54 am
by narcis
Hi Phil,

Screen object is a VB6 object, not a TeeChart object and there's an example of it in VB6's help files. Anyway you can do something like this:

Code: Select all

    Screen.MouseIcon = LoadPicture("C:\temp\teechart8.ico")
    Screen.MousePointer = 99