Page 1 of 1

OnMouseWheel event not riggered on runtime created Tchart.

Posted: Sun Feb 06, 2005 7:17 pm
by 4207556
Hi,

I've been creating several charts on a ScrollBox at runtime. Now when I want to use the mousewheel, it seems the OnMouseWheel is not fired! also using the
ScrollSource := WindowFromPoint( mousepos );
in the onMouseWheel of the form does not return the handle of the chart..

If i create a chart at designtime, there is no problem.

What am I doing wrong? :?

Greets Arnold

Posted: Tue Feb 08, 2005 4:24 pm
by Marjan
Hi, Arnold.

Does it help setting the TeeUseMouseWheel variable to true ?

Code: Select all

Uses Chart;
...
TeeUseMouseWheel := True;
Also, make sure all properties generated for design time chart are actually set when you create a chart at runtime (parent, owner, etc...).

Posted: Tue Sep 27, 2005 7:15 am
by 8441073
Hello,

I also was trying to write an OnMouseWheel event, but it seems it is not fired.

I'm using TeeChart Pro V7.02 on Delphi 6, I have a TChart and I want to do some actions when the user spins the mouse wheel up or down, while the cursor is on the chart.

Searching through the forum, I found this topic. I set the TeeUseMouseWheel to true (it was true by default) but with no success: it seems the OnMouseWheel, OnMouseWheelDown, OnMouseWheelUp events are not fired.

Here is a Chart example I used to:

Code: Select all

      object Chart4: TChart
        Left = 396
        Top = 11
        Width = 421
        Height = 406
        BackWall.Gradient.EndColor = 11118482
        BackWall.Gradient.Visible = True
        BackWall.Transparent = False
        Border.Color = 14645801
        Border.Width = 7
        Border.Visible = True
        BottomWall.Gradient.EndColor = 16580349
        BottomWall.Gradient.StartColor = 3114493
        BottomWall.Gradient.Visible = True
        Gradient.Direction = gdDiagonalDown
        Gradient.EndColor = 11645361
        Gradient.Visible = True
        LeftWall.Gradient.EndColor = 2413052
        LeftWall.Gradient.StartColor = 900220
        LeftWall.Gradient.Visible = True
        Legend.Color = clInfoBk
        Legend.Gradient.Direction = gdTopBottom
        Legend.Gradient.EndColor = clYellow
        Legend.Gradient.StartColor = clWhite
        Legend.Gradient.Visible = True
        Legend.Shadow.Color = 13421772
        Legend.Shadow.Transparency = 50
        Legend.Symbol.Pen.Visible = False
        Legend.Visible = False
        MarginBottom = 1
        MarginLeft = 1
        MarginRight = 1
        MarginTop = 1
        Title.Color = clInfoBk
        Title.Font.Height = -13
        Title.Font.Style = [fsBold]
        Title.Frame.Color = clGray
        Title.Shadow.HorizSize = 0
        Title.Shadow.VertSize = 0
        Title.Text.Strings = (
          'Click on a slice')
        OnClickSeries = Chart4ClickSeries
        Chart3DPercent = 25
        Shadow.Color = clBlack
        Shadow.HorizSize = 10
        Shadow.VertSize = 10
        View3DOptions.Elevation = 315
        View3DOptions.Orthogonal = False
        View3DOptions.Perspective = 0
        View3DOptions.Rotation = 360
        BevelOuter = bvNone
        TabOrder = 0
        OnMouseWheelDown = Chart4MouseWheelDown
        OnMouseWheelUp = Chart4MouseWheelUp
        PrintMargins = (
          15
          2
          15
          2)
        ColorPaletteIndex = 9
        object Series5: TPieSeries
          Marks.Callout.Brush.Color = clBlack
          Marks.Frame.Color = clGray
          Marks.Gradient.Visible = True
          Marks.Shadow.Color = 13421772
          Marks.Shadow.HorizSize = 2
          Marks.Shadow.VertSize = 2
          Marks.Visible = True
          OnClick = Series5Click
          Gradient.Direction = gdRadial
          OtherSlice.Legend.Visible = False
          OtherSlice.Text = 'Altro'
          PiePen.Visible = False
          PieValues.Name = 'Torta'
          PieValues.Order = loNone
          Data = {
            06080000000000000000507A40DD000000035265640000000000F08040000000
            200659656C6C6F770000000000E087400000002005477265656E000000000080
            794000000020064F72616E676500000000000883400000002005576869746500
            00000000406D40FCABEE000450696E6B0000000000D083400000002004426C75
            6500000000006882409F9F9F000447726179}
        end
      end

Posted: Wed Sep 28, 2005 10:39 am
by Pep
Hi,

have you tried setting TabStop to true ?

TeeUseMouseWheel := True;
Chart1.TabStop:=True;

Posted: Fri Sep 30, 2005 1:59 pm
by 8441073
Unbelievable...

it was the TabStop property.

Now it works. Thank you