On Sat, 9 Jul 2011 02:32:42 +0400
Max Vlasov <[email protected]> wrote:

> On Sat, Jul 9, 2011 at 12:26 AM, Alexander Klenin <[email protected]> wrote:
> > On Fri, Jul 8, 2011 at 08:30, Max Vlasov <[email protected]> wrote:
> >> So after some investigation I came up with a one minor fix. If ImgList
> >> is removed from the Themes implementation section and
> >> DrawIcon(ACanvas...) made blank, Graphics no longer indirectly uses
> >> Controls unit . The only place that uses this overloaded
> >> DrawIcon(ACanvas method is \lcl\include\headercontrol.inc. Sure this
> >> change is not a fix that works, but just proof-of-concept change that
> >> shows that this method either can be moved somewhere or replace with
> >> something else allowing existence of Graphics without Widget Set
> >> (Factory) usage.
> >
> > This is excellent news for me, since I have long planned to get rid of
> > Graphics unit in TAChart to avoid widgetset dependency.
> > I thought that Graphics depends on WidgetSet due to Delphi compatibility.
> > If in fact the dependency is just an implementation accident,
> > I would like it very much to see it gone.
> >
> > Can you post a patch of your changes for easier review/discussion?
> >
> 
> Sorry for my free form of the patch, it looks like the following
> changes in Themes.pas
> 
> implementation
> uses
>   SysUtils, InterfaceBase, LCLIntf, GraphType, Graphics, ImgList;
> 
> implementation
> uses
>   SysUtils, InterfaceBase, LCLIntf, GraphType, Graphics{, ImgList};
> 
> 
> and
> 
> procedure TThemeServices.DrawIcon(ACanvas: TPersistent;
>   Details: TThemedElementDetails; const P: TPoint; AImageList:
> TPersistent;  Index: Integer);
> begin
> ...
> end;
> 
> to
> 
> procedure TThemeServices.DrawIcon(ACanvas: TPersistent;
>   Details: TThemedElementDetails; const P: TPoint; AImageList:
> TPersistent;  Index: Integer);
> begin
> end;
> 
> so just make this overloaded DrawIcon do nothing.

I restructured a few things so Graphics no longer depends on Controls.

Mattias

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to