[fpc-pascal] strict private construct
Graeme Geldenhuys
mailinglists at geldenhuys.co.uk
Fri Apr 12 13:23:15 CEST 2019
Hi,
What exactly is the point of "strict private"? I believe FPC supports it
too, after Delphi added it. It makes absolutely no senses to me. From
the name and original intent, it means it is "really really private"
even in the same unit.
Yet you do something like this... and you have access to the strict
private fields or methods. Go figure!
//we need this helper to access some strict private fields
TButtonStyleHookHelper = class Helper for TButtonStyleHook
protected
function Pressed : Boolean;
function DropDown: Boolean;
end;
{ TButtonStyleHookHelper }
function TButtonStyleHookHelper.DropDown: Boolean;
begin
Result:=Self.FDropDown;
end;
function TButtonStyleHookHelper.Pressed: Boolean;
begin
Result:=Self.FPressed;
end;
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
More information about the fpc-pascal
mailing list