Board index » cppbuilder » How to derive from TFrame?
XXXX@XXXXX.COM
![]() CBuilder Developer |
How to derive from TFrame?2004-08-13 05:33:13 PM cppbuilder86 Hi. How to derive from TFrame? I created a new frame TframeYearlyPage, which by default derives from TFrame. But I want to create other classes like TframeTransactionPage and add a virtual functions in class TFrame, which the derived classes will override. But I can't change class TFrame. So I created a new unit, and created a class TframePage derived from TFrame, and added the pure virtual functions in that class. Then I changed my class TframeYearlyPage, which was derived from TFrame, to derive instead from TframePage. Then compile and link the entire program. Then open TframeYearlyPage in the IDE, in order to see what it looks like. But I get an error message: "Error reading frameYearlyPage->TabOrder: Property TabOrder does not exist. Ignore the error and continue?". It seems the problem comes from silently changing the base class of TframeYearlyPage from TFrame to TframePage. So how to derive from TFrame in order to add new functions (both virtual and non-virtual)? Here are my classes: // common.h ==> class TframePage : public TFrame { public: __fastcall TframePage(TComponent* Owner); void Clear(); private: // pure virtual functions ... }; // YearlyPage.h ==> class TframeYearlyPage : public TframePage { __published: // IDE-managed Components TAdvStringGrid *Grid; TPanel *panelItem; ... public: // User declarations __fastcall TframeYearlyPage(TComponent* Owner); private: // virtual overrides ... private: // User declarations }; //--------------------------------------------------------------------------- extern PACKAGE TframeYearlyPage *frameYearlyPage; //--------------------------------------------------------------------------- YearlyPage.dfm ==> object frameYearlyPage: TframeYearlyPage Left = 0 Top = 0 Width = 746 Height = 400 TabOrder = 0 object Grid: TAdvStringGrid Thanks! |