[Lazarus] TImage - Getting image properties in 'canvas space'

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Apr 19 09:20:26 CEST 2012


On 18 April 2012 23:36, Reimar Grabowski <reimgrab at web.de> wrote:
> What does depending on the compiler mean? The compiler is obviously FPC.
> If it is really true that you can access protected members in that way (like Svens message suggests) I consider this a bug.
> Like Mattias said, protected is of no real use in that case and we can just declare all non private members public.


Framework and Component developers cannot foresee all possible
use-cases. So they might have thought protected is fine. I have
numerous cases where I had to use the "class helper hack" (before the
class helper or friend class features was introduced into FPC or
Delphi). This doesn't mean protected is of no use any more, or that
all protected methods should now become public, but it is often the
case where one method needs to be accessed.

If you really want concrete examples, I can search my code for where I
use the "class helper hack".


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net




More information about the Lazarus mailing list