[fpc-devel] TComponent.ChangeName() not virtual?

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Mar 24 15:56:07 CET 2010

Paul Ishenin het geskryf:
> SetName obviosly more than just set FName. And how to protect FName and 
> at the same time give a way to change it without hooking the events?

OK, that make sense, but then the same could be accomplished by simply
moving FName to the protected section. After all, nobody can override
ChangeName() because its not virtual, so all that it will ever do is just
set the FName field variable. A developer wanting to bypass the code in
SetName, could then simply set FName directly - and get rid of the
pointless ChangeName method..

Either way, my initial problem has been solved by overriding the SetName()

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-devel mailing list