Cannot change ChartController

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
hominoid
Newbie
Newbie
Posts: 6
Joined: Tue Jun 27, 2006 12:00 am
Location: St. Petersburg, Russia
Contact:

Cannot change ChartController

Post by hominoid » Fri Jul 06, 2007 1:02 pm

Hello!

I cannot change images, buttons etc. in ChartController. I can, but it doesn't remember my configuration. And every time I reload my usercontrol in designer ChartController resets to its default state. And after changing items in ChartController nothing happens in usercontrol.designer.cs

The control is great but with opportunity to customize it.

P.S. I have the latest 3.0 ver. form 15th June 2007

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

Post by Narcís » Fri Jul 06, 2007 7:44 pm

Hi hominoid,

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

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

Thanks in advance.
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

hominoid
Newbie
Newbie
Posts: 6
Joined: Tue Jun 27, 2006 12:00 am
Location: St. Petersburg, Russia
Contact:

Post by hominoid » Mon Jul 09, 2007 5:24 am

I've uploaded WindowsApplication5.rar from kopylov@vast.spb.ru on http://www.steema.net/upload/
Try to change any images in chartController1 (for example, pointer) and then run the project - image is not changed.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Jul 09, 2007 9:05 am

Hello!

In the TeeChart.Net v3 Feature demo there's an example:
All Features\Welcome !\Components\Commander\Custom Buttons

which shows you how to customize the commander. An example of how to do the same will be shipped with the next maintenance release, due out this week, which looks like this:

Code: Select all

		private void InitialiseChart() {
			const int buttonCount = 5;
#if VS2005
			ToolStripItem[] comButtons = new ToolStripItem[buttonCount];
			ToolStripButton tmpBut;
#else
			ToolBarButton[] comButtons = new ToolBarButton[buttonCount]; 
#endif


#if VS2005
			foreach (ToolStripItem button in commander1.Items)
#else
			foreach (ToolBarButton button in commander1.Buttons)
#endif
			{
#if VS2005
				if (button is ToolStripButton)
				{
					tmpBut = button as ToolStripButton;
					tmpBut.Checked = false;
#else
					button.Pushed = false;
#endif
					switch (button.Tag.ToString())
					{
						case "bNormal":
							break;
#if !VS2005
						case "bSeparator":
							comButtons[1] = button;
							comButtons[3] = button;
							break;
#endif
						case "bRotate":
#if VS2005
							tmpBut.Checked = true;
#else
							button.Pushed = true;
#endif
							comButtons[0] = button;
							break;
						case "bMove":
							break;
						case "bZoom":
							comButtons[2] = button;
							break;
						case "bDepth":
							break;
						case "bView3D":
							break;
						case "bEdit":
							comButtons[4] = button;
							break;
						case "bPrint":
							break;
						case "bCopy":
							break;
						case "bExport":
							break;

					}
#if VS2005
				}
				else if (button is ToolStripSeparator)
				{
					switch (button.Tag.ToString())
					{
						case "bSeparator":
							comButtons[1] = button;
							comButtons[3] = button;
							break;
					}
				}
#endif
			}
			
#if VS2005
			commander1.Items = comButtons;
#else
		  commander1.Buttons = comButtons;
#endif
			commander1.Chart = tChart1;
			line1.FillSampleValues();
		}
I think that the ToolStripItem class has an Image property which you should be able to set to the image you desire.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

hominoid
Newbie
Newbie
Posts: 6
Joined: Tue Jun 27, 2006 12:00 am
Location: St. Petersburg, Russia
Contact:

Post by hominoid » Mon Jul 09, 2007 9:23 am

Yes, I know that ToolStripItem has Image property. May be it's possible to change it in the code, I'll try. But I like component designers as well and if there's an opportunity not to write code, but to to customize controls by clicking mouse - I'd prefer mouse. I just want to point out that ChartController's designer doesn't work properly.

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Jul 09, 2007 9:44 am

Hello,
I just want to point out that ChartController's designer doesn't work properly.
Thank you for pointing that out to us, we will look into it. In the meantime I hope that using the few lines of runtime code I sent you will be ok for you.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

hominoid
Newbie
Newbie
Posts: 6
Joined: Tue Jun 27, 2006 12:00 am
Location: St. Petersburg, Russia
Contact:

Post by hominoid » Mon Jul 09, 2007 9:50 am

You are welcome! I really like TeeChart and want to help make it better!

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Mon Jul 09, 2007 9:55 am

Hello,
You are welcome! I really like TeeChart and want to help make it better!
That really is very kind of you. It is always a pleasure working with TeeCharters such as yourself!
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply