I assume PrintText is not defined as a virtual method, so you can't override it.
Maybe there is an event (like OnBeforePrintText) that can be used to add extra functionality.
Else you should redefine some of the functionality.
The difference between static and dynamic linking
When you have a class with two methods and a subclass that overrides one of them:
type
TBaseClass = class
public
procedure MethodA; // Calls MethodB
procedure MethodB;
end;
TSubClass = class (TBaseClass)
public
procedure MethodB;
end;
Now you have an object of TSubClass and call MethodA. Then then MethodB of TBaseClass is called. This is called static linking. MethodB of TSubClass is not called by MethodA of TBaseClass.
But if you declare MethodB as virtual, and use override in TSubClass:
type
TBaseClass = class
public
procedure MethodA; // Calls MethodB
procedure MethodB; virtual;
end;
TSubClass = class (TBaseClass)
public
procedure MethodB; override;
end;
Now MethodB is dynamically linked. So when you call MethodA on an object of class TSubClass, MethodB of TSubClass is called.