How to customize TeeCommander under C++?

TeeChart for ActiveX, COM and ASP
Post Reply
Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

How to customize TeeCommander under C++?

Post by Frank » Sun May 13, 2007 10:51 pm

I'd like to use the TeeCommander in my Chart. Unfortunatelly I can't find an example of how to customize the toolbar using C++.

I found the method "SetControls" which takes a VARIANT as parameter but I don't know how to initialize this type so that the toolbar only displays let's say the edit button and the zoom button.

Thanks in advance.

Best regards,
Frank.

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 May 14, 2007 8:55 am

Hi Frank,

Could you please read this message? It contains some information using TeeChart Pro v7 ActiveX in VC++ and one example on how to use variables VARIANT.

More information can be found at the tutorial and examples mentioned in the thread I pointed above. Additionally, it may be helpful for you knowing of TeeChart's constant definitions at TeeChartDefines.h available at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++.

If you are still having trouble achieving what you request please let us know and we will try to arrange an example for you.
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

Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

Post by Frank » Mon May 14, 2007 9:20 am

Hi Narcís,

I've already seen the thread you mentioned and already found the TeeChartDefines.h but I still don't understand how to use the VARIANT in my case.

I'd like to know how a VB code like

Code: Select all

Form Name : CommanderCustomForm

Private Sub Form_Load()
  TeeCommander1.Chart = TChart1
  TeeCommander1.Controls = Array(tcbRotate, _
                                 tcbSeparator, _
                                 tcbZoom, _
                                 tcbSeparator, _
                                 tcbEdit)
End Sub
looks in C++.

Thanks for your help.

Best regards,
Frank.

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

Post by Pep » Tue May 15, 2007 11:48 am

Hi Frank,

you can use the following code in vcc :

Code: Select all

	DWORD myElements[] = {1}; // Change value for more buttons
	COleSafeArray myValues;
	myValues.Create(VT_R8, 1, myElements);

	// Initialize them with values...
    // Display only the Rotate Button
	long index=0;
	double val=tcbRotate;
	
    myValues.PutElement(&index, &val);

	/* For some buttons

	for(index=0; index<4; index++) {
	   double val = index;
       myValues.PutElement(&index, &val);
    };*/

	m_commander.SetControls(myValues);

Frank
Newbie
Newbie
Posts: 6
Joined: Fri Sep 22, 2006 12:00 am

Thanks

Post by Frank » Tue May 15, 2007 12:11 pm

Hi Josep,

I've tried it immediately and it works fine. Many thanks. :)

Best Regards,
Frank.

Post Reply