Here is the code which gives me the error:
TAdvSmoothDockItems = class(TCollection)
private
FOwner: TAdvSmoothDock;
FOnChange: TNotifyEvent;
protected
function GetItem(Index: Integer): TAdvSmoothDockItem; virtual; //YLM_TMS_01
procedure SetItem(Index: Integer; const Value: TAdvSmoothDockItem); virtual; //YLM_TMS_01
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TAdvSmoothDock); overload; virtual; //YLM_TMS_01
function Add: TAdvSmoothDockItem; virtual; //YLM_TMS_01
function Insert(Index: Integer): TAdvSmoothDockItem; virtual; //YLM_TMS_01
property Items[Index: Integer]: TAdvSmoothDockItem read GetItem write SetItem; default;
procedure Delete(Index: Integer); virtual; //YLM_TMS_01
published
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
TKHAdvSmoothDockItems = class(TAdvSmoothDockItems)
private
FOwner: TKHAdvSmoothDock;
FOnChange: TNotifyEvent;
protected
function GetItem(Index: Integer): TKHAdvSmoothDockItem; override;
procedure SetItem(Index: Integer; const Value: TKHAdvSmoothDockItem); override;
function GetOwner: TPersistent; override;
public
constructor Create(AOwner: TKHAdvSmoothDock);
function Add: TKHAdvSmoothDockItem;
function Insert(Index: Integer): TKHAdvSmoothDockItem;
property Items[Index: Integer]: TKHAdvSmoothDockItem read GetItem write SetItem; default;
procedure Delete(Index: Integer); override;
published
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
this code gives me the following error :
E2037 Declaration of 'GetItem' differs from previous declaration
why ? I have declared the GetItem in base-class as "Virtual" then I tried to override it in the next class (TKHAdvSmoothDockItems)...? how to fix it?