Page 1 of 1

NearestPoint disappear on menu Popup

Posted: Fri Dec 05, 2008 7:55 pm
by 9334475
Hi,

I encountered a strange problem with TNearestPoint tool when compiling in D2007. If there is a TPopupMenu associated with a chart, then on menu Popup, the NeatestPoint tool disappear (does not matter if full repaint or XOR). Investigation showed that disappearance is caused by loosing the link point:

NearestPoint.Point=-1;

This is not happens when program compiled in D7(WinXP), only happens if complied in D2007(Vista). Program compiled in D7, works fine on Vista computer, so I blame D2007 for an unusual behavior. In both cases TeeChart 7.12 full source code was installed.

Can you give me some hints what might cause to loose a link point when compiling in D2007?

Regards,
odissey1
env: TeeChart 7.12(source code), D2007, Vista Home Premium

Posted: Tue Dec 09, 2008 11:36 am
by narcis
Hi odissey1,

Could you please send us a simple example project we can run "as-is" to reproduce the issue here?

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.

Posted: Tue Dec 09, 2008 10:36 pm
by 9334475
Hi Narcis,

I uploaded NearestPoint_01p2.zip which contains 2 setst of screenshots, 2 compiled demos of the same project and a source code into upload directory.

one of the project is compiled in D7/WinXP, another in D2007/VistaHomePremium. It seems that OS type is not to blame, only compiler is important.

odissey1

Posted: Mon Dec 15, 2008 3:48 pm
by narcis
Hi odissey1,

Yes, this seems to be a Delphi 2007 problem. In the meantime a solution would be doing something like this:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
     Chart1.AutoRepaint:=true
end;

procedure TForm1.emptyitem11Click(Sender: TObject);
begin
     caption:=Format('ChartTool1.Point=%d',[ChartTool1.Point]);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
      Chart1.Align:=alClient;
      Series1.FillSampleValues(10);
end;

procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
     Chart1.AutoRepaint:=false;
     caption:=Format('ChartTool1.Point=%d',[ChartTool1.Point]);
end;