Error on deleting a shape polygone in TMapSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
odissey1
Newbie
Newbie
Posts: 35
Joined: Thu Oct 23, 2003 4:00 am

Error on deleting a shape polygone in TMapSeries

Post by odissey1 » Sat Dec 06, 2008 10:55 pm

Hi,
I am trying to delete a Shape in TMapSeries in code like (either one)

SeriesMap.Shapes.Free;
SeriesMap.Shapes.Polygon.Free;

which returns Error in runtime.
Manual deleting (select+delete kbd button) gives error in Tee8new either.

Is there any way to delete a certain shape in TMapSeries
(like SeriesMap.Delete)?

regards,
odissey1

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Dec 09, 2008 11:40 am

Hi odissey1,

Yes, you can use Delete method, for example:

Code: Select all

  Series1.Delete(0);
Or deleting all polygons:

Code: Select all

  for i := Series1.Count-1 downto 0 do
    Series1.Delete(i);
Which is the equivalent of this:

Code: Select all

  Series1.Clear;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

odissey1
Newbie
Newbie
Posts: 35
Joined: Thu Oct 23, 2003 4:00 am

Post by odissey1 » Tue Dec 09, 2008 7:02 pm

narcis wrote:Hi odissey1,

Yes, you can use Delete method, for example:

Code: Select all

  Series1.Delete(0);
-I am afraid not. At least not in my TeeChart v.7.12. Compiler say: 'There is no overload version of Series1.Delete(0)';

But something wrong in TeeChart 8.x also. Try to open Tee8new.exe -> MapGIS series -> Edit -> Shapes. Now select any shape with a mouse. Hit 'Delete' button on keyboard. You will get an error message.

odissey1
Newbie
Newbie
Posts: 35
Joined: Thu Oct 23, 2003 4:00 am

Post by odissey1 » Tue Dec 09, 2008 7:35 pm

But something wrong in TeeChart 8.x also. Try to open Tee8new.exe -> MapGIS series -> Edit -> Shapes. Now select any shape with a mouse. Hit 'Delete' button on keyboard. You will get an error message.
I posted a screenshot on Attachments forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Dec 10, 2008 9:11 am

Hi odissey1,
-I am afraid not. At least not in my TeeChart v.7.12. Compiler say: 'There is no overload version of Series1.Delete(0)';
This works fine for me here using v8.04
But something wrong in TeeChart 8.x also. Try to open Tee8new.exe -> MapGIS series -> Edit -> Shapes. Now select any shape with a mouse. Hit 'Delete' button on keyboard. You will get an error message.
I could reproduce this and added the issue to the defect list (TV52013644) to be investigated.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

sicorspa
Newbie
Newbie
Posts: 43
Joined: Tue Jan 13, 2009 12:00 am

Post by sicorspa » Tue Feb 03, 2009 3:33 pm

don't know if it's correct but this also works like delete i think

Series1.Shapes.Points.Delete(0,Series1.Shapes.Points.Count - 1,False);

am I right? :?

Pep
Site Admin
Site Admin
Posts: 3277
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Feb 09, 2009 12:07 pm

Hi,
-I am afraid not. At least not in my TeeChart v.7.12. Compiler say: 'There is no overload version of Series1.Delete(0)';
It's strange, I've just checked the latest TeeChart Pro VCL v7 sources and you should be able to use the Delete method, it exists since the earlier versions. You could check if TeeChart is correctly installed.
don't know if it's correct but this also works like delete i think

Series1.Shapes.Points.Delete(0,Series1.Shapes.Points.Count - 1,False);

am I right? Confused

The Series.Delete(x) method deletes a specific shape from Map Series, and the method you're using Series.Shapes[x].Delete(start,end,removegaps) would remove all points from shape but wont remove (free) the shape created. it will remain there as a data point. The correct method to remove completely a specific shape is the Delete(x).

sicorspa
Newbie
Newbie
Posts: 43
Joined: Tue Jan 13, 2009 12:00 am

Post by sicorspa » Mon Feb 09, 2009 12:33 pm

many thanks, I'm just using delete(x) but before tried the points.delete.

Howether thanks because it's always better to know the exact function of a procedure/function :wink:

Post Reply