mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 18:58:04 +02:00
LCL: broke unit dependency of graphics on controls
git-svn-id: trunk@31628 -
This commit is contained in:
parent
c36216f022
commit
597e60e8a7
13
lcl/forms.pp
13
lcl/forms.pp
@ -41,7 +41,8 @@ uses
|
||||
Classes, SysUtils, Types, TypInfo, Math,
|
||||
AvgLvlTree, Maps, LCLVersion, LCLStrConsts, LCLType, LCLProc, LCLIntf,
|
||||
FileUtil, InterfaceBase, LResources, GraphType, Graphics, Menus, LMessages,
|
||||
CustomTimer, ActnList, ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls, Themes
|
||||
CustomTimer, ActnList, ClipBrd, CustApp, HelpIntfs, LCLClasses, Controls,
|
||||
ImgList, Themes
|
||||
{$ifndef wince},gettext{$endif}// remove ifdefs when gettext is fixed and a new fpc is released
|
||||
;
|
||||
|
||||
@ -1980,6 +1981,15 @@ end;
|
||||
|
||||
//==============================================================================
|
||||
|
||||
procedure ImageDrawEvent(AImageList: TPersistent; ACanvas: TPersistent;
|
||||
AX, AY, AIndex: Integer; ADrawEffect: TGraphicsDrawEffect);
|
||||
var
|
||||
ImageList: TCustomImageList absolute AImageList;
|
||||
Canvas: TCanvas absolute ACanvas;
|
||||
begin
|
||||
ImageList.Draw(Canvas,AX,AY,AIndex,ADrawEffect);
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$INCLUDE cursors.lrs}
|
||||
RegisterPropertyToSkip(TForm, 'OldCreateOrder', 'VCL compatibility property', '');
|
||||
@ -1987,6 +1997,7 @@ initialization
|
||||
RegisterPropertyToSkip(TForm, 'Scaled', 'VCL compatibility property', '');
|
||||
RegisterPropertyToSkip(TForm, 'TransparentColorValue', 'VCL compatibility property', '');
|
||||
LCLProc.OwnerFormDesignerModifiedProc:=@IfOwnerIsFormThenDesignerModified;
|
||||
ThemesImageDrawEvent:=@ImageDrawEvent;
|
||||
Screen:=TScreen.Create(nil);
|
||||
Application:=TApplication.Create(nil);
|
||||
|
||||
|
@ -44,8 +44,8 @@ uses
|
||||
FPReadGif,
|
||||
IntfGraphics,
|
||||
AvgLvlTree,
|
||||
LCLStrConsts, LCLType, LCLProc, LMessages, LCLIntf, LResources, LCLResCache,
|
||||
GraphType, IcnsTypes, GraphMath, InterfaceBase, WSReferences;
|
||||
LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache,
|
||||
GraphType, IcnsTypes, GraphMath, WSReferences;
|
||||
|
||||
type
|
||||
PColor = ^TColor;
|
||||
@ -2017,8 +2017,9 @@ procedure Register;
|
||||
procedure UpdateHandleObjects;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
SyncObjs;
|
||||
SyncObjs, LCLIntf, InterfaceBase;
|
||||
|
||||
var
|
||||
GraphicsUpdateCount: Integer = 0;
|
||||
|
@ -33,7 +33,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, fpImage, FPReadBMP, FPWriteBMP, BMPComn, FPCAdds,
|
||||
AvgLvlTree, LCLType, LCLversion, Math,
|
||||
LCLProc, GraphType, LCLIntf, FPReadPNG, FPWritePNG, FPReadTiff, FPWriteTiff,
|
||||
LCLProc, GraphType, FPReadPNG, FPWritePNG, FPReadTiff, FPWriteTiff,
|
||||
IcnsTypes;
|
||||
|
||||
type
|
||||
@ -731,7 +731,7 @@ function dbgs(const FPColor: TFPColor): string; overload;
|
||||
implementation
|
||||
|
||||
uses
|
||||
Graphics;
|
||||
Graphics, LCLIntf;
|
||||
|
||||
type
|
||||
PFPColorBytes = ^TFPColorBytes;
|
||||
|
@ -48,7 +48,8 @@ interface
|
||||
uses
|
||||
// no Graphics or Controls can be used here to prevent circular references
|
||||
//
|
||||
Types, Math, Classes, LCLProc, LCLType, TmSchema;
|
||||
SysUtils, Types, GraphType, Math, Classes, LCLProc, LCLType, Graphics,
|
||||
TmSchema;
|
||||
|
||||
type
|
||||
// These are all elements which can be themed.
|
||||
@ -510,11 +511,16 @@ const
|
||||
// Do not modify the copyright in any way! Usage of this unit is prohibited without the copyright notice
|
||||
// in the compiled binary file.
|
||||
ThemeManagerCopyright: string = 'Theme manager © 2001-2005 Mike Lischke';
|
||||
type
|
||||
TThemesImageDrawEvent = procedure(AImageList: TPersistent; ACanvas: TPersistent;
|
||||
AX, AY, AIndex: Integer; ADrawEffect: TGraphicsDrawEffect);
|
||||
var
|
||||
ThemesImageDrawEvent: TThemesImageDrawEvent = nil; // set by unit ImgList if used
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, InterfaceBase, LCLIntf, GraphType, Graphics, ImgList;
|
||||
InterfaceBase, LCLIntf;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -2187,10 +2193,9 @@ procedure TThemeServices.DrawIcon(ACanvas: TPersistent;
|
||||
Details: TThemedElementDetails; const P: TPoint; AImageList: TPersistent;
|
||||
Index: Integer);
|
||||
var
|
||||
Canvas: TCanvas absolute ACanvas;
|
||||
ImageList: TCustomImageList absolute AImageList;
|
||||
AEffect: TGraphicsDrawEffect;
|
||||
begin
|
||||
if not Assigned(ThemesImageDrawEvent) then exit;
|
||||
if IsDisabled(Details) then
|
||||
AEffect := gdeDisabled
|
||||
else
|
||||
@ -2201,7 +2206,7 @@ begin
|
||||
AEffect := gdeHighlighted
|
||||
else
|
||||
AEffect := gdeNormal;
|
||||
ImageList.Draw(Canvas, P.X, P.Y, Index, AEffect);
|
||||
ThemesImageDrawEvent(AImageList, ACanvas, P.X, P.Y, Index, AEffect);
|
||||
end;
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user