C++Builder1.0 Component does not port to 3.0 or higher
C++Builder1.0 Component does not port to 3.0 or higher
(OP)
I get 3 errors and 2 warnings when I try to compile in 3.0.
(2)Error::Cannot Override a dynamic with a virtual function
virtual void __fastcall KeyDown();
virtual void __fastcall MouseDown();
(2)Warning::GetChildren hides virtual function __fastcall Controls::TWinControl::GetChildern()
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
(1)Error::Too few parameters in call to __fastcall Controls::TWinControl::GetChildern()
void __fastcall TFurunoRadioGroup::GetChildren(Classes::TGetChildProc Proc)
{
TCustomControl::GetChildren(Proc);
}
Any help would be appreciated,
Joe
/////////////////////////////////////////////////////////////////////////////
FurunoRadioGroup.h
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
#ifndef FurunoRadioGroupH
#define FurunoRadioGroupH
//---------------------------------------------------------------------------
#include <vcl\SysUtils.hpp>
#include <vcl\Controls.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Forms.hpp>
#include <vcl\Graphics.hpp>
#include <vcl\Messages.hpp>
#include <vcl\Windows.hpp>
#include <vcl\System.hpp>
#include <vcl\consts.hpp>
//---------------------------------------------------------------------------
enum TFurunoRadioHighlighting { frhUnderline, frhInverse };
//---------------------------------------------------------------------------
class TFurunoRadioGroup : public TCustomControl
{
private:
Classes::TList* FButtons;
Classes::TStrings* FItems;
int FItemIndex;
int FColumns;
TFurunoRadioHighlighting FHighlighting;
bool FDrawRect;
bool FReading;
bool FUpdating;
Classes::TNotifyEvent FOnResize;
void __fastcall ArrangeButtons(void);
void __fastcall ButtonClick(System::TObject* Sender);
void __fastcall ItemsChange(System::TObject* Sender);
void __fastcall SetButtonCount(int Value);
void __fastcall SetColumns(int Value);
void __fastcall SetItemIndex(int Value);
void __fastcall SetItems(Classes::TStrings* Value);
void __fastcall SetDrawRect(bool Value);
void __fastcall SetHighlighting(TFurunoRadioHighlighting Value);
void __fastcall UpdateButtons(void);
MESSAGE void __fastcall CMWantSpecialKey(TCMWantSpecialKey &Message);
HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
protected:
virtual void __fastcall KeyDown(Word &Key, TShiftState Shift);
virtual void __fastcall MouseDown(TMouseButton button, TShiftState shift, int x, int y);
virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &Rect);
virtual void __fastcall Paint(void);
virtual void __fastcall ReadState(Classes::TReader* Reader);
virtual bool __fastcall CanModify(void);
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
public:
__fastcall TFurunoRadioGroup(TComponent* Owner);
__fastcall virtual ~TFurunoRadioGroup(void);
public:
__fastcall TFurunoRadioGroup(HWND ParentWindow) : TCustomControl(ParentWindow) { };
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(CM_WANTSPECIALKEY , TCMWantSpecialKey,CMWantSpecialKey)
END_MESSAGE_MAP(TCustomControl)
__published:
__property int Columns = {read=FColumns, write=SetColumns, default=1};
__property int ItemIndex = {read=FItemIndex, write=SetItemIndex, default=-1};
__property Classes::TStrings* Items = {read=FItems, write=SetItems, nodefault};
__property bool DrawRect = {read=FDrawRect, write=SetDrawRect, default=true};
__property TFurunoRadioHighlighting Highlighting = {read=FHighlighting, write=SetHighlighting, default=0};
__property Font;
__property ParentFont;
__property TabOrder;
__property TabStop;
__property Enabled;
__property Visible;
__property OnEnter;
__property OnExit;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
};
//---------------------------------------------------------------------------
#endif
(2)Error::Cannot Override a dynamic with a virtual function
virtual void __fastcall KeyDown();
virtual void __fastcall MouseDown();
(2)Warning::GetChildren hides virtual function __fastcall Controls::TWinControl::GetChildern()
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
(1)Error::Too few parameters in call to __fastcall Controls::TWinControl::GetChildern()
void __fastcall TFurunoRadioGroup::GetChildren(Classes::TGetChildProc Proc)
{
TCustomControl::GetChildren(Proc);
}
Any help would be appreciated,
Joe
/////////////////////////////////////////////////////////////////////////////
FurunoRadioGroup.h
/////////////////////////////////////////////////////////////////////////////
//---------------------------------------------------------------------------
#ifndef FurunoRadioGroupH
#define FurunoRadioGroupH
//---------------------------------------------------------------------------
#include <vcl\SysUtils.hpp>
#include <vcl\Controls.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Forms.hpp>
#include <vcl\Graphics.hpp>
#include <vcl\Messages.hpp>
#include <vcl\Windows.hpp>
#include <vcl\System.hpp>
#include <vcl\consts.hpp>
//---------------------------------------------------------------------------
enum TFurunoRadioHighlighting { frhUnderline, frhInverse };
//---------------------------------------------------------------------------
class TFurunoRadioGroup : public TCustomControl
{
private:
Classes::TList* FButtons;
Classes::TStrings* FItems;
int FItemIndex;
int FColumns;
TFurunoRadioHighlighting FHighlighting;
bool FDrawRect;
bool FReading;
bool FUpdating;
Classes::TNotifyEvent FOnResize;
void __fastcall ArrangeButtons(void);
void __fastcall ButtonClick(System::TObject* Sender);
void __fastcall ItemsChange(System::TObject* Sender);
void __fastcall SetButtonCount(int Value);
void __fastcall SetColumns(int Value);
void __fastcall SetItemIndex(int Value);
void __fastcall SetItems(Classes::TStrings* Value);
void __fastcall SetDrawRect(bool Value);
void __fastcall SetHighlighting(TFurunoRadioHighlighting Value);
void __fastcall UpdateButtons(void);
MESSAGE void __fastcall CMWantSpecialKey(TCMWantSpecialKey &Message);
HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
protected:
virtual void __fastcall KeyDown(Word &Key, TShiftState Shift);
virtual void __fastcall MouseDown(TMouseButton button, TShiftState shift, int x, int y);
virtual void __fastcall AlignControls(Controls::TControl* AControl, Windows::TRect &Rect);
virtual void __fastcall Paint(void);
virtual void __fastcall ReadState(Classes::TReader* Reader);
virtual bool __fastcall CanModify(void);
virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
public:
__fastcall TFurunoRadioGroup(TComponent* Owner);
__fastcall virtual ~TFurunoRadioGroup(void);
public:
__fastcall TFurunoRadioGroup(HWND ParentWindow) : TCustomControl(ParentWindow) { };
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(CM_WANTSPECIALKEY , TCMWantSpecialKey,CMWantSpecialKey)
END_MESSAGE_MAP(TCustomControl)
__published:
__property int Columns = {read=FColumns, write=SetColumns, default=1};
__property int ItemIndex = {read=FItemIndex, write=SetItemIndex, default=-1};
__property Classes::TStrings* Items = {read=FItems, write=SetItems, nodefault};
__property bool DrawRect = {read=FDrawRect, write=SetDrawRect, default=true};
__property TFurunoRadioHighlighting Highlighting = {read=FHighlighting, write=SetHighlighting, default=0};
__property Font;
__property ParentFont;
__property TabOrder;
__property TabStop;
__property Enabled;
__property Visible;
__property OnEnter;
__property OnExit;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
};
//---------------------------------------------------------------------------
#endif
RE: C++Builder1.0 Component does not port to 3.0 or higher
Ion Filipski

filipski@excite.com
RE: C++Builder1.0 Component does not port to 3.0 or higher
Cyprus
RE: C++Builder1.0 Component does not port to 3.0 or higher
Cyprus
RE: C++Builder1.0 Component does not port to 3.0 or higher
The call to TCustomControl::GetChildren(Proc); still generates an error so I dropped the "TCustomControl::" and call GetChildren(Proc) which compiles with warnings but doesn't generate an error.
The procedures are:
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::KeyDown(Word &Key, TShiftState Shift)
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::MouseDown(TMouseButton button, TShiftState shift, int x, int y)
//---------------------------------------------------------------------------
void __fastcall TFurunoRadioGroup::GetChildren(Classes::TGetChildProc Proc)
{
TCustomControl::GetChildren(Proc);
}