Public types in Delphi components

I have subclassed the FMX component and I want to override the (virtual) protected procedure.

This procedure has a number of parameters declared as "open type" in the component class.

When I try to override a procedure, I get an error when one of the types is not declared, although my component subclasses the original one. Should I access it?

The class is defined as follows:

TTabControl = class (...)
public type
  TTabBarButton = (Left, Right)
  TTabBarButtons = set of TTabButton;
  ....
protected
  procedure DoUpdate(const TabBarButtons: TTabBarButtons; ....); virtual;
  ...
end;

Now I have subclassed this class and want to override DoUpdate.

TMyClass = class (TTabControl)
protected
  procedure DoUpdate(const TabBarButtons: TTabBarButtons; ....); override;  
  ....
end;

The compiler complains that TTabBarButtons is not defined in my class. If I redefine TTabBarButtons as an open type in my class, then it says that the definition is different from the base class.

Could you help me with this?

Many thanks.

+4
1

:

TMyClass = class (TTabControl)
protected
  procedure DoUpdate(const TabBarButtons: TTabControl.TTabBarButtons; ....); override;  
  ....
end;

, ; , . .: -)

+3

All Articles