Page 1 of 1

How to customize TeeCommander under C++?

Posted: Sun May 13, 2007 10:51 pm
by 9532558
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.

Posted: Mon May 14, 2007 8:55 am
by narcis
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.

Posted: Mon May 14, 2007 9:20 am
by 9532558
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.

Posted: Tue May 15, 2007 11:48 am
by Pep
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);

Thanks

Posted: Tue May 15, 2007 12:11 pm
by 9532558
Hi Josep,

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

Best Regards,
Frank.