[lazarus] Creating Components...
Michael A. Hess
mhess at miraclec.com
Thu Aug 12 10:53:46 EDT 1999
Jeff Wormsley wrote:
>
> On 8/12/99, at 10:08 AM, Michael A. Hess wrote:
>
> >Then of course add the DoYYY procedure to the controls.inc file. Just
> >because it isn't something that GTK sends back to the control doesn't
> >mean we can't add it for Windows.
>
> So it isn't considered a problem to have code in the controls.pp that
> will only be executed in a windows environment, as long as it doesn't
> require linking in any windows specific units?
Correct. As long as you can link the LCL against the GTK libraries and
it doesn't require anything from Windows it is fine. The real main
portability issue is at the application level.
Using hellp.pp and helloform.pp as the example they do not reference
anything that has anything to do with the API. It just says create a
form and create a button. How the LCL does it is it's business. I just
want it to do it with either GTK or Windows or Qt or whatever. Just as
in the Delphi VCL you have the source but you don't need it. You link
against build DCU's and thus it will be with Lazarus. Most people will
link there application against a prebuilt set of DCUs for the base LCL
classes and the API unit of their choosing.
> That will make things a bit easier. I was trying to avoid touching
> the base LCL code at all.
The only thing you want to avoid in the LCL are direct call to a given
API code set. No direct GTK calls, no direct Qt calls, no direct Windows
calls. If you need to place something in the control class to support
being able to call the Windows API from the win32int unit that is just
fine.
> If I can add properties, messages and events that are only used
> by windows there, it will make my job a lot easier. This will give me
> my state storage that I need. As long as all of this is kept either
> private, or heavily commented that it is not to be used directly by
> applications, then there shouldn't be any portability problems.
Correct. In most cases general application don't or won't be accessing
these kind of things. Just as in Delphi you don't generally write any
code that deals with how the control calls the Windows API.
--
==== Programming my first best destiny! ====
Michael A. Hess Miracle Concepts, Inc.
mhess at miraclec.com http://www.miraclec.com
More information about the Lazarus
mailing list