[Re: [lazarus] RFC : Type separation]
Michal Bukovjan
mbukovjan at netscape.net
Sat Aug 7 14:18:45 EDT 1999
"Michael A. Hess" <mhess at miraclec.com> wrote:
> Michal Bukovjan wrote:
> >
> > I wanted to put into comments the idea that simple type used in
> > controls.pp could be separated into a separate unit, say
> > controltypes.pp.
> >
> > This would allow to reference these types in units like lmessages.pp,
> > gtkint.pp and gtkobject types, without referencing the whole classes,
> > so that they can be used in messages without the need to typecast
> > everything.
>
> I'd have to look at it to see what could be moved out but off the top of
> my head I'm not sure what it would save. In the case of controls.pp just
> about every other unit needs the class information that is found in
> controls.pp. For example the gtkint uses the controls class to gather
> information about the object being passed to the interface unit. So this
> couldn't be removed. So I'm not sure if there is a case where controls
> is being used where just those simple types are being used. In most
> cases it is requiring access the TControl class. But hey I'll look at
> it. :-)
>
Hmm, that was just an idea.
The problem I am trying to solve is more about efficiency and architecture.
I presume that gtkint.pp, as well as lmessages.pp, should now only about
TControl, NOT its descendants. Now I need to pass information in messages,
like the TComboBoxStyle information, so that the GTK dependent object could
set up the things properly. So I would need the lmessages.pp know about
TComboBoxStyle, therefore make it use stdctrls.pp, not only controls.pp (I
want to avoid this typecasting thing where possible). Now this would result in
linking in a lot of stuff from that unit, or not?
Is it legal for me to reference the stdcontrols.pp unit in lmessages.pp?
Once again, I may be completely wrong (that's why I request for comment,
rather than making a suggestion). I have an experience form one of my project,
that I needed some simple type information about TTable (maybe TFieldType ? -
don't remember now). I had to include a unit (DB?, or DBTables?). Thanks to
this, the project size rose about 100k, and of course, the unit had some
initialization stuff, doing things I did not need.
So in short, the problem is, how to reference a TComboBoxStyle type in
lmessages, preferebly without typecasting in both lmessages and gtkobject, or
even declaring new types or constants, the most efficient way.
Michal Bukovjan
> --
> ==== Programming my first best destiny! ====
>
> Michael A. Hess Miracle Concepts, Inc.
> mhess at miraclec.com http://www.miraclec.com
>
> _________________________________________________________________
> To unsubscribe: mail lazarus-request at miraclec.com with
> "unsubscribe" as the Subject
> archives at http://www.miraclec.com/list_archives/lazarus
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at http://webmail.netscape.com.
More information about the Lazarus
mailing list