Autosizing on Rectangle Tool

TeeChart for ActiveX, COM and ASP
Post Reply
SptDev
Newbie
Newbie
Posts: 4
Joined: Mon Jun 19, 2006 12:00 am

Autosizing on Rectangle Tool

Post by SptDev » Tue Aug 15, 2006 2:36 pm

I am using the TeeChart.ocx from Visual C++ (8.0).

I currently use the Rectangle Tool to display user notes on the chart.

I position the tool according to where the user clicked the canvas to create the tool. This works fine, except that the size of the tool seems to be more or less random. How do I set the Autosize property on the tool so it will fit the tool text? I can do it in the Chart Editor, but not programatically.

BTW: Initially, I expected to be able to find a CRectangleTool wrapper class in the TCWrappers folder, but that was not the case. Therefor I am using the CAnnotationTool wrapper to communicate with the rectangle tool. Is this the correct approach?

Best wishes

Steffen Skov

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

Post by Pep » Wed Aug 16, 2006 10:29 am

Hi Steffen,

using the latest TeeChart Pro v7.0.0.8 you should be able to do :

Code: Select all

#include "Series.h"
#include "ToolList.h"
#include "Tools.h"
#include "RectangleTool.h"

void CRecToolDlg::OnOnClickTchart1() 
{
	m_chart.GetTools().Add(25);		
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetTop(10);
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetLeft(10);
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetText("sljljlj dsjld");
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetAutoSize(true);	
}

SptDev
Newbie
Newbie
Posts: 4
Joined: Mon Jun 19, 2006 12:00 am

Post by SptDev » Wed Aug 23, 2006 8:15 am

Hi Josep,

thanks for quick response.

However, I do not seem to be able to locate the RectangleTool.h file, which you include in your code. Hence, I am also unable to use the GetAsRectangle() method.

Isn't this file delivered as part of the TeeChar version 7 installation?

--

Best wishes
Steffen Skov
Pep wrote: using the latest TeeChart Pro v7.0.0.8 you should be able to do :

Code: Select all

#include "Series.h"
#include "ToolList.h"
#include "Tools.h"
#include "RectangleTool.h"

void CRecToolDlg::OnOnClickTchart1() 
{
	m_chart.GetTools().Add(25);		
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetTop(10);
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetLeft(10);
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetText("sljljlj dsjld");
	m_chart.GetTools().GetItems(0).GetAsRectangle().SetAutoSize(true);	
}

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 Aug 23, 2006 8:22 am

Hi SptDev,

I'm afraid not all files were included in the installation. However we posted the files at news://www.steema.net/steema.public.attachments newsgroup at a message from 19th June 2006 written by Marc Meumann and with subject being TeeChart AX 7 - VC++ Classes.
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

SptDev
Newbie
Newbie
Posts: 4
Joined: Mon Jun 19, 2006 12:00 am

Post by SptDev » Wed Aug 23, 2006 11:55 am

Hello Narcís,

I have now tried numerous approaches on retrieving the newsgroup article, using Outlook Express, Opera and Thunderbird news clients, but to no avail. Do you provide any alternative ways of retrieving the files in question?

(On a side note: This is not the first time we have been asked to fetch things from your news server, with unsuccessfull outcome. Could another distribution form for "patches" be considered in the future - e.g. via your web site? It would be greatly appreciated)

Best regards
Steffen Skov

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 Aug 23, 2006 1:00 pm

Hi Steffen,

It's strange because you just need to set www.steema.net as a news server with all defaul settings. However, I can send those files to your forums contact e-mail address.
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

SptDev
Newbie
Newbie
Posts: 4
Joined: Mon Jun 19, 2006 12:00 am

Post by SptDev » Wed Aug 23, 2006 1:14 pm

Yup, it's weird, but true. I am able to read other articles on your news server, but the particular one, which I _need_, is impossible to access. Murphy's law in action, I guess.

Please use my address (ssk@scandpowerpt.com) when submitting the files. Thanks!

--

Best wishes
Steffen Skov

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 Aug 23, 2006 1:24 pm

Hi Steffen,

Ok, I've just forwarded the message to the requested address.
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

Post Reply