hansaplast
Programmer
Hi,
I'm trying to write an AfterScroll event for my TDBApp class but dunno
how to implement this.
I want to do someting like this in my App.
// MyApp.cpp
#include DBApp.h
void MyApp::somefunction()
{
TDBApp *pDBApp = new TDBApp(NULL);
// How do I implement this functionality??
pDBApp->AfterScroll = MyOwnAfterScrollFunction;
}
void MyApp::MyOwnAfterScrollFunction(/*With params*/){
// Do something...
}
// DBApp.h
class TDBApp : public TDatabase {
// ...
protected:
TTable *pArchive;
// ...
public:
// Overriding the default constructor
virtual __fastcall TDmsDB(Classes::TComponent* AOwner);
}
// DBApp.cpp
__fastcall TDmsDB::TDmsDB(Classes::TComponent*
AOwner):TDatabase(AOwner)
{
pArchive->AfterScroll = ArchiveAfterScroll;
// TDatabase Specific...
// pArchive->AfterScroll is fired as soon as the application
// scrolls from one record to another.
}
void __fastcall TDmsDB::ArchiveAfterScroll(TDataSet * DataSet)
{
if (pArchive->Active) {
// ...
// *HERE I want to FIRE the "DBApp::AfterScroll" Event
// to whatever function is attached to it
// How to do this???
// ...
}
}
Regards,
Hanza
I'm trying to write an AfterScroll event for my TDBApp class but dunno
how to implement this.
I want to do someting like this in my App.
// MyApp.cpp
#include DBApp.h
void MyApp::somefunction()
{
TDBApp *pDBApp = new TDBApp(NULL);
// How do I implement this functionality??
pDBApp->AfterScroll = MyOwnAfterScrollFunction;
}
void MyApp::MyOwnAfterScrollFunction(/*With params*/){
// Do something...
}
// DBApp.h
class TDBApp : public TDatabase {
// ...
protected:
TTable *pArchive;
// ...
public:
// Overriding the default constructor
virtual __fastcall TDmsDB(Classes::TComponent* AOwner);
}
// DBApp.cpp
__fastcall TDmsDB::TDmsDB(Classes::TComponent*
AOwner):TDatabase(AOwner)
{
pArchive->AfterScroll = ArchiveAfterScroll;
// TDatabase Specific...
// pArchive->AfterScroll is fired as soon as the application
// scrolls from one record to another.
}
void __fastcall TDmsDB::ArchiveAfterScroll(TDataSet * DataSet)
{
if (pArchive->Active) {
// ...
// *HERE I want to FIRE the "DBApp::AfterScroll" Event
// to whatever function is attached to it
// How to do this???
// ...
}
}
Regards,
Hanza