Hello
I am now using BDS2006 C++Builder, with TeeChart 2010 Pro.
Currently, according to example, I need to define a new class derived from TDBChart with IsValidDataSource overridden to have some dataset hidden.
This is very complicated, according to demo, all must be programmed to be created run-time, and many coding work. And also I have headache for cross-unit datasets namespace problems.
Is it possible for TDBChart to expose this IsValidDataSource, so I can do in such a way to have an easy override?
1. Create a new event called OnValidDataSource to pass parameters out for user to further changing -->preferred
or
2. Directly expose the function address of IsValidDataSource for overriding.-->not perferred.
Request to expose IsValidDataSource for override
Re: Request to expose IsValidDataSource for override
Hi Liang,
I've added your request to the wish list to be studied for inclusion in next releases (TV52015116).
I've added your request to the wish list to be studied for inclusion in next releases (TV52015116).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Request to expose IsValidDataSource for override
Hello
I have implemented such exposure of OnValidDataSource event. And it works fine.
Now I can make my software more clean, with only desired DataSet shown to user at run-time.
I would like to contribute my modification on DBChart.pas to you. Please check it:
line 48
line 57:
line 91:
line 104:
line 488:
I have implemented such exposure of OnValidDataSource event. And it works fine.
Now I can make my software more clean, with only desired DataSet shown to user at run-time.
I would like to contribute my modification on DBChart.pas to you. Please check it:
line 48
Code: Select all
TValidDataSourceEvent=Procedure(Sender:TCustomDBChart; ASeries:TChartSeries; AComponent:TComponent;
var Valid:Boolean) of object;
Code: Select all
FOnValidDataSource:TValidDataSourceEvent;
Code: Select all
property OnValidDataSource:TValidDataSourceEvent read FOnValidDataSource
write FOnValidDataSource;
Code: Select all
property OnValidDataSource;
Code: Select all
Function TCustomDBChart.IsValidDataSource(ASeries:TChartSeries; AComponent:TComponent):Boolean;
var
BoolValue:Boolean;
Begin
BoolValue:=inherited IsValidDataSource(ASeries,AComponent);
if not BoolValue then BoolValue:=(AComponent is TDataSet) or (AComponent is TDataSource);
if Assigned(FOnValidDataSource) then
begin
FOnValidDataSource(Self,ASeries,AComponent,BoolValue);
end;
Result:=BoolValue;
end;
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Request to expose IsValidDataSource for override
Hello Liang,
Thank you very much for your contribution. We will analyse it and get back to you as soon as possible.
Thank you very much for your contribution. We will analyse it and get back to you as soon as possible.
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Request to expose IsValidDataSource for override
Hi Liang,
I think you can already override IsValidDataSource as in the examples in this thread. The projects Jørgen posted already derive a class from TDBChart and override IsValidDataSource method. Does this fit your needs?
I think you can already override IsValidDataSource as in the examples in this thread. The projects Jørgen posted already derive a class from TDBChart and override IsValidDataSource method. Does this fit your needs?
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 |
Re: Request to expose IsValidDataSource for override
Hello
I think mine is different, and prefer my way.
My solution is to expose the event of ValildDataSource on the TDBChart level, so I can directly in my source code, catch this event from the TDBChart component, and override the result by user as
So the freedom is at the user side.
I think mine is different, and prefer my way.
My solution is to expose the event of ValildDataSource on the TDBChart level, so I can directly in my source code, catch this event from the TDBChart component, and override the result by user as
Code: Select all
void __fastcall TScriptFrame::ResultDBChartValidDatasource(
TCustomDBChart *Sender, TChartSeries *ASeries, TComponent *AComponent,
bool &Valid)
{
Valid=(AComponent==DataSource->DataSet);
}
//---------------------------------------------------------------------------
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Request to expose IsValidDataSource for override
Hi Liang,
Ok, we implemented this for next maintenance release.
Ok, we implemented this for 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 |
Instructions - How to post in this forum |