Where to put event handler method of an inherited class in C++ Builder?

34 views Asked by At

I have inherited the class TStringGrid and have redefined two events:

class TOwnStringGrid : public TStringGrid
{
    public:
        __fastcall TOwnStringGrid(TComponent *Owner,
                                  int posX, int posY, int zeilenanzahl, int spaltenanzahl);
        __fastcall ~TOwnStringGrid();
    void __fastcall DrawCell(TObject *Sender, int ACol, int ARow, const TRect &Rect, 
                             TGridDrawState State);
    void __fastcall SelectCell(TObject *Sender, int Col, int Row, bool &CanSelect);
};

What is the general advice where to place the event methods? I can do that like in the coding above directly in the inherited class or like I had in the past, in the main form class. At the end they are instance based but still have the SENDER attribute, thus can be used for several VCL components having these events.

Thanks in advance Mauro

0

There are 0 answers