I understand there is a tutorial or help pages on how to change the button images for TeeCommander. I've looked, and searched, but cannot find?
Thanks, Nile.
Customizing TeeCommander button glyphs.
Customizing TeeCommander button glyphs.
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Nile,
Yes, tutorials, documentation, new features demo and examples can be found at TeeChart's program group created by the binary installers. By “TeeChart’s program group” I mean the Widnows’ TeeChart entry at Start Menu -> All Programs -> Steema TeeChart 8.04 for Delphi 2007. There you’ll find the “New Features Demo” shortcut. In the demo, going to "All Features\Welcome!\Toolbar\Custom buttons", you’ll find mentioned example.
Hope this helps!
Yes, tutorials, documentation, new features demo and examples can be found at TeeChart's program group created by the binary installers. By “TeeChart’s program group” I mean the Widnows’ TeeChart entry at Start Menu -> All Programs -> Steema TeeChart 8.04 for Delphi 2007. There you’ll find the “New Features Demo” shortcut. In the demo, going to "All Features\Welcome!\Toolbar\Custom buttons", you’ll find mentioned example.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Okay, found the help you mentioned, many thanks (although tabbing this help screen with c++ code would be a nice feature for those of us who get brain ache trying to read delphi!)
However, this only half answers my question. Take the following code:
TSpeedButton *tmpButton=TeeCommander1->CreateButton(100, &Button3Click, "Customize","",0);
tmpButton->Hint = "abc";
tmpButton->ShowHint = true;
First: Please allay my fears, and tell me that this button is created with the tCommander as parent, so i don't have to worry deleting the control?
Next, the hint doesn't work, and is I feel an important item on blind buttons. How to do?
Finally, while great for adding new buttons, this doesn't solve my immediate problem of changing the glyphs for the existing buttons, as we have a requirement that all interface buttons have the same look feel.
Options: Remove all buttons from Tcommander, and insert new. I have no problem with this as it's just code, but would ask help on:
1. How to delete all buttons from Tcommander.
2. A list of their onclick event contents so that i can use/manage in my replacement button events. e.g. ChartEditor->Execute() i know.
Cheers, nile.
However, this only half answers my question. Take the following code:
TSpeedButton *tmpButton=TeeCommander1->CreateButton(100, &Button3Click, "Customize","",0);
tmpButton->Hint = "abc";
tmpButton->ShowHint = true;
First: Please allay my fears, and tell me that this button is created with the tCommander as parent, so i don't have to worry deleting the control?
Next, the hint doesn't work, and is I feel an important item on blind buttons. How to do?
Finally, while great for adding new buttons, this doesn't solve my immediate problem of changing the glyphs for the existing buttons, as we have a requirement that all interface buttons have the same look feel.
Options: Remove all buttons from Tcommander, and insert new. I have no problem with this as it's just code, but would ask help on:
1. How to delete all buttons from Tcommander.
2. A list of their onclick event contents so that i can use/manage in my replacement button events. e.g. ChartEditor->Execute() i know.
Cheers, nile.
To be or not to be. This is not the question. Rather it is a choice.
Hello,
you could set the Visible property of the TeeCommander to false and use your own buttons:
Activate normal mode:
TeeCommander1->ButtonNormal->Down = true
Activate Zoom:
TeeCommander1->ButtonZoom->Down = true
You can set Button->Down = true to emulate that only one function can be active.
HTH,
Regards
Hans
you could set the Visible property of the TeeCommander to false and use your own buttons:
Activate normal mode:
TeeCommander1->ButtonNormal->Down = true
Activate Zoom:
TeeCommander1->ButtonZoom->Down = true
You can set Button->Down = true to emulate that only one function can be active.
HTH,
Regards
Hans
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nile,
Regarding what you are trying to do here, I think the best and easiest option is that you use existing TeeCommander and just replace glyphs in the sources at TeComma.pas. Buttons are created using the CreateButton method in TeeComma's CreateControls method.
Hope this helps!
There's also a C++ Builder version of the demo shipped with binary installers. You can find it, for example at C:\Program Files\Steema Software\TeeChart 8.04 for Delphi 2009\Examples\Features C++Okay, found the help you mentioned, many thanks (although tabbing this help screen with c++ code would be a nice feature for those of us who get brain ache trying to read delphi!)
Regarding what you are trying to do here, I think the best and easiest option is that you use existing TeeCommander and just replace glyphs in the sources at TeComma.pas. Buttons are created using the CreateButton method in TeeComma's CreateControls method.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I think the easiest solution was to follow Hans suggestion. You need to be careful implementing the logic, such that all the right buttons turn on and off as they should, and also get ready to call the buttons underlying implementation where necessary.. eg, 3d, editor etc.
TeeCommander1->ButtonEdit->Click();
What i like about this approach is i get buttons with the glyphs i want, buttons with hints and using actions, a context menu for the tchart.
One remaining question on this though: Is there a single command to reset the entire chart back to default?
many thanks, nile
TeeCommander1->ButtonEdit->Click();
What i like about this approach is i get buttons with the glyphs i want, buttons with hints and using actions, a context menu for the tchart.
One remaining question on this though: Is there a single command to reset the entire chart back to default?
many thanks, nile
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nile,
No, but you can implement ClearChart method as I posted here. ClearChart inclusion in TeeChart VCL sources is already on the wish-list to be considered for future releases.One remaining question on this though: Is there a single command to reset the entire chart back to default?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
Here's the c++ version for those that want it.
If i understand this correctly, you're using a new default chart to reset all of the old chart's parameters. Is there any need then to clear the chartsseries, as the old chart still remains?
I took out the snippet highlighted, and apart from having the wrong theme, the code worked nicely. I would however like confirmation for purposes of memory leaks etc, that this is a doable fix?
Finally, how do i obtain the current chart's theme, and assign this theme to the re-adjusted chart?
(i've looked at the code supplied, and it's unclear how this is done from an existing chart, without opening the theme editor, or accessing an existing theme from a list - as in the example code).
thanks nile.
void __fastcall TChartsNew::ClearAll(){
/*
TChartSeries* mychart;
for(int i=0; i< Chart->SeriesCount(); i++){
mychart = dynamic_cast<TChartSeries*>(Chart->Series);
if(mychart)
mychart->DataSource = NULL;
}
Chart->FreeAllSeries();
Chart->Tools->Clear();
*/
TDBChart* tmpChart = new TDBChart(this);
try{
tmpChart->Parent = Chart->Parent;
//Assign Chart's theme to tmpChart???
Chart->Assign(tmpChart);
}
__finally{
if(tmpChart){
delete tmpChart;
tmpChart = NULL;
}
}
}
Here's the c++ version for those that want it.
If i understand this correctly, you're using a new default chart to reset all of the old chart's parameters. Is there any need then to clear the chartsseries, as the old chart still remains?
I took out the snippet highlighted, and apart from having the wrong theme, the code worked nicely. I would however like confirmation for purposes of memory leaks etc, that this is a doable fix?
Finally, how do i obtain the current chart's theme, and assign this theme to the re-adjusted chart?
(i've looked at the code supplied, and it's unclear how this is done from an existing chart, without opening the theme editor, or accessing an existing theme from a list - as in the example code).
thanks nile.
void __fastcall TChartsNew::ClearAll(){
/*
TChartSeries* mychart;
for(int i=0; i< Chart->SeriesCount(); i++){
mychart = dynamic_cast<TChartSeries*>(Chart->Series);
if(mychart)
mychart->DataSource = NULL;
}
Chart->FreeAllSeries();
Chart->Tools->Clear();
*/
TDBChart* tmpChart = new TDBChart(this);
try{
tmpChart->Parent = Chart->Parent;
//Assign Chart's theme to tmpChart???
Chart->Assign(tmpChart);
}
__finally{
if(tmpChart){
delete tmpChart;
tmpChart = NULL;
}
}
}
To be or not to be. This is not the question. Rather it is a choice.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi nile,
If you are speaking about at what you asked before:If i understand this correctly, you're using a new default chart to reset all of the old chart's parameters. Is there any need then to clear the chartsseries, as the old chart still remains?
If you want to reset the chart so no series remain and default colors are still persist you should better call FreeAllSeries(nil) method. This will remove all series and will free associated memory. Then you can call TeeChart's default theme:One remaining question on this though: Is there a single command to reset the entire chart back to default?
Code: Select all
// Change Theme. The last parameter "-1" means to use the
// default Theme color palette.
ApplyChartTheme(tmp,Chart1,-1);
Using suggestion above you should have any memory problem.I took out the snippet highlighted, and apart from having the wrong theme, the code worked nicely. I would however like confirmation for purposes of memory leaks etc, that this is a doable fix?
This is not implemented in v8 but it's on the wish-list to be included in future versions. The only option now is manually saving current theme and comparing it with your desired settings. You could do that also saving a *.tee file (TeeChart native template files) without data and loading it back. Or you can also use custom themes as explained here.Finally, how do i obtain the current chart's theme, and assign this theme to the re-adjusted chart?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |