[fpc-pascal] Using the FPCanvas unit (in fpGUI)

Graeme Geldenhuys graemeg.lists at gmail.com
Fri May 4 20:16:42 CEST 2007


If I wanted to start using the FPCanvas unit as a set of base classes
for fpGUI (my custom drawn widget set), what do I need to do, or
implement.  Is there any documentation on that unit.

Take the Font class as an example.  Looking at the TFPCustomFont
class.  I guess I would need to create a descendant class (TFFont in
this case) and then override the abstract methods (in this case
virtual or some reason) for each supported painting backend (GDI, X11)
to create the correct resources.

TFFont = class(TFPCustomFont)
    procedure DoAllocateResources; override;
    procedure DoDeAllocateResources; override;

Am I understanding this correctly?
Is this what the FPCanvas unit is meant for?  Acting as a base class
for an actual implementation?

Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

More information about the fpc-pascal mailing list