Page 1 of 1

Autosizing on Rectangle Tool

Posted: Tue Aug 15, 2006 2:36 pm
by 9531618
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

Posted: Wed Aug 16, 2006 10:29 am
by Pep
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);	
}

Posted: Wed Aug 23, 2006 8:15 am
by 9531618
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);	
}

Posted: Wed Aug 23, 2006 8:22 am
by narcis
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.

Posted: Wed Aug 23, 2006 11:55 am
by 9531618
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

Posted: Wed Aug 23, 2006 1:00 pm
by narcis
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.

Posted: Wed Aug 23, 2006 1:14 pm
by 9531618
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

Posted: Wed Aug 23, 2006 1:24 pm
by narcis
Hi Steffen,

Ok, I've just forwarded the message to the requested address.