Rectangular Tool

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
history
Newbie
Newbie
Posts: 29
Joined: Tue May 22, 2007 12:00 am

Rectangular Tool

Post by history » Mon Feb 25, 2008 5:24 pm

There seems to be a change in the way the rectangle tool is able to be dragged with the mouse. We used to be able to drag the rectangle with the mouse anywhere within the rectangle. Now we have to select the top left corner and drag. This has caused a number of issues one being that it is not obvious and difficult to find.

Is there a way of making it more intuitive for the next release?

Thanks

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

Post by Narcís » Mon Feb 25, 2008 7:31 pm

Hi history,

Yes, this is a known issue, as you can read here, which has already been fixed for the next maintenance release.
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

history
Newbie
Newbie
Posts: 29
Joined: Tue May 22, 2007 12:00 am

Post by history » Tue Feb 26, 2008 1:11 pm

Narcis

When can we expect to see this next maintenance release?

history
Newbie
Newbie
Posts: 29
Joined: Tue May 22, 2007 12:00 am

Post by history » Tue Feb 26, 2008 1:18 pm

Is there a way to control the painting of the rectangle tool. I would like to have more control on the text displayed within the rectangle tool. Ability to change the color and formating of the text displayed.

Thanks

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 Feb 26, 2008 2:15 pm

Hi history,
When can we expect to see this next maintenance release?
We expect the maintenance release to be ready during this week.
Is there a way to control the painting of the rectangle tool. I would like to have more control on the text displayed within the rectangle tool. Ability to change the color and formating of the text displayed.
Yes, you can use something like this:

Code: Select all

			rectangle1.Text = "Hello World!";
			rectangle1.Shape.Font.Color = Color.Lime;
			rectangle1.Shape.Font.Size = 12;
			rectangle1.Shape.Font.Bold = true;
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

history
Newbie
Newbie
Posts: 29
Joined: Tue May 22, 2007 12:00 am

Post by history » Tue Feb 26, 2008 3:05 pm

What I would like to do is have multiple color text within the rectangle text box

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 Feb 27, 2008 12:02 pm

Hi history,

Rectangletool's lines can be painted in different colours, but this does require (at the moment) an override of one of its methods, as shown in the example:

Code: Select all

 public partial class CustomLegendDrag : Form
 {
 public CustomLegendDrag()
 {
  InitializeComponent();
  InitializeChart();
 }

 private Steema.TeeChart.Styles.Bar bar;
 private MyRectangleTool rect;

 private void InitializeChart()
 {
  tChart1.Series.Add(bar = new Steema.TeeChart.Styles.Bar());
  bar.FillSampleValues();
  tChart1.Legend.Visible = true;
  tChart1.Zoom.Allow = false;


  tChart1.Tools.Add(rect = new MyRectangleTool());
  rect.Text = "Text \n Again";
  rect.ColorLineOne = Color.Red;

 }

 private bool dragging = false;
 private int x, y;

 private void tChart1_MouseDown(object sender, MouseEventArgs e)
 {
  if (tChart1.Legend.Clicked(e.X, e.Y) != -1)
  {
   x = e.X;
   y = e.Y;
   tChart1.Legend.Left = x;
   tChart1.Legend.Top = y;
   tChart1.Legend.CustomPosition = true;
   dragging = true;

  }
 }

 private void tChart1_MouseUp(object sender, MouseEventArgs e)
 {
  dragging = false;
 }
 private void tChart1_MouseMove(object sender, MouseEventArgs e)
 {
  if (dragging)
  {
   x = e.X;
   y = e.Y;
   tChart1.Invalidate();
  }
 }

 private void tChart1_AfterDraw(object sender,
Steema.TeeChart.Drawing.Graphics3D g)
 {
  if (dragging)
  {
   tChart1.Legend.Left = x;
   tChart1.Legend.Top = y;
  }
 }
 }

 public class MyRectangleTool : RectangleTool
 {
 protected override void DrawString(Steema.TeeChart.Drawing.Graphics3D g,
int x, int y, int t, int tmpHeight, string[] s)
 {
  Color oldColor = g.Font.Color;
  if (t == 1)
  {
   g.Font.Color = ColorLineOne;
  }
  base.DrawString(g, x, y, t, tmpHeight, s);
  g.Font.Color = oldColor;
 }

 private Color colorLineOne;

 public Color ColorLineOne
 {
  get { return colorLineOne; }
  set { colorLineOne = value; }
 }
 }
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