I recently started updating my RAD Studio 2007 project to RAD Studio 2009. One thing I noticed was when, it would seem, simple code suddenly failed to compile.
Code example:
class CButtonPopupMenu
{
public:
void Init( TButton* SrcButton )
{
SrcButton->OnClick = OnButtonClick;
}
private:
void __fastcall OnButtonClick( TObject* Sender )
{
}
};
TButton button = new TButton( this );
TBitBtn bitBtn = new TBitBtn( this );
CButtonPopupMenu popupButton = new CButtonPopupMenu( button );
CButtonPopupMenu popupBitBtn = new CButtonPopupMenu( bitBtn );
All this is used for compilation, but since 2009 it does not work. Looking at the 2007 inheritance chain TBitBtnused to deduce from TButton. Therefore, the events that are expected with any button control (i.e., OnClick) were separated by a class TButton. Therefore, I was able to treat my class TBitBtnas TButton.
2007 Inheritance Chain:
Inheritance Chain 2009:
- TBitBtn: TCustomButton
- TButton: TCustomButton
2009 TButton TBitButton TCustomButton, , , , . , TCustomButton. , TCustomButton , OnClick. TBitBtn TButton. , (.. OnClick). , , - IButton, TButton, TBitBtn.
, , , - , . , , -, CodeGear ( Framework ) ?
, , TBitBtn, TButton?