Page 1 of 1

[Solved] [v8] Bug with TAxisScrollTool

Posted: Thu Aug 30, 2007 10:54 am
by 9343260
Hello,

I found a problem with the TAxisScrollTool which I think occurs only with Version 8.

When I'm scrolling an Axis using this tool, everything works fine except when the cursor is exactly over the axis line ! This behaviour looks strange and I think it is a bug.

To reproduce it, simply scroll the axis up and down, and move the mouse cursor over the axis line while scrolling.

This behaviour occurs also with TeeChartOffice 3.0.

Posted: Thu Aug 30, 2007 1:39 pm
by narcis
Hi bertrod,

I'm not able to reproduce the problem here. I've made a little example and I've sent you its .exe. Could you please try running it at your end and let me know if it works fine for you?

Thanks in advance.

Posted: Thu Oct 18, 2007 8:26 am
by 9343260
Hi Narcis,

The exe you sent me worked fine. After some time, I finally could solve my problem with the AxisScrollTool.

I don't know if it can help you in any way, but here is my modification to solve this problem:

File : TeeTools.pas
Function : TAxisScrollTool.ChartMouseEvent
SubFunction : AxisClicked

OLD CODE

Code: Select all

    if Assigned(Axis) then
    begin
      if Axis.Visible and Axis.Clicked(x,y) then // <-- prob here: Axis.Clicked returns False
         result:=Axis;
    end
    else
    with ParentChart do
    for t:=0 to Axes.Count-1 do
        if Axes[t].Visible and Axes[t].Clicked(x,y) then
        begin
          result:=Axes[t];
          break;
        end;
  end;
NEW CODE

Code: Select all

    if Assigned(Axis) then
    begin
      if Axis.Visible and Axis.Clicked(x,y) then
         result:=Axis
      { MODIFICATION START }
      else
        with ParentChart do
        for t:=0 to Axes.Count-1 do
            if Axes[t].Visible and Axes[t].Clicked(x,y) then
            begin
              result:=Axes[t];
              break;
            end;
      { MODIFICATION END }
    end
    else
    with ParentChart do
    for t:=0 to Axes.Count-1 do
        if Axes[t].Visible and Axes[t].Clicked(x,y) then
        begin
          result:=Axes[t];
          break;
        end;
  end;
Mybe it will help you understand what was going wrong with my tool. The variable "Axis" was correct, but Axis.Clicked always returned False when the mouse was exactly over the Axis line. Really strange problem I guess.

Posted: Mon Oct 22, 2007 1:37 pm
by narcis
Hi bertrod,

Thanks for the information. I'm glad to hear you could solve the problem. This works fine here using our current sources.