git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@58 05c56307-c608-d34a-929d-697000501d7a
3243 lines
106 KiB
ObjectPascal
3243 lines
106 KiB
ObjectPascal
{*******************************************************************}
|
|
{ }
|
|
{ Developer Express Visual Component Library }
|
|
{ ExpressPrinting System COMPONENT SUITE }
|
|
{ }
|
|
{ Copyright (C) 1998-2009 Developer Express Inc. }
|
|
{ ALL RIGHTS RESERVED }
|
|
{ }
|
|
{ The entire contents of this file is protected by U.S. and }
|
|
{ International Copyright Laws. Unauthorized reproduction, }
|
|
{ reverse-engineering, and distribution of all or any portion of }
|
|
{ the code contained in this file is strictly prohibited and may }
|
|
{ result in severe civil and criminal penalties and will be }
|
|
{ prosecuted to the maximum extent possible under the law. }
|
|
{ }
|
|
{ RESTRICTIONS }
|
|
{ }
|
|
{ THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES }
|
|
{ (DCU, OBJ, DLL, ETC.) ARE CONFIDENTIAL AND PROPRIETARY TRADE }
|
|
{ SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS }
|
|
{ LICENSED TO DISTRIBUTE THE EXPRESSPRINTINGSYSTEM AND }
|
|
{ ALL ACCOMPANYING VCL CONTROLS AS PART OF AN }
|
|
{ EXECUTABLE PROGRAM ONLY. }
|
|
{ }
|
|
{ THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED }
|
|
{ FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE }
|
|
{ COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE }
|
|
{ AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT }
|
|
{ AND PERMISSION FROM DEVELOPER EXPRESS INC. }
|
|
{ }
|
|
{ CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON }
|
|
{ ADDITIONAL RESTRICTIONS. }
|
|
{ }
|
|
{*******************************************************************}
|
|
|
|
unit dxPSdxLC2Lnk;
|
|
|
|
interface
|
|
|
|
{$I cxVer.inc}
|
|
{$I dxPS.inc}
|
|
|
|
uses
|
|
Classes, Windows, Graphics, Controls, ComCtrls, dxLayoutLookAndFeels,
|
|
dxLayoutControl, dxBase, dxPrnPg, dxPSCore, dxPSContainerLnk, cxDrawTextUtils,
|
|
{$IFDEF PS4}
|
|
dxPSReportRenderCanvas,
|
|
{$ENDIF}
|
|
cxGeometry;
|
|
|
|
type
|
|
TdxLayoutControlReportLink = class;
|
|
TdxLayoutControlReportLinkOptionsBehavior = class;
|
|
TdxLayoutControlReportLinkOptionsPagination = class;
|
|
TdxLayoutControlReportLinkOptionsTransparent = class;
|
|
|
|
{ Report Items}
|
|
|
|
TdxLCCacheItemKind = (ikLayoutItem, ikLayoutGroup, ikLayoutItemCaption, ikControl);
|
|
|
|
TdxLCBoundsCacheItem = class
|
|
public
|
|
Component: TComponent; // nil if ItemKind = ikItemCaption
|
|
Bounds: TRect;
|
|
EmbeddedLink: Boolean;
|
|
end;
|
|
|
|
TdxLayoutItemChacheState = class
|
|
public
|
|
Expanded: Boolean;
|
|
Direction: TdxLayoutDirection;
|
|
Index: Integer;
|
|
Item: TdxCustomLayoutItem;
|
|
ItemIndex: Integer;
|
|
Visible: Boolean;
|
|
end;
|
|
|
|
TdxReportLayoutControlHost = class(TdxReportWinControlHost)
|
|
protected
|
|
function GetControlItem: TdxReportVisualItem; override;
|
|
end;
|
|
|
|
TdxReportLayoutCaptionTextCell = class(TdxReportCellString)
|
|
protected
|
|
function GetDefaultDTFormat: DWORD; override;
|
|
end;
|
|
|
|
TdxReportCustomLayoutCaptionCell = class(TdxReportCell)
|
|
private
|
|
FTextItem: TdxReportLayoutCaptionTextCell;
|
|
FImageItem: TdxReportCellImage;
|
|
function GetLayoutItem: TdxCustomLayoutItem;
|
|
function GetCaptionBounds: TRect;
|
|
function GetCaptionOptions: TdxCustomLayoutItemCaptionOptions;
|
|
function GetHasImageItem: Boolean;
|
|
function GetHasTextItem: Boolean;
|
|
function GetImageBounds: TRect;
|
|
function GetImageOptions: TdxCustomLayoutItemImageOptions;
|
|
function GetTextBounds: TRect;
|
|
protected
|
|
procedure AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF}); virtual;
|
|
procedure Initialize(ALayoutItem: TdxCustomLayoutItem; AReportLink: TdxLayoutControlReportLink); virtual;
|
|
|
|
function CreateImageCell(AReportLink: TdxLayoutControlReportLink): TdxReportCellImage; virtual;
|
|
function CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell; virtual;
|
|
|
|
function IsImageVisible: Boolean; virtual;
|
|
function IsTextVisible: Boolean; virtual;
|
|
|
|
property CaptionBounds: TRect read GetCaptionBounds;
|
|
property ImageBounds: TRect read GetImageBounds;
|
|
property TextBounds: TRect read GetTextBounds;
|
|
|
|
property CaptionOptions: TdxCustomLayoutItemCaptionOptions read GetCaptionOptions;
|
|
property ImageOptions: TdxCustomLayoutItemImageOptions read GetImageOptions;
|
|
public
|
|
property LayoutItem: TdxCustomLayoutItem read GetLayoutItem;
|
|
|
|
property ImageItem: TdxReportCellImage read FImageItem;
|
|
property HasImageItem: Boolean read GetHasImageItem;
|
|
property HasTextItem: Boolean read GetHasTextItem;
|
|
property TextItem: TdxReportLayoutCaptionTextCell read FTextItem;
|
|
end;
|
|
|
|
TdxReportCustomLayoutCaptionCellClass = class of TdxReportCustomLayoutCaptionCell;
|
|
|
|
TdxCustomReportLayoutItem = class(TdxReportGroup)
|
|
private
|
|
FCaptionItem: TdxReportCustomLayoutCaptionCell;
|
|
function GetHasCaptionItem: Boolean;
|
|
function GetLayoutItem: TdxCustomLayoutItem;
|
|
function GetLayoutItemBounds: TRect;
|
|
protected
|
|
procedure AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF}); virtual;
|
|
procedure Initialize(AReportLink: TdxLayoutControlReportLink); virtual;
|
|
function CaptionCellClass: TdxReportCustomLayoutCaptionCellClass; virtual;
|
|
function CreateCaptionCell(AReportLink: TdxLayoutControlReportLink): TdxReportCustomLayoutCaptionCell; virtual;
|
|
function IsCaptionVisible: Boolean;
|
|
function NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean; virtual;
|
|
|
|
property LayoutItemBounds: TRect read GetLayoutItemBounds;
|
|
public
|
|
property LayoutItem: TdxCustomLayoutItem read GetLayoutItem;
|
|
property CaptionItem: TdxReportCustomLayoutCaptionCell read FCaptionItem;
|
|
property HasCaptionItem: Boolean read GetHasCaptionItem;
|
|
end;
|
|
|
|
{ TdxReportLayoutGroup }
|
|
|
|
TdxReportLayoutGroup = class;
|
|
|
|
TdxReportLayoutGroupCaptionCell = class(TdxReportCustomLayoutCaptionCell)
|
|
protected
|
|
function CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell; override;
|
|
end;
|
|
|
|
TdxPSReportLayoutGroupStandardLookAndFeel = class;
|
|
|
|
TdxPSReportLayoutGroupStandardLookAndFeelPainter = class(TdxPSReportGroupStandardLookAndFeelPainter)
|
|
protected
|
|
procedure DrawCaptionText({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF}); override;
|
|
public
|
|
function LookAndFeel: TdxPSReportLayoutGroupStandardLookAndFeel; overload; virtual;
|
|
end;
|
|
|
|
TdxPSReportLayoutGroupStandardLookAndFeel = class(TdxPSReportGroupStandardLookAndFeel)
|
|
protected
|
|
function GetCaptionHeight(AGroup: TdxReportGroup): Integer; override;
|
|
function GetCaptionTextBounds(AGroup: TdxReportGroup): TRect; override;
|
|
class function GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass; override;
|
|
end;
|
|
|
|
TdxPSReportLayoutGroupOfficeLookAndFeel = class(TdxPSReportLayoutGroupStandardLookAndFeel)
|
|
protected
|
|
function GetCaptionIndent: Integer; override;
|
|
public
|
|
class function DefaultBorderSides: TdxCellSides; override;
|
|
class function Name: string; override;
|
|
end;
|
|
|
|
TdxReportLayoutGroup = class(TdxCustomReportLayoutItem)
|
|
protected
|
|
function CaptionCellClass: TdxReportCustomLayoutCaptionCellClass; override;
|
|
end;
|
|
|
|
TdxReportLayoutBasicItem = class(TdxCustomReportLayoutItem);
|
|
TdxReportLayoutEmptySpaceItem = class(TdxReportLayoutBasicItem);
|
|
|
|
TdxReportLayoutDirectionalItem = class(TdxReportLayoutBasicItem)
|
|
private
|
|
FSeparatorItem: TdxReportCell;
|
|
function GetHasSeparatorItem: Boolean;
|
|
function GetLayoutItem: TdxLayoutDirectionalItem;
|
|
function GetSeparatorBounds: TRect;
|
|
protected
|
|
procedure AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF}); override;
|
|
procedure Initialize(AReportLink: TdxLayoutControlReportLink); override;
|
|
function NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean; override;
|
|
function CreateSeparatorCell(AReportLink: TdxLayoutControlReportLink): TdxReportCell; virtual;
|
|
|
|
property SeparatorBounds: TRect read GetSeparatorBounds;
|
|
public
|
|
property LayoutItem: TdxLayoutDirectionalItem read GetLayoutItem;
|
|
property SeparatorItem: TdxReportCell read FSeparatorItem;
|
|
property HasSeparatorItem: Boolean read GetHasSeparatorItem;
|
|
end;
|
|
|
|
TdxReportLayoutSeparatorItem = class(TdxReportLayoutDirectionalItem);
|
|
TdxReportLayoutSplitterItem = class(TdxReportLayoutDirectionalItem);
|
|
|
|
{ TdxReportLayoutLabeledItem }
|
|
|
|
TdxReportLayoutLabeledItemCaptionCell = class(TdxReportCustomLayoutCaptionCell)
|
|
private
|
|
function GetCaptionOptions: TdxLayoutLabeledItemCaptionOptions;
|
|
protected
|
|
function CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell; override;
|
|
|
|
property CaptionOptions: TdxLayoutLabeledItemCaptionOptions read GetCaptionOptions;
|
|
end;
|
|
|
|
TdxReportLayoutLabeledItem = class(TdxReportLayoutBasicItem)
|
|
private
|
|
function GetLayoutItem: TdxLayoutCustomLabeledItem;
|
|
protected
|
|
function CaptionCellClass: TdxReportCustomLayoutCaptionCellClass; override;
|
|
public
|
|
property LayoutItem: TdxLayoutCustomLabeledItem read GetLayoutItem;
|
|
end;
|
|
|
|
TdxReportLayoutItem = class(TdxReportLayoutLabeledItem)
|
|
private
|
|
FControlItem: TdxReportVisualItem;
|
|
function GetAdapter: TdxCustomLayoutControlAdapter;
|
|
function GetControl: TControl;
|
|
function GetControlBounds: TRect;
|
|
function GetHasControlItem: Boolean;
|
|
function GetIsControlAccessible: Boolean;
|
|
protected
|
|
procedure AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF}); override;
|
|
procedure Initialize(AReportLink: TdxLayoutControlReportLink); override;
|
|
function NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean; override;
|
|
|
|
function CreateControlCell(AReportLink: TdxLayoutControlReportLink): TdxReportVisualItem; virtual;
|
|
function NeedCreateControlCell(AReportLink: TdxLayoutControlReportLink): Boolean; virtual;
|
|
|
|
property Adapter: TdxCustomLayoutControlAdapter read GetAdapter;
|
|
property ControlBounds: TRect read GetControlBounds;
|
|
property IsControlAccessible: Boolean read GetIsControlAccessible;
|
|
public
|
|
function LayoutItem: TdxLayoutItem;
|
|
|
|
property Control: TControl read GetControl;
|
|
property ControlItem: TdxReportVisualItem read FControlItem;
|
|
property HasControlItem: Boolean read GetHasControlItem;
|
|
end;
|
|
|
|
{ Definitions }
|
|
|
|
TdxPSCustomLayoutItemDefinition = class(TdxPSCustomContainerItemDefinition)
|
|
private
|
|
function GetLayoutItem: TdxCustomLayoutItem;
|
|
function GetReportItem: TdxCustomReportLayoutItem;
|
|
procedure SetLayoutItem(Value: TdxCustomLayoutItem);
|
|
protected
|
|
{$IFDEF PS4}
|
|
procedure AdjustBounds(ACanvas: TdxPSReportRenderCustomCanvas); virtual;
|
|
{$ELSE}
|
|
procedure AdjustBounds(DC: HDC); virtual;
|
|
{$ENDIF}
|
|
procedure SaveOriginalItemSize; virtual;
|
|
procedure SetupOriginalControlSize; virtual;
|
|
public
|
|
function OptionsPagination: TdxLayoutControlReportLinkOptionsPagination; reintroduce; overload;
|
|
property LayoutItem: TdxCustomLayoutItem read GetLayoutItem write SetLayoutItem;
|
|
property ReportItem: TdxCustomReportLayoutItem read GetReportItem;
|
|
end;
|
|
|
|
TdxPSLayoutGroupDefinition = class(TdxPSCustomLayoutItemDefinition)
|
|
private
|
|
function GetLayoutItem: TdxLayoutGroup;
|
|
protected
|
|
procedure AddDelimitersHorz(AList: TList); override;
|
|
procedure AddDelimitersVert(AList: TList); override;
|
|
public
|
|
property LayoutItem: TdxLayoutGroup read GetLayoutItem;
|
|
end;
|
|
|
|
TdxPSLayoutBasicItemDefinition = class(TdxPSCustomLayoutItemDefinition)
|
|
protected
|
|
procedure AddDelimitersHorz(AList: TList); override;
|
|
procedure AddDelimitersVert(AList: TList); override;
|
|
end;
|
|
|
|
TdxPSLayoutLabeledItemDefinition = class(TdxPSLayoutBasicItemDefinition);
|
|
|
|
TdxPSLayoutItemDefinition = class(TdxPSLayoutLabeledItemDefinition)
|
|
private
|
|
function GetLayoutItem: TdxLayoutItem;
|
|
function GetReportItem: TdxReportLayoutItem;
|
|
protected
|
|
procedure SaveOriginalItemSize; override;
|
|
procedure SetupOriginalControlSize; override;
|
|
public
|
|
constructor Create(AReportLink: TdxCustomContainerReportLink; AComponent: TComponent; AReportItem: TdxReportVisualItem); override;
|
|
|
|
property LayoutItem: TdxLayoutItem read GetLayoutItem;
|
|
property ReportItem: TdxReportLayoutItem read GetReportItem;
|
|
end;
|
|
|
|
{ Producers }
|
|
|
|
TdxPSLayoutControlObjectProducer = class(TdxPSCustomProducer)
|
|
public
|
|
function ReportLink: TdxLayoutControlReportLink; reintroduce; overload;
|
|
function RootContainer: TdxLayoutControl; reintroduce; overload;
|
|
end;
|
|
|
|
TdxPSLayoutLookAndFeelProducerClass = class of TdxPSLayoutLookAndFeelProducer;
|
|
|
|
TdxPSLayoutLookAndFeelProducer = class(TdxPSLayoutControlObjectProducer)
|
|
protected
|
|
function GetContentColor: TColor; virtual;
|
|
function GetGroupCaptionColor: TColor; virtual;
|
|
function GetIsContentTransparent: Boolean; virtual;
|
|
function GetIsGroupCaptionTransparent: Boolean; virtual;
|
|
function GetTransparentColor: TColor; virtual;
|
|
|
|
procedure InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); virtual;
|
|
class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; virtual;
|
|
|
|
property GroupCaptionColor: TColor read GetGroupCaptionColor;
|
|
property IsGroupCaptionTransparent: Boolean read GetIsGroupCaptionTransparent;
|
|
public
|
|
function LayoutLookAndFeel: TdxCustomLayoutLookAndFeel; overload; virtual;
|
|
class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; virtual;
|
|
|
|
class function PairClass: TClass; override;
|
|
class procedure Register; override;
|
|
class procedure Unregister; override;
|
|
|
|
property ContentColor: TColor read GetContentColor;
|
|
property IsContentTransparent: Boolean read GetIsContentTransparent;
|
|
property TransparentColor: TColor read GetTransparentColor;
|
|
end;
|
|
|
|
TdxPSLayoutStandardLookAndFeelProducer = class(TdxPSLayoutLookAndFeelProducer)
|
|
protected
|
|
function GetTransparentColor: TColor; override;
|
|
class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override;
|
|
public
|
|
function LayoutLookAndFeel: TdxLayoutStandardLookAndFeel; reintroduce; overload;
|
|
class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutOfficeLookAndFeelProducer = class(TdxPSLayoutStandardLookAndFeelProducer)
|
|
protected
|
|
class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override;
|
|
public
|
|
function LayoutLookAndFeel: TdxLayoutOfficeLookAndFeel; reintroduce; overload;
|
|
class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutWebLookAndFeelProducer = class(TdxPSLayoutLookAndFeelProducer)
|
|
protected
|
|
function GetGroupCaptionColor: TColor; override;
|
|
function GetTransparentColor: TColor; override;
|
|
procedure InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel); override;
|
|
class function ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass; override;
|
|
public
|
|
function LayoutLookAndFeel: TdxLayoutWebLookAndFeel; reintroduce; overload;
|
|
class function LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass; override;
|
|
|
|
property GroupCaptionColor;
|
|
property IsGroupCaptionTransparent;
|
|
end;
|
|
|
|
TdxPSCustomLayoutItemProducerClass = class of TdxPSCustomLayoutItemProducer;
|
|
|
|
TdxPSCustomLayoutItemProducer = class(TdxPSLayoutControlObjectProducer)
|
|
private
|
|
function GetLayoutItemBounds: TRect;
|
|
protected
|
|
function GetContentColor: TColor; virtual;
|
|
function GetIsContentTransparent: Boolean; virtual;
|
|
function GetLayoutLookAndFeel: TdxCustomLayoutLookAndFeel; virtual;
|
|
function GetLayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer;
|
|
|
|
procedure InitializeReportItem(AnItem: TdxReportCell); virtual;
|
|
class function ReportItemClass: TdxReportCellClass; virtual;
|
|
|
|
function OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent; reintroduce; overload;
|
|
|
|
procedure AdjustBounds; virtual;
|
|
procedure SaveOriginalItemSize;
|
|
public
|
|
function Definition: TdxPSCustomLayoutItemDefinition; reintroduce; overload;
|
|
class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override;
|
|
|
|
function LayoutItem: TdxCustomLayoutItem;
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; virtual;
|
|
|
|
class function PairClass: TClass; override;
|
|
function ProducingObjectFriendlyName: string; override;
|
|
procedure Reposition; override;
|
|
|
|
class procedure Register; override;
|
|
class procedure Unregister; override;
|
|
|
|
property ContentColor: TColor read GetContentColor;
|
|
property IsContentTransparent: Boolean read GetIsContentTransparent;
|
|
property LayoutItemBounds: TRect read GetLayoutItemBounds;
|
|
property LayoutLookAndFeel: TdxCustomLayoutLookAndFeel read GetLayoutLookAndFeel;
|
|
property LayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer read GetLayoutLookAndFeelProducer;
|
|
end;
|
|
|
|
TdxPSLayoutGroupProducer = class(TdxPSCustomLayoutItemProducer)
|
|
protected
|
|
function GetGroupCaptionContentColor: TColor; virtual;
|
|
function GetIsGroupCaptionTransparent: Boolean; virtual;
|
|
procedure InitializeReportItem(AnItem: TdxReportCell); override;
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
function Definition: TdxPSLayoutGroupDefinition; reintroduce; overload;
|
|
class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override;
|
|
|
|
function LayoutItem: TdxLayoutGroup;
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
|
|
function ProducingObjectFriendlyName: string; override;
|
|
procedure Reposition; override;
|
|
|
|
property GroupCaptionContentColor: TColor read GetGroupCaptionContentColor;
|
|
property IsGroupCaptionTransparent: Boolean read GetIsGroupCaptionTransparent;
|
|
end;
|
|
|
|
TdxPSLayoutBasicItemProducer = class(TdxPSCustomLayoutItemProducer)
|
|
protected
|
|
function GetContentColor: TColor; override;
|
|
procedure InitializeReportItem(AnItem: TdxReportCell); override;
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override;
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutEmptySpaceItemProducer = class(TdxPSLayoutBasicItemProducer)
|
|
public
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutDirectionalItemProducer = class(TdxPSLayoutBasicItemProducer);
|
|
|
|
TdxPSLayoutSeparatorItemProducer = class(TdxPSLayoutDirectionalItemProducer)
|
|
protected
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutSplitterItemProducer = class(TdxPSLayoutDirectionalItemProducer)
|
|
protected
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutCustomLabeledItemProducer = class(TdxPSLayoutBasicItemProducer);
|
|
|
|
TdxPSLayoutLabeledItemProducer = class(TdxPSLayoutCustomLabeledItemProducer)
|
|
protected
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override;
|
|
|
|
function LayoutItem: TdxLayoutLabeledItem;
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
end;
|
|
|
|
TdxPSLayoutItemProducer = class(TdxPSLayoutCustomLabeledItemProducer)
|
|
private
|
|
function GetControl: TControl;
|
|
function GetHasControl: Boolean;
|
|
protected
|
|
class function ReportItemClass: TdxReportCellClass; override;
|
|
public
|
|
constructor Create(AReportLink: TdxCustomContainerReportLink; AnObject: TComponent); override;
|
|
|
|
function Definition: TdxPSLayoutItemDefinition; reintroduce; overload;
|
|
class function DefinitionClass: TdxPSCustomContainerItemDefinitionClass; override;
|
|
|
|
function LayoutItem: TdxLayoutItem;
|
|
class function LayoutItemClass: TdxCustomLayoutItemClass; override;
|
|
|
|
function ProducingObjectFriendlyName: string; override;
|
|
procedure Reposition; override;
|
|
|
|
property Control: TControl read GetControl;
|
|
property HasControl: Boolean read GetHasControl;
|
|
end;
|
|
|
|
{ Caches }
|
|
|
|
TdxPSCustomLayoutObjectProducerCache = class(TdxPSContainerReportLinkCustomCache)
|
|
public
|
|
function ReportLink: TdxLayoutControlReportLink; reintroduce; overload;
|
|
end;
|
|
|
|
TdxPSLayoutItemProducerCache = class(TdxPSCustomLayoutObjectProducerCache)
|
|
private
|
|
function GetItem(Index: Integer): TdxPSCustomLayoutItemProducer;
|
|
function GetProducer(AProducerClass: TdxPSCustomLayoutItemProducerClass;
|
|
ALayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
protected
|
|
property Items[Index: Integer]: TdxPSCustomLayoutItemProducer read GetItem;
|
|
public
|
|
property Producers[AProducerClass: TdxPSCustomLayoutItemProducerClass;
|
|
ALayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetProducer; default;
|
|
end;
|
|
|
|
TdxPSLayoutLookAndFeelProducerCache = class(TdxPSCustomLayoutObjectProducerCache)
|
|
private
|
|
function GetItem(Index: Integer): TdxPSLayoutLookAndFeelProducer;
|
|
function GetProducer(AProducerClass: TdxPSLayoutLookAndFeelProducerClass;
|
|
ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer;
|
|
protected
|
|
property Items[Index: Integer]: TdxPSLayoutLookAndFeelProducer read GetItem;
|
|
public
|
|
property Producers[AProducerClass: TdxPSLayoutLookAndFeelProducerClass;
|
|
ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducer read GetProducer; default;
|
|
end;
|
|
|
|
TdxPSNativeLayoutControlProducer = class(TdxPSNativePrintableControlProducer)
|
|
public
|
|
function Control: TdxCustomLayoutControl; reintroduce; overload;
|
|
class function ControlClass: TControlClass; override;
|
|
|
|
class function HasNativeSupportForBorders: Boolean; override;
|
|
|
|
function ObjectExpandHeight: Boolean; override;
|
|
function ObjectExpandWidth: Boolean; override;
|
|
end;
|
|
|
|
TdxPSLayoutControlProducer = class(TdxPSRootContainerProducer)
|
|
private
|
|
function GetAvailableBounds: TRect;
|
|
function GetProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
protected
|
|
procedure CreateLayoutItems(AnItem: TdxReportVisualItem); virtual;
|
|
procedure GetLayoutItemList(AnItems: TList);
|
|
function HostClass: TdxReportCellClass; override;
|
|
procedure InitializeHost(ACell: TdxReportCell); override;
|
|
procedure InitializeItem(AnItem: TdxReportVisualItem); override;
|
|
function ItemClass: TdxReportVisualItemClass; override;
|
|
procedure ReportLinkInitializeItem(AnItem: TdxReportVisualItem);
|
|
|
|
property AvailableBounds: TRect read GetAvailableBounds;
|
|
property Producers[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetProducer;
|
|
public
|
|
class function CanHasAvailableChildren: Boolean; override;
|
|
class function Reenterable: Boolean; override;
|
|
|
|
function Control: TdxLayoutControl; reintroduce; overload;
|
|
class function ControlClass: TControlClass; override;
|
|
|
|
class function HasNativeSupportForBorders: Boolean; override;
|
|
|
|
function ObjectExpandHeight: Boolean; override;
|
|
function ObjectExpandWidth: Boolean; override;
|
|
|
|
function ReportLink: TdxLayoutControlReportLink; reintroduce; overload;
|
|
procedure Reposition; override;
|
|
end;
|
|
|
|
PdxPSLayoutCacheFontItem = ^TdxPSLayoutCacheFontItem;
|
|
TdxPSLayoutCacheFontItem = record
|
|
CaptionOptions: TdxLayoutLookAndFeelCaptionOptions;
|
|
FontIndex: Integer;
|
|
end;
|
|
|
|
{ Options }
|
|
|
|
TdxLayoutControlReportLinkOptionsBehaviorClass = class of TdxLayoutControlReportLinkOptionsBehavior;
|
|
|
|
TdxLayoutControlReportLinkOptionsBehavior = class(TdxCustomContainerReportLinkOptionsPagination)
|
|
private
|
|
FActiveTabToTop: Boolean;
|
|
FExpandGroups: Boolean;
|
|
FSkipEmptyGroups: Boolean;
|
|
FUnwrapTabs: Boolean;
|
|
procedure SetActiveTabToTop(Value: Boolean);
|
|
procedure SetExpandGroups(Value: Boolean);
|
|
procedure SetSkipEmptyGroups(Value: Boolean);
|
|
procedure SetUnwrapTabs(Value: Boolean);
|
|
public
|
|
procedure Assign(Source: TPersistent); override;
|
|
procedure RestoreDefaults; override;
|
|
published
|
|
property ActiveTabToTop: Boolean read FActiveTabToTop write SetActiveTabToTop default True;
|
|
property ExpandGroups: Boolean read FExpandGroups write SetExpandGroups default True;
|
|
property SkipEmptyGroups: Boolean read FSkipEmptyGroups write SetSkipEmptyGroups default True;
|
|
property UnwrapTabs: Boolean read FUnwrapTabs write SetUnwrapTabs default False;
|
|
end;
|
|
|
|
TdxLayoutControlReportLinkOptionsPaginationClass = class of TdxLayoutControlReportLinkOptionsPagination;
|
|
|
|
TdxLayoutControlReportLinkOptionsPagination = class(TdxCustomContainerReportLinkOptionsPagination)
|
|
private
|
|
FGroups: Boolean;
|
|
FItems: Boolean;
|
|
procedure SetGroups(Value: Boolean);
|
|
procedure SetItems(Value: Boolean);
|
|
public
|
|
procedure Assign(Source: TPersistent); override;
|
|
procedure RestoreDefaults; override;
|
|
published
|
|
property Groups: Boolean read FGroups write SetGroups default True;
|
|
property Items: Boolean read FItems write SetItems default True;
|
|
end;
|
|
|
|
TdxLayoutControlReportLinkOptionsSizeClass = class of TdxLayoutControlReportLinkOptionsSize;
|
|
|
|
TdxLayoutControlReportLinkOptionsSize = class(TdxCustomContainerReportLinkOptions)
|
|
private
|
|
FAutoWidth: Boolean;
|
|
procedure SetAutoWidth(Value: Boolean);
|
|
public
|
|
procedure Assign(Source: TPersistent); override;
|
|
procedure RestoreDefaults; override;
|
|
published
|
|
property AutoWidth: Boolean read FAutoWidth write SetAutoWidth default True;
|
|
end;
|
|
|
|
TdxLayoutControlReportLinkOptionsTransparent = class(TdxCustomContainerReportLinkOptionsTransparent)
|
|
private
|
|
FGroups: Boolean;
|
|
FItems: Boolean;
|
|
procedure SetGroups(Value: Boolean);
|
|
procedure SetItems(Value: Boolean);
|
|
public
|
|
procedure Assign(Source: TPersistent); override;
|
|
procedure RestoreDefaults; override;
|
|
published
|
|
property Groups: Boolean read FGroups write SetGroups default True;
|
|
property Items: Boolean read FItems write SetItems default True;
|
|
end;
|
|
|
|
{ Report Link }
|
|
|
|
TdxLayoutControlReportLink = class(TdxCustomContainerReportLink, IUnknown, IdxReportLinkController)
|
|
private
|
|
FCachedBounds: TList;
|
|
FCachedFonts: TList;
|
|
FCurrentLayoutItem: TdxCustomLayoutItem;
|
|
FLayoutItemProducerCache: TdxPSLayoutItemProducerCache;
|
|
FLayoutLookAndFeelProducerCache: TdxPSLayoutLookAndFeelProducerCache;
|
|
FOptionsBehavior: TdxLayoutControlReportLinkOptionsBehavior;
|
|
FOptionsSize: TdxLayoutControlReportLinkOptionsSize;
|
|
function GetAvailableBounds: TRect;
|
|
function GetCachedBoundsCount: Integer;
|
|
function GetCachedBoundsItem(Index: Integer): TdxLCBoundsCacheItem;
|
|
function GetCachedFontItem(Index: Integer): PdxPSLayoutCacheFontItem;
|
|
function GetCachedFontItemCount: Integer;
|
|
function GetCurrentHost: TdxReportCell;
|
|
function GetLayoutControl: TdxLayoutControl;
|
|
function GetLayoutItemProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
function GetLayoutLookAndFeelProducer(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer;
|
|
function GetOptionsPagination: TdxLayoutControlReportLinkOptionsPagination;
|
|
function GetOptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent;
|
|
function GetRootLayoutGroup: TdxLayoutGroup;
|
|
procedure SetOptionsBehavior(Value: TdxLayoutControlReportLinkOptionsBehavior);
|
|
procedure SetOptionsPagination(Value: TdxLayoutControlReportLinkOptionsPagination);
|
|
procedure SetOptionsSize(Value: TdxLayoutControlReportLinkOptionsSize);
|
|
procedure SetOptionsTransparent(Value: TdxLayoutControlReportLinkOptionsTransparent);
|
|
protected
|
|
function GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean; override;
|
|
procedure InternalRestoreDefaults; override;
|
|
|
|
procedure CacheControlsBounds;
|
|
procedure ConstructReport(AReportCells: TdxReportCells); override;
|
|
procedure PostCheckEmbeddedControls;
|
|
procedure PrepareConstruct; override;
|
|
procedure PrepareLookAndFeels;
|
|
procedure RepositionControls; override;
|
|
|
|
procedure AddHiddenItem(ATreeView: TTreeView; AParent: TTreeNode; AnItem: TdxCustomLayoutItem);
|
|
procedure AddItem(ATreeView: TTreeView; AParent: TTreeNode; AnItem: TdxCustomLayoutItem);
|
|
function IsComponentEditable(AComponent: TComponent): Boolean; override;
|
|
procedure LoadControlsTree(ATreeView: TTreeView); override;
|
|
procedure LoadHiddenControlsTree(ATreeView: TTreeView); override;
|
|
function AddBoundsToCache(AComponent: TComponent; const ABounds: TRect): Integer;
|
|
function AddCaptionOptionsFontToCache(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer;
|
|
procedure ClearCachedBounds;
|
|
procedure ClearCachedFonts;
|
|
function FindBoundsByComponent(AComponent: TComponent; var ABounds: TRect; ASetEmbedded: Boolean): Boolean;
|
|
function FindFontIndexByCaptionOptions(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer;
|
|
procedure FreeAndNilCachedBounds;
|
|
procedure FreeAndNilCachedFonts;
|
|
|
|
procedure CreateOptions; override;
|
|
procedure DestroyOptions; override;
|
|
function GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass; override;
|
|
function GetOptionsSizeClass: TdxLayoutControlReportLinkOptionsSizeClass; virtual;
|
|
function GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass; override;
|
|
|
|
function FindReportGroupLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSReportGroupLookAndFeel;
|
|
function FindReportItemByLayoutItem(ALayoutItem: TdxCustomLayoutItem): TdxReportCell;
|
|
procedure GetLayoutItemList(AControl: TdxLayoutControl; AnItems: TList);
|
|
function GetPreparedFontIndex(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer; overload;
|
|
// IdxReportLinkController
|
|
function GetControlSiteBounds(AControl: TControl): TRect; virtual;
|
|
|
|
procedure AdjustLayoutBounds(const R: TRect);
|
|
|
|
property AvailableBounds: TRect read GetAvailableBounds;
|
|
property CachedBoundsCount: Integer read GetCachedBoundsCount;
|
|
property CachedBoundsItem[Index: Integer]: TdxLCBoundsCacheItem read GetCachedBoundsItem;
|
|
property CachedBounds: TList read FCachedBounds;
|
|
|
|
property CachedFontItemCount: Integer read GetCachedFontItemCount;
|
|
property CachedFontItems[Index: Integer]: PdxPSLayoutCacheFontItem read GetCachedFontItem;
|
|
property CachedFonts: TList read FCachedFonts;
|
|
|
|
property CurrentHost: TdxReportCell read GetCurrentHost;
|
|
property CurrentLayoutItem: TdxCustomLayoutItem read FCurrentLayoutItem Write FCurrentLayoutItem;
|
|
property LayoutItemProducerCache: TdxPSLayoutItemProducerCache read FLayoutItemProducerCache;
|
|
property LayoutItemProducers[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducer read GetLayoutItemProducer;
|
|
property LayoutLookAndFeelProducerCache: TdxPSLayoutLookAndFeelProducerCache read FLayoutLookAndFeelProducerCache;
|
|
property LayoutLookAndFeelProducers[LayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducer read GetLayoutLookAndFeelProducer;
|
|
property RootLayoutGroup: TdxLayoutGroup read GetRootLayoutGroup;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
destructor Destroy; override;
|
|
|
|
class function Aggregable: Boolean; override;
|
|
|
|
property LayoutControl: TdxLayoutControl read GetLayoutControl;
|
|
published
|
|
property OptionsBehavior: TdxLayoutControlReportLinkOptionsBehavior read FOptionsBehavior write SetOptionsBehavior;
|
|
property OptionsPagination: TdxLayoutControlReportLinkOptionsPagination read GetOptionsPagination write SetOptionsPagination;
|
|
property OptionsSize: TdxLayoutControlReportLinkOptionsSize read FOptionsSize write SetOptionsSize;
|
|
property OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent read GetOptionsTransparent write SetOptionsTransparent;
|
|
end;
|
|
|
|
{ Design Window }
|
|
|
|
TdxPSLayoutControlDesignWindow = class(TdxfmCustomContainerDesignWindow)
|
|
private
|
|
function GetLayoutReportLink: TdxLayoutControlReportLink;
|
|
protected
|
|
procedure DoInitialize; override;
|
|
|
|
procedure SetOptionsGroupsByIndex(AnIndex: Integer; AValue: Boolean); override;
|
|
procedure SetOptionsPaginationByIndex(AnIndex: Integer; AValue: Boolean); override;
|
|
procedure SetOptionsSizeByIndex(AnIndex: Integer; AValue: Boolean); override;
|
|
procedure SetOptionsTabsByIndex(AnIndex: Integer; AValue: Boolean); override;
|
|
procedure SetOptionsTransparentByIndex(AnIndex: Integer; AValue: Boolean); override;
|
|
|
|
procedure InitializeControlsTree; override;
|
|
procedure InitializeHiddenControlsTree; override;
|
|
function IsBoldNode(ANode: TTreeNode): Boolean; override;
|
|
public
|
|
property LayoutReportLink: TdxLayoutControlReportLink read GetLayoutReportLink;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
{$IFDEF DELPHI6} Variants, {$ENDIF} SysUtils, StdCtrls, Forms, cxClasses,
|
|
dxPSGlbl, dxPSRes, dxPSUtl, dxLayoutControlAdapters, cxControls, ImgList,
|
|
Types;
|
|
|
|
const
|
|
LayoutBorderStyleMap: array[TdxLayoutBorderStyle] of TdxPSCellBorderClass =
|
|
(TdxPSCellNullBorder, TdxPSCellUltraFlatBorder, TdxPSCellSunkenSoftBorder, TdxPSCellSunkenBorder);
|
|
LayoutCaptionAlignHorzMap: array[TAlignment] of TcxTextAlignX = (taLeft, taRight, taCenterX);
|
|
LayoutCaptionAlignVertMap: array[TdxAlignmentVert] of TcxTextAlignY = (taTop, taCenterY, taBottom);
|
|
LayoutGroupCaptionAlignHorzMap: array[TAlignment] of TcxTextAlignX = (taLeft, taRight, taCenterX);
|
|
|
|
type
|
|
TcxControlAccess = class(TcxControl);
|
|
TdxCustomContainerReportLinkAccess = class(TdxCustomContainerReportLink);
|
|
TdxCustomLayoutControlAccess = class(TdxCustomLayoutControl);
|
|
TdxLayoutCustomLabeledItemAccess = class(TdxLayoutCustomLabeledItem);
|
|
TdxCustomLayoutItemAccess = class(TdxCustomLayoutItem);
|
|
TdxCustomLayoutLookAndFeelAccess = class(TdxCustomLayoutLookAndFeel);
|
|
TdxLayoutControlViewInfoAccess = class(TdxLayoutControlViewInfo);
|
|
TdxLayoutItemAccess = class(TdxLayoutItem);
|
|
TdxCustomLayoutItemViewInfoAccess = class(TdxCustomLayoutItemViewInfo);
|
|
TdxCustomLayoutItemCaptionViewInfoAccess = class(TdxCustomLayoutItemCaptionViewInfo);
|
|
TdxCustomLayoutItemCaptionOptionsAccess = class(TdxCustomLayoutItemCaptionOptions);
|
|
TdxCustomLayoutItemImageOptionsAccess = class(TdxCustomLayoutItemImageOptions);
|
|
|
|
{ Helpers }
|
|
|
|
function GetLayoutItemRelativeBounds(ALayoutItem: TdxCustomLayoutItem): TRect;
|
|
|
|
function LayoutControl: TdxCustomLayoutControlAccess;
|
|
begin
|
|
Result := TdxCustomLayoutControlAccess(ALayoutItem.Container);
|
|
end;
|
|
|
|
function ScrollLeft: Integer;
|
|
begin
|
|
Result := LayoutControl.HScrollBar.Position;
|
|
end;
|
|
|
|
function ScrollTop: Integer;
|
|
begin
|
|
Result := LayoutControl.VScrollBar.Position;
|
|
end;
|
|
|
|
function ParentLeft: Integer;
|
|
begin
|
|
Result := ALayoutItem.Parent.ViewInfo.Bounds.Left;
|
|
end;
|
|
|
|
function ParentTop: Integer;
|
|
begin
|
|
Result := ALayoutItem.Parent.ViewInfo.Bounds.Top;
|
|
end;
|
|
|
|
begin
|
|
if ALayoutItem.ViewInfo <> nil then
|
|
begin
|
|
Result := ALayoutItem.ViewInfo.Bounds;
|
|
if ALayoutItem.IsRoot or ALayoutItem.Parent.IsRoot then
|
|
OffsetRect(Result, ScrollLeft, ScrollTop)
|
|
else
|
|
OffsetRect(Result, -ParentLeft, -ParentTop);
|
|
end
|
|
else
|
|
Result := cxNullRect;
|
|
end;
|
|
|
|
{ Factories }
|
|
|
|
type
|
|
TdxPSLayoutItemProducerFactory = class(TdxCustomClassMaps)
|
|
private
|
|
function GetProducerClass(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducerClass;
|
|
public
|
|
class function Instance: TdxPSLayoutItemProducerFactory; reintroduce; overload;
|
|
property ProducerClasses[LayoutItem: TdxCustomLayoutItem]: TdxPSCustomLayoutItemProducerClass read GetProducerClass; default;
|
|
end;
|
|
|
|
TdxPSLayoutLookAndFeelProducerFactory = class(TdxCustomClassMaps)
|
|
private
|
|
function GetProducerClass(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducerClass;
|
|
public
|
|
class function Instance: TdxPSLayoutLookAndFeelProducerFactory; reintroduce; overload;
|
|
property ProducerClasses[LayoutLookAndFeel: TdxCustomLayoutLookAndFeel]: TdxPSLayoutLookAndFeelProducerClass read GetProducerClass; default;
|
|
end;
|
|
|
|
{ TdxPSLayoutItemProducerFactory }
|
|
|
|
function dxPSLayoutItemProducerFactory: TdxPSLayoutItemProducerFactory;
|
|
begin
|
|
Result := TdxPSLayoutItemProducerFactory.Instance;
|
|
end;
|
|
|
|
class function TdxPSLayoutItemProducerFactory.Instance: TdxPSLayoutItemProducerFactory;
|
|
begin
|
|
Result := inherited Instance as TdxPSLayoutItemProducerFactory;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducerFactory.GetProducerClass(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducerClass;
|
|
begin
|
|
Result := TdxPSCustomLayoutItemProducerClass(PairClasses[LayoutItem.ClassType]);
|
|
end;
|
|
|
|
{ TdxPSLayoutLookAndFeelProducerFactory }
|
|
|
|
function dxPSLayoutLookAndFeelProducerFactory: TdxPSLayoutLookAndFeelProducerFactory;
|
|
begin
|
|
Result := TdxPSLayoutLookAndFeelProducerFactory.Instance;
|
|
end;
|
|
|
|
class function TdxPSLayoutLookAndFeelProducerFactory.Instance: TdxPSLayoutLookAndFeelProducerFactory;
|
|
begin
|
|
Result := inherited Instance as TdxPSLayoutLookAndFeelProducerFactory;
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducerFactory.GetProducerClass(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducerClass;
|
|
begin
|
|
Result := TdxPSLayoutLookAndFeelProducerClass(PairClasses[LayoutLookAndFeel.ClassType]);
|
|
end;
|
|
|
|
{ TdxReportLayoutControlHost }
|
|
|
|
function TdxReportLayoutControlHost.GetControlItem: TdxReportVisualItem;
|
|
begin
|
|
if CellCount <> 0 then
|
|
Result := Cells[0]
|
|
else
|
|
Result := nil;
|
|
end;
|
|
|
|
{ TdxReportCaptionTextCell }
|
|
|
|
function TdxReportLayoutCaptionTextCell.GetDefaultDTFormat: DWORD;
|
|
begin
|
|
Result := inherited GetDefaultDTFormat;
|
|
Result := Result and not CXTO_AUTOINDENTS;
|
|
end;
|
|
|
|
{ TdxReportCustomLayoutCaptionCell }
|
|
|
|
procedure TdxReportCustomLayoutCaptionCell.AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF});
|
|
begin
|
|
BoundsRect := CaptionBounds;
|
|
if HasTextItem then
|
|
TextItem.BoundsRect := TextBounds;
|
|
if HasImageItem then
|
|
ImageItem.BoundsRect := ImageBounds;
|
|
end;
|
|
|
|
procedure TdxReportCustomLayoutCaptionCell.Initialize(ALayoutItem: TdxCustomLayoutItem; AReportLink: TdxLayoutControlReportLink);
|
|
begin
|
|
Data := Integer(ALayoutItem);
|
|
BoundsRect := CaptionBounds;
|
|
Transparent := True;
|
|
CellSides := [];
|
|
if IsTextVisible then
|
|
FTextItem := CreateTextCell(AReportLink);
|
|
if IsImageVisible then
|
|
FImageItem := CreateImageCell(AReportLink);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.CreateImageCell(AReportLink: TdxLayoutControlReportLink): TdxReportCellImage;
|
|
var
|
|
ABitmap: TBitmap;
|
|
AImageIndex: Integer;
|
|
AImageList: TCustomImageList;
|
|
begin
|
|
Result := TdxReportCellImage.Create(Self);
|
|
with Result do
|
|
begin
|
|
Transparent := True;
|
|
BoundsRect := ImageBounds;
|
|
CellSides := [];
|
|
ImageLayout := ilImageCenterCenter;
|
|
ImageTransparent := True;
|
|
TdxCustomLayoutItemImageOptionsAccess(ImageOptions).GetCurrentImage(ABitmap, AImageList, AImageIndex);
|
|
Image := ABitmap;
|
|
ImageList := AImageList;
|
|
ImageIndex := AImageIndex;
|
|
end;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell;
|
|
begin
|
|
Result := TdxReportLayoutCaptionTextCell.Create(Self);
|
|
with Result do
|
|
begin
|
|
BoundsRect := TextBounds;
|
|
CellSides := [];
|
|
HidePrefix := True;
|
|
Transparent := True;
|
|
TextAlignX := LayoutCaptionAlignHorzMap[CaptionOptions.AlignHorz];
|
|
Text := LayoutItem.Caption;
|
|
HidePrefix := True;
|
|
Multiline := False;
|
|
TextAlignY := taTop;
|
|
end;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.IsImageVisible: Boolean;
|
|
begin
|
|
Result := TdxCustomLayoutItemAccess(LayoutItem).IsImageVisible;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.IsTextVisible: Boolean;
|
|
begin
|
|
Result := TdxCustomLayoutItemAccess(LayoutItem).IsTextVisible;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetLayoutItem: TdxCustomLayoutItem;
|
|
begin
|
|
Result := TdxCustomLayoutItem(Data);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetCaptionBounds: TRect;
|
|
begin
|
|
Result := LayoutItem.ViewInfo.CaptionViewInfo.Bounds;
|
|
with LayoutItem.ViewInfo.Bounds do
|
|
OffsetRect(Result, -Left, -Top);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetCaptionOptions: TdxCustomLayoutItemCaptionOptions;
|
|
begin
|
|
Result := LayoutItem.CaptionOptions;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetHasImageItem: Boolean;
|
|
begin
|
|
Result := (ImageItem <> nil) and (IndexOf(ImageItem) > -1);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetHasTextItem: Boolean;
|
|
begin
|
|
Result := (TextItem <> nil) and (IndexOf(TextItem) > -1);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetImageBounds: TRect;
|
|
begin
|
|
Result := LayoutItem.ViewInfo.CaptionViewInfo.ImageAreaBounds;
|
|
with LayoutItem.ViewInfo.CaptionViewInfo.Bounds do
|
|
OffsetRect(Result, -Left, -Top);
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetImageOptions: TdxCustomLayoutItemImageOptions;
|
|
begin
|
|
Result := TdxCustomLayoutItemCaptionOptionsAccess(CaptionOptions).ImageOptions;
|
|
end;
|
|
|
|
function TdxReportCustomLayoutCaptionCell.GetTextBounds: TRect;
|
|
begin
|
|
Result := LayoutItem.ViewInfo.CaptionViewInfo.TextAreaBounds;
|
|
with LayoutItem.ViewInfo.CaptionViewInfo.Bounds do
|
|
OffsetRect(Result, -Left, -Top);
|
|
end;
|
|
|
|
{ TdxCustomReportLayoutItem }
|
|
|
|
procedure TdxCustomReportLayoutItem.AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF});
|
|
begin
|
|
BoundsRect := LayoutItemBounds;
|
|
if HasCaptionItem then
|
|
CaptionItem.AdjustBounds({$IFDEF PS4}ACanvas{$ELSE}DC{$ENDIF});
|
|
end;
|
|
|
|
procedure TdxCustomReportLayoutItem.Initialize(AReportLink: TdxLayoutControlReportLink);
|
|
begin
|
|
if NeedCreateCaptionCell(AReportLink) then
|
|
FCaptionItem := CreateCaptionCell(AReportLink);
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.CaptionCellClass: TdxReportCustomLayoutCaptionCellClass;
|
|
begin
|
|
Result := TdxReportCustomLayoutCaptionCell;
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.CreateCaptionCell(AReportLink: TdxLayoutControlReportLink): TdxReportCustomLayoutCaptionCell;
|
|
begin
|
|
Result := CaptionCellClass.Create(Self);
|
|
Result.Initialize(LayoutItem, AReportLink);
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.IsCaptionVisible: Boolean;
|
|
begin
|
|
Result := TdxCustomLayoutItemViewInfoAccess(LayoutItem.ViewInfo).HasCaption;
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean;
|
|
begin
|
|
Result := IsCaptionVisible;
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.GetHasCaptionItem: Boolean;
|
|
begin
|
|
Result := (CaptionItem <> nil) and (IndexOf(CaptionItem) > -1);
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.GetLayoutItem: TdxCustomLayoutItem;
|
|
begin
|
|
Result := TdxCustomLayoutItem(Data);
|
|
end;
|
|
|
|
function TdxCustomReportLayoutItem.GetLayoutItemBounds: TRect;
|
|
begin
|
|
Result := GetLayoutItemRelativeBounds(LayoutItem);
|
|
end;
|
|
|
|
{ TdxReportLayoutGroupCaptionCell }
|
|
|
|
function TdxReportLayoutGroupCaptionCell.CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell;
|
|
begin
|
|
Result := inherited CreateTextCell(AReportLink);
|
|
with AReportLink.LayoutItemProducers[LayoutItem].LayoutLookAndFeel.GroupOptions do
|
|
Result.FontIndex := AReportLink.FindFontIndexByCaptionOptions(CaptionOptions);
|
|
Result.AdjustFont := True;
|
|
end;
|
|
|
|
{ TdxPSReportLayoutGroupStandardLookAndFeelPainter }
|
|
|
|
procedure TdxPSReportLayoutGroupStandardLookAndFeelPainter.DrawCaptionText({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF});
|
|
begin
|
|
end;
|
|
|
|
function TdxPSReportLayoutGroupStandardLookAndFeelPainter.LookAndFeel: TdxPSReportLayoutGroupStandardLookAndFeel;
|
|
begin
|
|
Result := inherited LookAndFeel as TdxPSReportLayoutGroupStandardLookAndFeel;
|
|
end;
|
|
|
|
{ TdxPSReportLayoutGroupStandardLookAndFeel }
|
|
|
|
function TdxPSReportLayoutGroupStandardLookAndFeel.GetCaptionHeight(AGroup: TdxReportGroup): Integer;
|
|
var
|
|
R: TRect;
|
|
begin
|
|
R := GetCaptionTextBounds(AGroup);
|
|
InflateRect(R, 0, R.Top);
|
|
Result := cxRectHeight(R);
|
|
end;
|
|
|
|
function TdxPSReportLayoutGroupStandardLookAndFeel.GetCaptionTextBounds(AGroup: TdxReportGroup): TRect;
|
|
var
|
|
ALayoutGroup: TdxReportLayoutGroup;
|
|
begin
|
|
Result := cxNullRect;
|
|
ALayoutGroup := AGroup as TdxReportLayoutGroup;
|
|
if ALayoutGroup.HasCaptionItem then
|
|
Result := ALayoutGroup.CaptionItem.BoundsRect;
|
|
end;
|
|
|
|
class function TdxPSReportLayoutGroupStandardLookAndFeel.GetPainterClass: TdxPSReportGroupLookAndFeelPainterClass;
|
|
begin
|
|
Result := TdxPSReportLayoutGroupStandardLookAndFeelPainter;
|
|
end;
|
|
|
|
{ TdxPSReportLayoutGroupOfficeLookAndFeel }
|
|
|
|
class function TdxPSReportLayoutGroupOfficeLookAndFeel.DefaultBorderSides: TdxCellSides;
|
|
begin
|
|
Result := TdxPSReportGroupOfficeLookAndFeel.DefaultBorderSides;
|
|
end;
|
|
|
|
class function TdxPSReportLayoutGroupOfficeLookAndFeel.Name: string;
|
|
begin
|
|
Result := TdxPSReportGroupOfficeLookAndFeel.Name;
|
|
end;
|
|
|
|
function TdxPSReportLayoutGroupOfficeLookAndFeel.GetCaptionIndent: Integer;
|
|
begin
|
|
Result := 0;
|
|
end;
|
|
|
|
{ TdxReportLayoutGroup }
|
|
|
|
function TdxReportLayoutGroup.CaptionCellClass: TdxReportCustomLayoutCaptionCellClass;
|
|
begin
|
|
Result := TdxReportLayoutGroupCaptionCell;
|
|
end;
|
|
|
|
{ TdxReportLayoutDirectionalItem }
|
|
|
|
procedure TdxReportLayoutDirectionalItem.AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF});
|
|
begin
|
|
inherited;
|
|
if HasSeparatorItem then
|
|
SeparatorItem.BoundsRect := SeparatorBounds;
|
|
end;
|
|
|
|
procedure TdxReportLayoutDirectionalItem.Initialize(AReportLink: TdxLayoutControlReportLink);
|
|
begin
|
|
inherited;
|
|
FSeparatorItem := CreateSeparatorCell(AReportLink);
|
|
end;
|
|
|
|
function TdxReportLayoutDirectionalItem.NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean;
|
|
begin
|
|
Result := False;
|
|
end;
|
|
|
|
function TdxReportLayoutDirectionalItem.CreateSeparatorCell(AReportLink: TdxLayoutControlReportLink): TdxReportCell;
|
|
const
|
|
CellSidesMap: array[Boolean] of TdxCellSides = ([csTop], [csLeft]);
|
|
begin
|
|
Result := TdxReportCell.Create(Self);
|
|
with Result do
|
|
begin
|
|
BoundsRect := SeparatorBounds;
|
|
Transparent := True;
|
|
CellSides := CellSidesMap[LayoutItem.IsVertical];
|
|
end;
|
|
end;
|
|
|
|
function TdxReportLayoutDirectionalItem.GetHasSeparatorItem: Boolean;
|
|
begin
|
|
Result := (SeparatorItem <> nil) and (IndexOf(SeparatorItem) > -1);
|
|
end;
|
|
|
|
function TdxReportLayoutDirectionalItem.GetLayoutItem: TdxLayoutDirectionalItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutDirectionalItem;
|
|
end;
|
|
|
|
function TdxReportLayoutDirectionalItem.GetSeparatorBounds: TRect;
|
|
begin
|
|
Result := LayoutItem.ViewInfo.Bounds;
|
|
with LayoutItem.ViewInfo.Bounds do
|
|
OffsetRect(Result, -Left, -Top);
|
|
if LayoutItem.IsVertical then
|
|
OffsetRect(Result, Result.Right div 2, 0)
|
|
else
|
|
OffsetRect(Result, 0, Result.Bottom div 2);
|
|
end;
|
|
|
|
{ TdxReportLayoutLabeledItemCaptionCell }
|
|
|
|
function TdxReportLayoutLabeledItemCaptionCell.CreateTextCell(AReportLink: TdxLayoutControlReportLink): TdxReportLayoutCaptionTextCell;
|
|
begin
|
|
Result := inherited CreateTextCell(AReportLink);
|
|
// todo: ? Result.TextAlignY := LayoutCaptionAlignVertMap[CaptionOptions.AlignVert];
|
|
Result.Multiline := CaptionOptions.Width <> 0;
|
|
with AReportLink.LayoutItemProducers[LayoutItem].LayoutLookAndFeel.ItemOptions do
|
|
Result.FontIndex := AReportLink.FindFontIndexByCaptionOptions(CaptionOptions);
|
|
Result.AdjustFont := True;
|
|
end;
|
|
|
|
function TdxReportLayoutLabeledItemCaptionCell.GetCaptionOptions: TdxLayoutLabeledItemCaptionOptions;
|
|
begin
|
|
Result := inherited CaptionOptions as TdxLayoutLabeledItemCaptionOptions;
|
|
end;
|
|
|
|
{ TdxReportLayoutLabeledItem }
|
|
|
|
function TdxReportLayoutLabeledItem.CaptionCellClass: TdxReportCustomLayoutCaptionCellClass;
|
|
begin
|
|
Result := TdxReportLayoutLabeledItemCaptionCell;
|
|
end;
|
|
|
|
function TdxReportLayoutLabeledItem.GetLayoutItem: TdxLayoutCustomLabeledItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutCustomLabeledItem;
|
|
end;
|
|
|
|
{ TdxReportLayoutItem }
|
|
|
|
function TdxReportLayoutItem.LayoutItem: TdxLayoutItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutItem;
|
|
end;
|
|
|
|
procedure TdxReportLayoutItem.AdjustBounds({$IFDEF PS4}ACanvas: TdxPSReportRenderCustomCanvas{$ELSE}DC: HDC{$ENDIF});
|
|
begin
|
|
inherited;
|
|
if HasControlItem then
|
|
ControlItem.BoundsRect := ControlBounds;
|
|
end;
|
|
|
|
function TdxReportLayoutItem.CreateControlCell(AReportLink: TdxLayoutControlReportLink): TdxReportVisualItem;
|
|
|
|
function LayoutItemProducer: TdxPSCustomLayoutItemProducer;
|
|
begin
|
|
Result := AReportLink.LayoutItemProducers[LayoutItem];
|
|
end;
|
|
|
|
function HasBorder(AControl: TWinControl): Boolean;
|
|
var
|
|
V: Variant;
|
|
begin
|
|
Result := csFramed in Control.ControlStyle;
|
|
if not Result and AControl.HandleAllocated then
|
|
Result := (GetWindowLong(AControl.Handle, GWL_STYLE) and WS_BORDER = WS_BORDER) or
|
|
(GetWindowLong(AControl.Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE = WS_EX_CLIENTEDGE);
|
|
if not Result and dxPSUtl.HasProperty(AControl, 'BorderStyle') then
|
|
begin
|
|
V := dxPSUtl.GetProperty(AControl, 'BorderStyle');
|
|
Result := not VarIsNull(V) and (V <> Forms.bsNone);
|
|
end;
|
|
end;
|
|
|
|
const
|
|
CellSidesMap: array[Boolean] of TdxCellSides = ([], csAll);
|
|
begin
|
|
if Control is TWinControl then
|
|
begin
|
|
Result := AReportLink.ActiveBuilder.BuildNestedContainer(TWinControl(Control), Self);
|
|
if not AReportLink.Producers[Control].HasNativeSupportForBorders then
|
|
with LayoutItemProducer.LayoutLookAndFeel.ItemOptions do
|
|
begin
|
|
TdxReportWinControlHost(Result).ControlItem.BorderClass := LayoutBorderStyleMap[ControlBorderStyle];
|
|
TdxReportWinControlHost(Result).ControlItem.BorderColor := ControlBorderColor;
|
|
if not (TdxReportWinControlHost(Result).ControlItem is TdxReportCellGraphic) then
|
|
TdxReportWinControlHost(Result).ControlItem.CellSides := CellSidesMap[LayoutItem.ControlOptions.ShowBorder or HasBorder(TWinControl(Control))];
|
|
end;
|
|
end
|
|
else
|
|
Result := AReportLink.ActiveBuilder.BuildControl(Control, Self);
|
|
|
|
Result.BoundsRect := ControlBounds;
|
|
Result.CellSides := [];
|
|
end;
|
|
|
|
procedure TdxReportLayoutItem.Initialize(AReportLink: TdxLayoutControlReportLink);
|
|
begin
|
|
inherited;
|
|
if NeedCreateControlCell(AReportLink) then
|
|
FControlItem := CreateControlCell(AReportLink);
|
|
end;
|
|
|
|
function TdxReportLayoutItem.NeedCreateCaptionCell(AReportLink: TdxLayoutControlReportLink): Boolean;
|
|
begin
|
|
with TdxLayoutItemAccess(LayoutItem) do
|
|
Result := inherited NeedCreateCaptionCell(AReportLink) and (not HasControl or AReportLink.DoIsComponentProcessed(Control));
|
|
end;
|
|
|
|
function TdxReportLayoutItem.NeedCreateControlCell(AReportLink: TdxLayoutControlReportLink): Boolean;
|
|
begin
|
|
Result := TdxLayoutItemAccess(LayoutItem).HasControl and AReportLink.DoIsComponentProcessed(Control);
|
|
end;
|
|
|
|
function TdxReportLayoutItem.GetAdapter: TdxCustomLayoutControlAdapter;
|
|
begin
|
|
Result := TdxLayoutItemAccess(LayoutItem).ControlAdapter;
|
|
end;
|
|
|
|
function TdxReportLayoutItem.GetControl: TControl;
|
|
begin
|
|
Result := LayoutItem.Control;
|
|
end;
|
|
|
|
function TdxReportLayoutItem.GetControlBounds: TRect;
|
|
begin
|
|
with LayoutItem do
|
|
begin
|
|
Result := ViewInfo.ControlViewInfo.ControlBounds;
|
|
with ViewInfo.Bounds do
|
|
OffsetRect(Result, -Left, -Top);
|
|
end;
|
|
end;
|
|
|
|
function TdxReportLayoutItem.GetHasControlItem: Boolean;
|
|
begin
|
|
Result := (ControlItem <> nil) and (IndexOf(ControlItem) > -1);
|
|
end;
|
|
|
|
function TdxReportLayoutItem.GetIsControlAccessible: Boolean;
|
|
begin
|
|
Result := (LayoutItem.Control <> nil) and LayoutItem.Control.Visible;
|
|
end;
|
|
|
|
{ TdxPSCustomLayoutItemDefinition }
|
|
|
|
function TdxPSCustomLayoutItemDefinition.OptionsPagination: TdxLayoutControlReportLinkOptionsPagination;
|
|
begin
|
|
Result := inherited OptionsPagination as TdxLayoutControlReportLinkOptionsPagination;
|
|
end;
|
|
|
|
{$IFDEF PS4}
|
|
procedure TdxPSCustomLayoutItemDefinition.AdjustBounds(ACanvas: TdxPSReportRenderCustomCanvas);
|
|
begin
|
|
ReportItem.AdjustBounds(ACanvas);
|
|
end;
|
|
{$ELSE}
|
|
procedure TdxPSCustomLayoutItemDefinition.AdjustBounds(DC: HDC);
|
|
begin
|
|
ReportItem.AdjustBounds(DC);
|
|
end;
|
|
{$ENDIF}
|
|
|
|
procedure TdxPSCustomLayoutItemDefinition.SaveOriginalItemSize;
|
|
begin
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemDefinition.SetupOriginalControlSize;
|
|
begin
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemDefinition.GetLayoutItem: TdxCustomLayoutItem;
|
|
begin
|
|
Result := Component as TdxCustomLayoutItem;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemDefinition.GetReportItem: TdxCustomReportLayoutItem;
|
|
begin
|
|
Result := inherited ReportItem as TdxCustomReportLayoutItem;
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemDefinition.SetLayoutItem(Value: TdxCustomLayoutItem);
|
|
begin
|
|
Component := Value;
|
|
end;
|
|
|
|
{ TdxPSLayoutGroupDefinition }
|
|
|
|
procedure TdxPSLayoutGroupDefinition.AddDelimitersHorz(AList: TList);
|
|
begin
|
|
inherited;
|
|
if OptionsPagination.Groups then AddReportItemToDelimitersHorz(AList);
|
|
end;
|
|
|
|
procedure TdxPSLayoutGroupDefinition.AddDelimitersVert(AList: TList);
|
|
begin
|
|
inherited;
|
|
if OptionsPagination.Groups then AddReportItemToDelimitersVert(AList);
|
|
end;
|
|
|
|
function TdxPSLayoutGroupDefinition.GetLayoutItem: TdxLayoutGroup;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutGroup;
|
|
end;
|
|
|
|
{ TdxPSLayoutBasicItemDefinition }
|
|
|
|
procedure TdxPSLayoutBasicItemDefinition.AddDelimitersHorz(AList: TList);
|
|
begin
|
|
inherited;
|
|
if OptionsPagination.Items then AddReportItemToDelimitersHorz(AList);
|
|
end;
|
|
|
|
procedure TdxPSLayoutBasicItemDefinition.AddDelimitersVert(AList: TList);
|
|
begin
|
|
inherited;
|
|
if OptionsPagination.Items then AddReportItemToDelimitersVert(AList);
|
|
end;
|
|
|
|
{ TdxPSLayoutItemDefinition }
|
|
|
|
constructor TdxPSLayoutItemDefinition.Create(AReportLink: TdxCustomContainerReportLink; AComponent: TComponent; AReportItem: TdxReportVisualItem);
|
|
begin
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxPSLayoutItemDefinition.SaveOriginalItemSize;
|
|
begin
|
|
with TdxLayoutItemAccess(LayoutItem) do
|
|
if Control <> nil then SaveOriginalControlSize;
|
|
end;
|
|
|
|
procedure TdxPSLayoutItemDefinition.SetupOriginalControlSize;
|
|
begin
|
|
with ReportItem do
|
|
if HasControlItem then
|
|
LayoutItem.OriginalControlSize := Point(ControlItem.Width, ControlItem.Height);
|
|
end;
|
|
|
|
function TdxPSLayoutItemDefinition.GetLayoutItem: TdxLayoutItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutItem;
|
|
end;
|
|
|
|
function TdxPSLayoutItemDefinition.GetReportItem: TdxReportLayoutItem;
|
|
begin
|
|
Result := inherited ReportItem as TdxReportLayoutItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutControlObjectProducer }
|
|
|
|
function TdxPSLayoutControlObjectProducer.ReportLink: TdxLayoutControlReportLink;
|
|
begin
|
|
Result := inherited ReportLink as TdxLayoutControlReportLink;
|
|
end;
|
|
|
|
function TdxPSLayoutControlObjectProducer.RootContainer: TdxLayoutControl;
|
|
begin
|
|
Result := inherited RootContainer as TdxLayoutControl;
|
|
end;
|
|
|
|
{ TdxPSLayoutLookAndFeelProducer }
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.LayoutLookAndFeel: TdxCustomLayoutLookAndFeel;
|
|
begin
|
|
Result := inherited ProducingObject as TdxCustomLayoutLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass;
|
|
begin
|
|
Result := TdxCustomLayoutLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutLookAndFeelProducer.PairClass: TClass;
|
|
begin
|
|
Result := LayoutLookAndFeelClass;
|
|
end;
|
|
|
|
class procedure TdxPSLayoutLookAndFeelProducer.Register;
|
|
begin
|
|
dxPSLayoutLookAndFeelProducerFactory.Register(Self);
|
|
end;
|
|
|
|
class procedure TdxPSLayoutLookAndFeelProducer.Unregister;
|
|
begin
|
|
dxPSLayoutLookAndFeelProducerFactory.Unregister(Self);
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.GetContentColor: TColor;
|
|
begin
|
|
Result := LayoutLookAndFeel.GroupOptions.GetColor;
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.GetGroupCaptionColor: TColor;
|
|
begin
|
|
Result := LayoutLookAndFeel.GroupOptions.GetColor;
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.GetIsContentTransparent: Boolean;
|
|
begin
|
|
Result := ColorToRGB(ContentColor) = ColorToRGB(TransparentColor);
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.GetIsGroupCaptionTransparent: Boolean;
|
|
begin
|
|
Result := ColorToRGB(GroupCaptionColor) = ColorToRGB(TransparentColor);
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducer.GetTransparentColor: TColor;
|
|
begin
|
|
Result := clDefault;
|
|
end;
|
|
|
|
procedure TdxPSLayoutLookAndFeelProducer.InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel);
|
|
begin
|
|
ALookAndFeel.Color := LayoutLookAndFeel.GroupOptions.GetColor;
|
|
ALookAndFeel.Data := LayoutLookAndFeel;
|
|
ALookAndFeel.FontIndex := ReportLink.FindFontIndexByCaptionOptions(LayoutLookAndFeel.GroupOptions.CaptionOptions);
|
|
ALookAndFeel.CaptionFontIndex := ALookAndFeel.FontIndex;
|
|
end;
|
|
|
|
class function TdxPSLayoutLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass;
|
|
begin
|
|
Result := TdxPSReportLayoutGroupStandardLookAndFeel;
|
|
end;
|
|
|
|
{ TdxPSLayoutStandardLookAndFeelProducer }
|
|
|
|
function TdxPSLayoutStandardLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutStandardLookAndFeel;
|
|
begin
|
|
Result := inherited LayoutLookAndFeel as TdxLayoutStandardLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutStandardLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass;
|
|
begin
|
|
Result := TdxLayoutStandardLookAndFeel;
|
|
end;
|
|
|
|
function TdxPSLayoutStandardLookAndFeelProducer.GetTransparentColor: TColor;
|
|
begin
|
|
Result := clBtnFace;
|
|
end;
|
|
|
|
class function TdxPSLayoutStandardLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass;
|
|
begin
|
|
Result := TdxPSReportLayoutGroupStandardLookAndFeel;
|
|
end;
|
|
|
|
{ TdxPSLayoutOfficeLookAndFeelProducer }
|
|
|
|
function TdxPSLayoutOfficeLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutOfficeLookAndFeel;
|
|
begin
|
|
Result := inherited LayoutLookAndFeel as TdxLayoutOfficeLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutOfficeLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass;
|
|
begin
|
|
Result := TdxLayoutOfficeLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutOfficeLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass;
|
|
begin
|
|
Result := TdxPSReportLayoutGroupOfficeLookAndFeel;
|
|
end;
|
|
|
|
{ TdxPSLayoutWebLookAndFeelProducer }
|
|
|
|
function TdxPSLayoutWebLookAndFeelProducer.LayoutLookAndFeel: TdxLayoutWebLookAndFeel;
|
|
begin
|
|
Result := inherited LayoutLookAndFeel as TdxLayoutWebLookAndFeel;
|
|
end;
|
|
|
|
class function TdxPSLayoutWebLookAndFeelProducer.LayoutLookAndFeelClass: TdxCustomLayoutLookAndFeelClass;
|
|
begin
|
|
Result := TdxLayoutWebLookAndFeel;
|
|
end;
|
|
|
|
function TdxPSLayoutWebLookAndFeelProducer.GetGroupCaptionColor: TColor;
|
|
begin
|
|
Result := LayoutLookAndFeel.GroupOptions.CaptionOptions.GetColor;
|
|
end;
|
|
|
|
function TdxPSLayoutWebLookAndFeelProducer.GetTransparentColor: TColor;
|
|
begin
|
|
Result := clWindow;
|
|
end;
|
|
|
|
procedure TdxPSLayoutWebLookAndFeelProducer.InitializeReportLookAndFeel(ALookAndFeel: TdxPSReportGroupLookAndFeel);
|
|
begin
|
|
inherited;
|
|
with TdxPSReportGroupWebLookAndFeel(ALookAndFeel) do
|
|
begin
|
|
BorderThickness := LayoutLookAndFeel.GroupOptions.FrameWidth;
|
|
BorderColor := LayoutLookAndFeel.GroupOptions.GetFrameColor;
|
|
CaptionColor := LayoutLookAndFeel.GroupOptions.CaptionOptions.GetColor;
|
|
CaptionSeparatorColor := LayoutLookAndFeel.GroupOptions.GetFrameColor;
|
|
CaptionSeparatorThickness := LayoutLookAndFeel.GroupOptions.CaptionOptions.SeparatorWidth;
|
|
end;
|
|
end;
|
|
|
|
class function TdxPSLayoutWebLookAndFeelProducer.ReportLookAndFeelClass: TdxPSReportGroupLookAndFeelClass;
|
|
begin
|
|
Result := TdxPSReportGroupWebLookAndFeel;
|
|
end;
|
|
|
|
{ TdxPSCustomLayoutItemProducer }
|
|
|
|
function TdxPSCustomLayoutItemProducer.Definition: TdxPSCustomLayoutItemDefinition;
|
|
begin
|
|
Result := inherited Definition as TdxPSCustomLayoutItemDefinition;
|
|
end;
|
|
|
|
class function TdxPSCustomLayoutItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass;
|
|
begin
|
|
Result := TdxPSCustomLayoutItemDefinition;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.LayoutItem: TdxCustomLayoutItem;
|
|
begin
|
|
Result := inherited ProducingObject as TdxCustomLayoutItem;
|
|
end;
|
|
|
|
class function TdxPSCustomLayoutItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxCustomLayoutItem;
|
|
end;
|
|
|
|
class function TdxPSCustomLayoutItemProducer.PairClass: TClass;
|
|
begin
|
|
Result := LayoutItemClass;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.ProducingObjectFriendlyName: string;
|
|
begin
|
|
Result := '';
|
|
if not IsDesigning then
|
|
Result := LayoutItem.Caption;
|
|
if Result = '' then
|
|
Result := inherited ProducingObjectFriendlyName;
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemProducer.Reposition;
|
|
begin
|
|
end;
|
|
|
|
class procedure TdxPSCustomLayoutItemProducer.Register;
|
|
begin
|
|
inherited;
|
|
dxPSLayoutItemProducerFactory.Register(Self);
|
|
end;
|
|
|
|
class procedure TdxPSCustomLayoutItemProducer.Unregister;
|
|
begin
|
|
if Self <> TdxPSCustomLayoutItemProducer then
|
|
dxPSLayoutItemProducerFactory.Unregister(Self);
|
|
inherited;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.GetContentColor: TColor;
|
|
begin
|
|
Result := LayoutLookAndFeelProducer.ContentColor;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.GetIsContentTransparent: Boolean;
|
|
begin
|
|
Result := LayoutLookAndFeelProducer.IsContentTransparent;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.GetLayoutLookAndFeel: TdxCustomLayoutLookAndFeel;
|
|
begin
|
|
Result := LayoutItem.ViewInfo.LayoutLookAndFeel;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.GetLayoutLookAndFeelProducer: TdxPSLayoutLookAndFeelProducer;
|
|
begin
|
|
Result := ReportLink.LayoutLookAndFeelProducers[LayoutLookAndFeel];
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemProducer.InitializeReportItem(AnItem: TdxReportCell);
|
|
begin
|
|
AnItem.BoundsRect := LayoutItemBounds;
|
|
AnItem.CellSides := [];
|
|
AnItem.Color := ContentColor;
|
|
AnItem.Data := Integer(LayoutItem);
|
|
//AnItem.ExcludeFromClipRgn := True;
|
|
AnItem.Transparent := False;
|
|
ReportLink.CreateItemDefinition(LayoutItem, AnItem);
|
|
(AnItem as TdxCustomReportLayoutItem).Initialize(ReportLink);
|
|
end;
|
|
|
|
class function TdxPSCustomLayoutItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxCustomReportLayoutItem;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.OptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent;
|
|
begin
|
|
Result := inherited OptionsTransparent as TdxLayoutControlReportLinkOptionsTransparent;
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemProducer.AdjustBounds;
|
|
begin
|
|
Definition.AdjustBounds({$IFDEF PS4}Canvas{$ELSE}DC{$ENDIF});
|
|
end;
|
|
|
|
procedure TdxPSCustomLayoutItemProducer.SaveOriginalItemSize;
|
|
begin
|
|
Definition.SaveOriginalItemSize;
|
|
end;
|
|
|
|
function TdxPSCustomLayoutItemProducer.GetLayoutItemBounds: TRect;
|
|
begin
|
|
Result := GetLayoutItemRelativeBounds(LayoutItem);
|
|
end;
|
|
|
|
{ TdxPSLayoutGroupProducer }
|
|
|
|
function TdxPSLayoutGroupProducer.Definition: TdxPSLayoutGroupDefinition;
|
|
begin
|
|
Result := inherited Definition as TdxPSLayoutGroupDefinition;
|
|
end;
|
|
|
|
class function TdxPSLayoutGroupProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass;
|
|
begin
|
|
Result := TdxPSLayoutGroupDefinition;
|
|
end;
|
|
|
|
function TdxPSLayoutGroupProducer.ProducingObjectFriendlyName: string;
|
|
begin
|
|
Result := '';
|
|
if not IsDesigning then
|
|
Result := LayoutItem.Caption;
|
|
if Result = '' then
|
|
Result := cxGetResourceString(@sdxLayoutGroupDefaultCaption);
|
|
end;
|
|
|
|
procedure TdxPSLayoutGroupProducer.Reposition;
|
|
begin
|
|
end;
|
|
|
|
function TdxPSLayoutGroupProducer.LayoutItem: TdxLayoutGroup;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutGroup;
|
|
end;
|
|
|
|
class function TdxPSLayoutGroupProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutGroup;
|
|
end;
|
|
|
|
function TdxPSLayoutGroupProducer.GetGroupCaptionContentColor: TColor;
|
|
begin
|
|
Result := LayoutLookAndFeelProducer.GroupCaptionColor;
|
|
end;
|
|
|
|
function TdxPSLayoutGroupProducer.GetIsGroupCaptionTransparent: Boolean;
|
|
begin
|
|
Result := LayoutLookAndFeelProducer.IsGroupCaptionTransparent;
|
|
end;
|
|
|
|
procedure TdxPSLayoutGroupProducer.InitializeReportItem(AnItem: TdxReportCell);
|
|
begin
|
|
inherited;
|
|
with TdxReportLayoutGroup(AnItem) do
|
|
begin
|
|
LookAndFeel := Self.ReportLink.FindReportGroupLookAndFeel(LayoutLookAndFeel);
|
|
Transparent := OptionsTransparent.Groups;
|
|
CellSides := [];
|
|
|
|
if TdxCustomLayoutItemViewInfoAccess(LayoutItem.ViewInfo).HasBorder then
|
|
CellSides := LookAndFeel.DefaultBorderSides;
|
|
|
|
CalculateCaptionTextWidth({$IFDEF PS4}Canvas{$ELSE}DC{$ENDIF});
|
|
end;
|
|
end;
|
|
|
|
class function TdxPSLayoutGroupProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutGroup;
|
|
end;
|
|
|
|
{ TdxPSLayoutBasicItemProducer }
|
|
|
|
class function TdxPSLayoutBasicItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass;
|
|
begin
|
|
Result := TdxPSLayoutBasicItemDefinition;
|
|
end;
|
|
|
|
class function TdxPSLayoutBasicItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutBasicItem;
|
|
end;
|
|
|
|
function TdxPSLayoutBasicItemProducer.GetContentColor: TColor;
|
|
begin
|
|
Result := ReportLink.LayoutLookAndFeelProducers[LayoutItem.ViewInfo.LayoutLookAndFeel].ContentColor;
|
|
end;
|
|
|
|
procedure TdxPSLayoutBasicItemProducer.InitializeReportItem(AnItem: TdxReportCell);
|
|
begin
|
|
inherited;
|
|
AnItem.Transparent := OptionsTransparent.Items;
|
|
end;
|
|
|
|
class function TdxPSLayoutBasicItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutBasicItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutEmptySpaceItemProducer }
|
|
|
|
class function TdxPSLayoutEmptySpaceItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutEmptySpaceItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutSeparatorItemProducer }
|
|
|
|
class function TdxPSLayoutSeparatorItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutSeparatorItem;
|
|
end;
|
|
|
|
class function TdxPSLayoutSeparatorItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutSeparatorItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutSplitterItemProducer }
|
|
|
|
class function TdxPSLayoutSplitterItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutSplitterItem;
|
|
end;
|
|
|
|
class function TdxPSLayoutSplitterItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutSplitterItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutLabeledItemProducer }
|
|
|
|
class function TdxPSLayoutLabeledItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass;
|
|
begin
|
|
Result := TdxPSLayoutLabeledItemDefinition;
|
|
end;
|
|
|
|
function TdxPSLayoutLabeledItemProducer.LayoutItem: TdxLayoutLabeledItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutLabeledItem;
|
|
end;
|
|
|
|
class function TdxPSLayoutLabeledItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutLabeledItem;
|
|
end;
|
|
|
|
class function TdxPSLayoutLabeledItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutLabeledItem;
|
|
end;
|
|
|
|
{ TdxPSLayoutItemProducer }
|
|
|
|
constructor TdxPSLayoutItemProducer.Create(AReportLink: TdxCustomContainerReportLink; AnObject: TComponent);
|
|
begin
|
|
inherited;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducer.Definition: TdxPSLayoutItemDefinition;
|
|
begin
|
|
Result := inherited Definition as TdxPSLayoutItemDefinition;
|
|
end;
|
|
|
|
class function TdxPSLayoutItemProducer.DefinitionClass: TdxPSCustomContainerItemDefinitionClass;
|
|
begin
|
|
Result := TdxPSLayoutItemDefinition;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducer.LayoutItem: TdxLayoutItem;
|
|
begin
|
|
Result := inherited LayoutItem as TdxLayoutItem;
|
|
end;
|
|
|
|
class function TdxPSLayoutItemProducer.LayoutItemClass: TdxCustomLayoutItemClass;
|
|
begin
|
|
Result := TdxLayoutItem;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducer.ProducingObjectFriendlyName: string;
|
|
begin
|
|
Result := '';
|
|
if not IsDesigning then
|
|
Result := LayoutItem.Caption;
|
|
if Result = '' then
|
|
Result := cxGetResourceString(@sdxLayoutItemDefaultCaption);
|
|
Result := dxPSUtl.DropColon(Result);
|
|
end;
|
|
|
|
procedure TdxPSLayoutItemProducer.Reposition;
|
|
begin
|
|
if HasControl then
|
|
begin
|
|
ReportLink.Producers[Control].Reposition;
|
|
Definition.SetupOriginalControlSize;
|
|
end;
|
|
end;
|
|
|
|
class function TdxPSLayoutItemProducer.ReportItemClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutItem;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducer.GetControl: TControl;
|
|
begin
|
|
Result := LayoutItem.Control;
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducer.GetHasControl: Boolean;
|
|
begin
|
|
Result := (Control <> nil) and Control.Visible;
|
|
end;
|
|
|
|
{ TdxPSCustomLayoutObjectProducerCache }
|
|
|
|
function TdxPSCustomLayoutObjectProducerCache.ReportLink: TdxLayoutControlReportLink;
|
|
begin
|
|
Result := inherited ReportLink as TdxLayoutControlReportLink;
|
|
end;
|
|
|
|
{ TdxPSLayoutItemProducerCache }
|
|
|
|
function TdxPSLayoutItemProducerCache.GetItem(Index: Integer): TdxPSCustomLayoutItemProducer;
|
|
begin
|
|
Result := TdxPSCustomLayoutItemProducer(inherited Items[Index]);
|
|
end;
|
|
|
|
function TdxPSLayoutItemProducerCache.GetProducer(AProducerClass: TdxPSCustomLayoutItemProducerClass;
|
|
ALayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
var
|
|
Index: Integer;
|
|
begin
|
|
Index := IndexOfByClass(AProducerClass);
|
|
if Index = -1 then
|
|
Index := Add(AProducerClass.Create(ReportLink, ALayoutItem));
|
|
Result := Items[Index];
|
|
Result.Initialize(ALayoutItem);
|
|
end;
|
|
|
|
{ TdxPSLayoutLookAndFeelProducerCache }
|
|
|
|
function TdxPSLayoutLookAndFeelProducerCache.GetItem(Index: Integer): TdxPSLayoutLookAndFeelProducer;
|
|
begin
|
|
Result := TdxPSLayoutLookAndFeelProducer(inherited Items[Index]);
|
|
end;
|
|
|
|
function TdxPSLayoutLookAndFeelProducerCache.GetProducer(AProducerClass: TdxPSLayoutLookAndFeelProducerClass;
|
|
ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer;
|
|
var
|
|
Index: Integer;
|
|
begin
|
|
Index := IndexOfByClass(AProducerClass);
|
|
if Index = -1 then
|
|
Index := Add(AProducerClass.Create(ReportLink, ALayoutLookAndFeel));
|
|
Result := Items[Index];
|
|
Result.Initialize(ALayoutLookAndFeel);
|
|
end;
|
|
|
|
{ TdxPSNativeLayoutControlProducer }
|
|
|
|
class function TdxPSNativeLayoutControlProducer.HasNativeSupportForBorders: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxPSNativeLayoutControlProducer.ObjectExpandHeight: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxPSNativeLayoutControlProducer.ObjectExpandWidth: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxPSNativeLayoutControlProducer.Control: TdxCustomLayoutControl;
|
|
begin
|
|
Result := inherited Control as TdxCustomLayoutControl;
|
|
end;
|
|
|
|
class function TdxPSNativeLayoutControlProducer.ControlClass: TControlClass;
|
|
begin
|
|
Result := TdxCustomLayoutControl;
|
|
end;
|
|
|
|
{ TdxPSLayoutControlProducer }
|
|
|
|
class function TdxPSLayoutControlProducer.CanHasAvailableChildren: Boolean;
|
|
begin
|
|
Result := False;
|
|
end;
|
|
|
|
class function TdxPSLayoutControlProducer.Reenterable: Boolean;
|
|
begin
|
|
Result := False;
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.Control: TdxLayoutControl;
|
|
begin
|
|
Result := inherited Control as TdxLayoutControl;
|
|
end;
|
|
|
|
class function TdxPSLayoutControlProducer.ControlClass: TControlClass;
|
|
begin
|
|
Result := TdxCustomLayoutControl;
|
|
end;
|
|
|
|
class function TdxPSLayoutControlProducer.HasNativeSupportForBorders: Boolean;
|
|
begin
|
|
Result := False;
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.ObjectExpandHeight: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.ObjectExpandWidth: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.ReportLink: TdxLayoutControlReportLink;
|
|
begin
|
|
Result := inherited ReportLink as TdxLayoutControlReportLink;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.Reposition;
|
|
|
|
procedure CalculateViewInfo;
|
|
begin
|
|
Control.ViewInfo.Calculate;
|
|
end;
|
|
|
|
procedure SetupOriginalControlSize(AnItems: TList);
|
|
var
|
|
I, Index: Integer;
|
|
Item: TdxCustomLayoutItem;
|
|
begin
|
|
for I := 0 to AnItems.Count - 1 do
|
|
begin
|
|
Item := AnItems[I];
|
|
if ReportLink.IsComponentProcessed(Item) then
|
|
if (Item is TdxLayoutGroup) or ReportLink.FindDefinition(TdxLayoutItem(Item).Control, Index) then
|
|
Producers[Item].Reposition
|
|
else
|
|
else
|
|
Item.Visible := False;
|
|
end;
|
|
CalculateViewInfo;
|
|
end;
|
|
|
|
procedure UpdateItemsBounds(AnItems: TList);
|
|
var
|
|
I: Integer;
|
|
Item: TdxCustomLayoutItem;
|
|
begin
|
|
for I := 0 to AnItems.Count - 1 do
|
|
begin
|
|
Item := AnItems[I];
|
|
if ReportLink.IsComponentProcessed(Item) then
|
|
Producers[Item].AdjustBounds;
|
|
end;
|
|
end;
|
|
|
|
procedure RestoreOriginalControlSize(AnItems: TList);
|
|
var
|
|
I: Integer;
|
|
Item: TdxCustomLayoutItem;
|
|
begin
|
|
for I := 0 to AnItems.Count - 1 do
|
|
begin
|
|
Item := AnItems[I];
|
|
Item.Visible := True;
|
|
if ReportLink.IsComponentProcessed(Item) then
|
|
Producers[Item].SaveOriginalItemSize;
|
|
end;
|
|
CalculateViewInfo;
|
|
end;
|
|
|
|
var
|
|
Items: TList;
|
|
Cell: TdxReportCell;
|
|
begin
|
|
Control.BeginUpdate;
|
|
try
|
|
ReportLink.AdjustLayoutBounds(AvailableBounds);
|
|
Items := TList.Create;
|
|
try
|
|
GetLayoutItemList(Items);
|
|
SetupOriginalControlSize(Items);
|
|
try
|
|
UpdateItemsBounds(Items);
|
|
finally
|
|
RestoreOriginalControlSize(Items);
|
|
end;
|
|
finally
|
|
Items.Free;
|
|
end;
|
|
finally
|
|
ReportLink.AdjustLayoutBounds(cxNullRect);
|
|
Control.EndUpdate;
|
|
end;
|
|
|
|
with TdxReportCell(Definition.SizeChangeReportItem) do
|
|
begin
|
|
Cell := Cells[0].Cells[0];
|
|
|
|
Cells[0].Height := Cell.Height;
|
|
Cells[0].Width := Cell.Width;
|
|
|
|
Height := Cell.Height;
|
|
Width := Cell.Width;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.CreateLayoutItems(AnItem: TdxReportVisualItem);
|
|
|
|
function CreateReportItem(AParent: TdxReportCell; ALayoutItem: TdxCustomLayoutItem): TdxReportCell;
|
|
begin
|
|
ReportLink.CurrentLayoutItem := ALayoutItem;
|
|
try
|
|
with Producers[ALayoutItem] do
|
|
begin
|
|
Result := ReportItemClass.Create(AParent);
|
|
InitializeReportItem(Result);
|
|
end;
|
|
ReportLinkInitializeItem(Result);
|
|
finally
|
|
ReportLink.CurrentLayoutItem := nil;
|
|
end;
|
|
end;
|
|
|
|
procedure ProduceItem(AParent: TdxReportCell; ALayoutItem: TdxCustomLayoutItem);
|
|
var
|
|
I: Integer;
|
|
LayoutItem: TdxCustomLayoutItem;
|
|
begin
|
|
AParent := CreateReportItem(AParent, ALayoutItem);
|
|
if ALayoutItem is TdxLayoutGroup then
|
|
with TdxLayoutGroup(ALayoutItem) do
|
|
for I := 0 to VisibleCount - 1 do
|
|
begin
|
|
LayoutItem := VisibleItems[I];
|
|
if not LayoutItem.ActuallyVisible then Continue;
|
|
if ReportLink.DoIsComponentProcessed(LayoutItem) then
|
|
ProduceItem(AParent, LayoutItem);
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
ProduceItem(TdxReportCell(AnItem), Control.Items); // Root is always processed
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.GetLayoutItemList(AnItems: TList);
|
|
begin
|
|
ReportLink.GetLayoutItemList(Control, AnItems);
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.HostClass: TdxReportCellClass;
|
|
begin
|
|
Result := TdxReportLayoutControlHost;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.InitializeHost(ACell: TdxReportCell);
|
|
begin
|
|
inherited;
|
|
ACell.Height := Control.ViewInfo.ContentHeight;
|
|
ACell.Width := Control.ViewInfo.ContentWidth;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.InitializeItem(AnItem: TdxReportVisualItem);
|
|
begin
|
|
inherited;
|
|
AnItem.BorderClass := TdxPSCellNullBorder;
|
|
AnItem.Height := Control.ViewInfo.ContentHeight;
|
|
AnItem.Width := Control.ViewInfo.ContentWidth;
|
|
AnItem.CellSides := [];
|
|
AnItem.Transparent := True;
|
|
|
|
CreateLayoutItems(AnItem);
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.ItemClass: TdxReportVisualItemClass;
|
|
begin
|
|
Result := TdxReportCell;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlProducer.ReportLinkInitializeItem(AnItem: TdxReportVisualItem);
|
|
begin
|
|
ReportLink.DoInitializeItem(AnItem);
|
|
ReportLink.DoInitializeItemOptionsPlace(AnItem);
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.GetAvailableBounds: TRect;
|
|
begin
|
|
Result := ReportLink.AvailableBounds;
|
|
end;
|
|
|
|
function TdxPSLayoutControlProducer.GetProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
begin
|
|
Result := ReportLink.LayoutItemProducers[LayoutItem];
|
|
end;
|
|
|
|
{ TdxLayoutControlReportLinkOptionsBehavior }
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.Assign(Source: TPersistent);
|
|
begin
|
|
inherited;
|
|
if Source is TdxLayoutControlReportLinkOptionsBehavior then
|
|
with TdxLayoutControlReportLinkOptionsBehavior(Source) do
|
|
begin
|
|
Self.ActiveTabToTop := ActiveTabToTop;
|
|
Self.ExpandGroups := ExpandGroups;
|
|
Self.SkipEmptyGroups := SkipEmptyGroups;
|
|
Self.UnwrapTabs := UnwrapTabs;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.RestoreDefaults;
|
|
begin
|
|
inherited;
|
|
ActiveTabToTop := True;
|
|
ExpandGroups := True;
|
|
SkipEmptyGroups := True;
|
|
UnwrapTabs := False;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.SetActiveTabToTop(Value: Boolean);
|
|
begin
|
|
if ActiveTabToTop <> Value then
|
|
begin
|
|
FActiveTabToTop := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.SetExpandGroups(Value: Boolean);
|
|
begin
|
|
if ExpandGroups <> Value then
|
|
begin
|
|
FExpandGroups := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.SetSkipEmptyGroups(Value: Boolean);
|
|
begin
|
|
if SkipEmptyGroups <> Value then
|
|
begin
|
|
FSkipEmptyGroups := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsBehavior.SetUnwrapTabs(Value: Boolean);
|
|
begin
|
|
if UnwrapTabs <> Value then
|
|
begin
|
|
FUnwrapTabs := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
{ TdxLayoutControlReportLinkOptionsPagination }
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsPagination.Assign(Source: TPersistent);
|
|
begin
|
|
inherited;
|
|
if Source is TdxLayoutControlReportLinkOptionsPagination then
|
|
with TdxLayoutControlReportLinkOptionsPagination(Source) do
|
|
begin
|
|
Self.Groups := Groups;
|
|
Self.Items := Items;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsPagination.RestoreDefaults;
|
|
begin
|
|
inherited;
|
|
Controls := False;
|
|
Groups := True;
|
|
Items := True;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsPagination.SetGroups(Value: Boolean);
|
|
begin
|
|
if FGroups <> Value then
|
|
begin
|
|
FGroups := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsPagination.SetItems(Value: Boolean);
|
|
begin
|
|
if FItems <> Value then
|
|
begin
|
|
FItems := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
{ TdxLayoutControlReportLinkOptionsSize }
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsSize.Assign(Source: TPersistent);
|
|
begin
|
|
if Source is TdxLayoutControlReportLinkOptionsSize then
|
|
AutoWidth := TdxLayoutControlReportLinkOptionsSize(Source).AutoWidth;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsSize.RestoreDefaults;
|
|
begin
|
|
inherited;
|
|
AutoWidth := True;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsSize.SetAutoWidth(Value: Boolean);
|
|
begin
|
|
if FAutoWidth <> Value then
|
|
begin
|
|
FAutoWidth := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
{ TdxLayoutControlReportLinkOptionsTransparent }
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsTransparent.Assign(Source: TPersistent);
|
|
begin
|
|
inherited;
|
|
if Source is TdxLayoutControlReportLinkOptionsTransparent then
|
|
with TdxLayoutControlReportLinkOptionsTransparent(Source) do
|
|
begin
|
|
Self.Groups := Groups;
|
|
Self.Items := Items;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsTransparent.RestoreDefaults;
|
|
begin
|
|
Groups := True;
|
|
Items := True;
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsTransparent.SetGroups(Value: Boolean);
|
|
begin
|
|
if FGroups <> Value then
|
|
begin
|
|
FGroups := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLinkOptionsTransparent.SetItems(Value: Boolean);
|
|
begin
|
|
if FItems <> Value then
|
|
begin
|
|
FItems := Value;
|
|
Changed;
|
|
end;
|
|
end;
|
|
|
|
{ TdxLayoutControlReportLink }
|
|
|
|
constructor TdxLayoutControlReportLink.Create(AOwner: TComponent);
|
|
begin
|
|
inherited;
|
|
FCachedFonts := TList.Create;
|
|
FCachedBounds := TList.Create;
|
|
FLayoutItemProducerCache := TdxPSLayoutItemProducerCache.Create(Self);
|
|
FLayoutLookAndFeelProducerCache := TdxPSLayoutLookAndFeelProducerCache.Create(Self);
|
|
FOptionsBehavior := TdxLayoutControlReportLinkOptionsBehavior.Create(Self);
|
|
end;
|
|
|
|
destructor TdxLayoutControlReportLink.Destroy;
|
|
begin
|
|
FreeAndNil(FOptionsBehavior);
|
|
FreeAndNil(FLayoutLookAndFeelProducerCache);
|
|
FreeAndNil(FLayoutItemProducerCache);
|
|
FreeAndNilCachedFonts;
|
|
FreeAndNilCachedBounds;
|
|
inherited;
|
|
end;
|
|
|
|
class function TdxLayoutControlReportLink.Aggregable: Boolean;
|
|
begin
|
|
Result := True;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetRebuildOnPageParamsChange(AUpdateCodes: TdxPrinterPageUpdateCodes): Boolean;
|
|
begin
|
|
Result := ([ucMarginLeft, ucMarginRight] * AUpdateCodes <> []) and OptionsSize.AutoWidth;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.InternalRestoreDefaults;
|
|
begin
|
|
inherited;
|
|
OptionsSize.RestoreDefaults;
|
|
OptionsBehavior.RestoreDefaults;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.CacheControlsBounds;
|
|
|
|
procedure EnumItems(AGroup: TdxLayoutGroupViewInfo);
|
|
var
|
|
I: Integer;
|
|
ControlViewInfo: TdxLayoutItemControlViewInfo;
|
|
begin
|
|
for I := 0 to AGroup.ItemViewInfoCount - 1 do
|
|
if AGroup.ItemViewInfos[I] is TdxLayoutItemViewInfo then
|
|
begin
|
|
ControlViewInfo := TdxLayoutItemViewInfo(AGroup.ItemViewInfos[I]).ControlViewInfo;
|
|
if ControlViewInfo <> nil then
|
|
AddBoundsToCache(ControlViewInfo.Control, ControlViewInfo.ControlBounds);
|
|
end
|
|
else
|
|
if AGroup.ItemViewInfos[I] is TdxLayoutGroupViewInfo then
|
|
EnumItems(TdxLayoutGroupViewInfo(AGroup.ItemViewInfos[I]))
|
|
end;
|
|
|
|
begin
|
|
AdjustLayoutBounds(AvailableBounds);
|
|
try
|
|
EnumItems(LayoutControl.ViewInfo.ItemsViewInfo);
|
|
finally
|
|
AdjustLayoutBounds(cxNullRect);
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.ConstructReport(AReportCells: TdxReportCells);
|
|
var
|
|
AList: TcxObjectList;
|
|
|
|
procedure StoreItemStates;
|
|
|
|
procedure StoreItemState(AItem: TdxCustomLayoutItem);
|
|
var
|
|
ACacheItem: TdxLayoutItemChacheState;
|
|
I: Integer;
|
|
AGroup: TdxLayoutGroup;
|
|
begin
|
|
ACacheItem := TdxLayoutItemChacheState.Create;
|
|
with ACacheItem do
|
|
begin
|
|
Item := AItem;
|
|
Index := AItem.Index;
|
|
Visible := AItem.Visible;
|
|
if AItem is TdxLayoutGroup then
|
|
begin
|
|
AGroup := AItem as TdxLayoutGroup;
|
|
Direction := AGroup.LayoutDirection;
|
|
Expanded := AGroup.Expanded;
|
|
ItemIndex := AGroup.ItemIndex;
|
|
for I := 0 to AGroup.Count - 1 do
|
|
StoreItemState(AGroup[I]);
|
|
end;
|
|
end;
|
|
AList.Add(ACacheItem);
|
|
end;
|
|
|
|
begin
|
|
StoreItemState(LayoutControl.Items);
|
|
end;
|
|
|
|
procedure SetItemStates;
|
|
|
|
procedure SetItemState(AItem: TdxCustomLayoutItem);
|
|
var
|
|
AGroup: TdxLayoutGroup;
|
|
I: Integer;
|
|
begin
|
|
if AItem is TdxLayoutGroup then
|
|
begin
|
|
AGroup := AItem as TdxLayoutGroup;
|
|
if OptionsBehavior.ExpandGroups then
|
|
AGroup.Expanded := True;
|
|
if AGroup.LayoutDirection = ldTabbed then
|
|
begin
|
|
AGroup.LayoutDirection := ldVertical;
|
|
if not OptionsBehavior.UnwrapTabs then
|
|
for I := 0 to AGroup.Count - 1 do
|
|
if AGroup[I].Visible and (AGroup.ItemIndex <> AGroup[I].Index) then
|
|
AGroup[I].Visible := False;
|
|
if OptionsBehavior.ActiveTabToTop then
|
|
AGroup.Items[AGroup.ItemIndex].Index := 0;
|
|
end;
|
|
if OptionsBehavior.SkipEmptyGroups then
|
|
for I := 0 to AGroup.VisibleCount - 1 do
|
|
if (AGroup.VisibleItems[I] is TdxLayoutGroup) and ((AGroup.VisibleItems[I] as TdxLayoutGroup).VisibleCount = 0) then
|
|
AGroup.VisibleItems[I].Visible := False;
|
|
for I := 0 to AGroup.VisibleCount - 1 do
|
|
SetItemState(AGroup.VisibleItems[I]);
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
SetItemState(LayoutControl.Items);
|
|
TdxCustomLayoutItemAccess(LayoutControl.Items).BeforeCalculateViewInfo;
|
|
LayoutControl.ViewInfo.Calculate;
|
|
TdxCustomLayoutItemAccess(LayoutControl.Items).AfterCalculateViewInfo;
|
|
end;
|
|
|
|
procedure RestoreItemStates;
|
|
var
|
|
I: Integer;
|
|
ACacheItem: TdxLayoutItemChacheState;
|
|
AItem: TdxCustomLayoutItem;
|
|
AGroup: TdxLayoutGroup;
|
|
begin
|
|
for I := 0 to AList.Count - 1 do
|
|
begin
|
|
ACacheItem := AList[I] as TdxLayoutItemChacheState;
|
|
AItem := ACacheItem.Item;
|
|
AItem.Index := ACacheItem.Index;
|
|
AItem.Visible := ACacheItem.Visible;
|
|
if AItem is TdxLayoutGroup then
|
|
begin
|
|
AGroup := AItem as TdxLayoutGroup;
|
|
AGroup.LayoutDirection := ACacheItem.Direction;
|
|
AGroup.Expanded := ACacheItem.Expanded;
|
|
AGroup.ItemIndex := ACacheItem.ItemIndex;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
AList := TcxObjectList.Create;
|
|
LayoutControl.BeginUpdate;
|
|
try
|
|
StoreItemStates;
|
|
SetItemStates;
|
|
AdjustLayoutBounds(AvailableBounds);
|
|
inherited ConstructReport(AReportCells);
|
|
PostCheckEmbeddedControls;
|
|
finally
|
|
AdjustLayoutBounds(cxNullRect);
|
|
RestoreItemStates;
|
|
LayoutControl.EndUpdate;
|
|
AList.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.PostCheckEmbeddedControls;
|
|
var
|
|
I: Integer;
|
|
LayoutItem: TdxLayoutItem;
|
|
ReportItem: TdxReportCell;
|
|
ADataItem: TdxReportVisualItem;
|
|
BottomPosition: Integer;
|
|
NeedAddBorder: Boolean;
|
|
|
|
procedure DoCheckBounds(ACell: TdxReportCell; ATopOffset: Integer);
|
|
var
|
|
I: Integer;
|
|
begin
|
|
for I := 0 to ACell.CellCount - 1 do
|
|
DoCheckBounds(ACell.Cells[I], ATopOffset + ACell.Cells[I].Top);
|
|
for I := 0 to ACell.DataItemCount - 1 do
|
|
begin
|
|
if ADataItem = nil then
|
|
ADataItem := ACell.DataItems[I];
|
|
NeedAddBorder := NeedAddBorder or
|
|
(ACell.DataItems[I].BoundsRect.Bottom + ATopOffset > BottomPosition);
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
for I := 0 to CachedBoundsCount - 1 do
|
|
begin
|
|
ADataItem := nil;
|
|
NeedAddBorder := False;
|
|
if not CachedBoundsItem[I].EmbeddedLink then Continue;
|
|
LayoutItem := LayoutControl.FindItem(TControl(CachedBoundsItem[I].Component));
|
|
Assert(LayoutItem <> nil);
|
|
ReportItem := FindReportItemByLayoutItem(LayoutItem);
|
|
Assert(ReportItem <> nil);
|
|
BottomPosition := ReportItem.Cells[0].Height;
|
|
DoCheckBounds(ReportItem.Cells[0], 0);
|
|
if (ADataItem <> nil) and NeedAddBorder then
|
|
with TdxReportCellString(ReportItem.AddDataItem(TdxReportCellString)) do
|
|
begin
|
|
BoundsRect := ReportItem.Cells[0].BoundsRect;
|
|
Width := Width - 1;
|
|
CellSides := [csBottom];
|
|
BorderClass := ADataItem.BorderClass;
|
|
BorderColor := ADataItem.BorderColor;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.PrepareConstruct;
|
|
begin
|
|
ClearCachedBounds;
|
|
LayoutControl.ViewInfo.Calculate;
|
|
CacheControlsBounds;
|
|
inherited;
|
|
ClearCachedFonts;
|
|
PrepareLookAndFeels;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.PrepareLookAndFeels;
|
|
|
|
procedure CreateReportLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel);
|
|
var
|
|
ReportLookAndFeel: TdxPSReportGroupLookAndFeel;
|
|
begin
|
|
if ALayoutLookAndFeel = nil then Exit;
|
|
|
|
AddCaptionOptionsFontToCache(ALayoutLookAndFeel.GroupOptions.CaptionOptions);
|
|
AddCaptionOptionsFontToCache(ALayoutLookAndFeel.ItemOptions.CaptionOptions);
|
|
|
|
with LayoutLookAndFeelProducers[ALayoutLookAndFeel] do
|
|
begin
|
|
ReportLookAndFeel := CreateGroupLookAndFeel(ReportLookAndFeelClass, False);
|
|
InitializeReportLookAndFeel(ReportLookAndFeel);
|
|
ReportLookAndFeel.Prepare({$IFDEF PS4}ScreenCanvas{$ELSE}ScreenDC{$ENDIF});
|
|
end;
|
|
end;
|
|
|
|
procedure CreateReportLookAndFeels(ALookAndFeels: TList);
|
|
var
|
|
I: Integer;
|
|
begin
|
|
for I := 0 to ALookAndFeels.Count - 1 do
|
|
CreateReportLookAndFeel(TdxCustomLayoutLookAndFeel(ALookAndFeels[I]));
|
|
end;
|
|
|
|
procedure EnumerateLayoutGroup(AGroup: TdxLayoutGroup; ALookAndFeels: TList);
|
|
var
|
|
I: Integer;
|
|
Child: TdxCustomLayoutItem;
|
|
LookAndFeel: TdxCustomLayoutLookAndFeel;
|
|
begin
|
|
for I := 0 to AGroup.Count - 1 do
|
|
begin
|
|
Child := AGroup.Items[I];
|
|
if Child.Visible then
|
|
begin
|
|
LookAndFeel := Child.ViewInfo.LayoutLookAndFeel;
|
|
if ALookAndFeels.IndexOf(LookAndFeel) = -1 then
|
|
ALookAndFeels.Add(LookAndFeel);
|
|
if Child is TdxLayoutGroup then
|
|
EnumerateLayoutGroup(TdxLayoutGroup(Child), ALookAndFeels);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
var
|
|
LookAndFeels: TList;
|
|
begin
|
|
LookAndFeels := TList.Create;
|
|
try
|
|
LookAndFeels.Add(LayoutControl.ViewInfo.LayoutLookAndFeel);
|
|
LookAndFeels.Add(LayoutControl.Items.ViewInfo.LayoutLookAndFeel);
|
|
EnumerateLayoutGroup(LayoutControl.Items, LookAndFeels);
|
|
|
|
CreateReportLookAndFeels(LookAndFeels);
|
|
finally
|
|
LookAndFeels.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.RepositionControls;
|
|
begin
|
|
Producers[LayoutControl].Reposition;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.AddHiddenItem(ATreeView: TTreeView;
|
|
AParent: TTreeNode; AnItem: TdxCustomLayoutItem);
|
|
var
|
|
Index, I: Integer;
|
|
begin
|
|
AParent := AddNode(ATreeView, AParent, AnItem, not FindHiddenComponent(AnItem, Index));
|
|
if AnItem is TdxLayoutGroup then
|
|
for I := 0 to TdxLayoutGroup(AnItem).VisibleCount - 1 do
|
|
AddHiddenItem(ATreeView, AParent, TdxLayoutGroup(AnItem).VisibleItems[I]);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.AddItem(ATreeView: TTreeView;
|
|
AParent: TTreeNode; AnItem: TdxCustomLayoutItem);
|
|
var
|
|
Index, I: Integer;
|
|
begin
|
|
if not FindHiddenComponent(AnItem, Index) then
|
|
begin
|
|
AParent := AddNode(ATreeView, AParent, AnItem, not FindExcludedComponent(AnItem, Index));
|
|
if AnItem is TdxLayoutGroup then
|
|
for I := 0 to TdxLayoutGroup(AnItem).VisibleCount - 1 do
|
|
AddItem(ATreeView, AParent, TdxLayoutGroup(AnItem).VisibleItems[I]);
|
|
end;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.IsComponentEditable(AComponent: TComponent): Boolean;
|
|
begin
|
|
Result := inherited IsComponentEditable(AComponent) and (AComponent <> LayoutControl.Items);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.LoadControlsTree(ATreeView: TTreeView);
|
|
begin
|
|
ATreeView.Items.Clear;
|
|
if Container <> nil then
|
|
AddItem(ATreeView, AddNode(ATreeView, nil, Container, True), RootLayoutGroup);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.LoadHiddenControlsTree(ATreeView: TTreeView);
|
|
begin
|
|
ATreeView.Items.Clear;
|
|
if Container <> nil then
|
|
AddHiddenItem(ATreeView, AddNode(ATreeView, nil, Container, True), RootLayoutGroup);
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.AddBoundsToCache(
|
|
AComponent: TComponent; const ABounds: TRect): Integer;
|
|
var
|
|
AItem: TdxLCBoundsCacheItem;
|
|
begin
|
|
AItem := TdxLCBoundsCacheItem.Create;
|
|
AItem.Component := AComponent;
|
|
AItem.Bounds := ABounds;
|
|
Result := CachedBounds.Add(AItem);
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.AddCaptionOptionsFontToCache(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer;
|
|
var
|
|
Item: PdxPSLayoutCacheFontItem;
|
|
begin
|
|
New(Item);
|
|
Item^.CaptionOptions := ACaptionOptions;
|
|
Item^.FontIndex := GetPreparedFontIndex(ACaptionOptions);
|
|
CachedFonts.Add(Item);
|
|
|
|
Result := Item^.FontIndex;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.ClearCachedBounds;
|
|
var
|
|
I: Integer;
|
|
begin
|
|
for I := 0 to CachedBoundsCount - 1 do
|
|
CachedBoundsItem[I].Free;
|
|
CachedBounds.Clear;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.ClearCachedFonts;
|
|
var
|
|
I: Integer;
|
|
begin
|
|
for I := 0 to CachedFontItemCount - 1 do
|
|
Dispose(PdxPSLayoutCacheFontItem(CachedFontItems[I]));
|
|
CachedFonts.Clear;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.FindBoundsByComponent(
|
|
AComponent: TComponent; var ABounds: TRect; ASetEmbedded: Boolean): Boolean;
|
|
var
|
|
I: Integer;
|
|
begin
|
|
Result := AComponent <> nil;
|
|
if not Result then Exit;
|
|
for I := 0 to CachedBoundsCount - 1 do
|
|
if AComponent = CachedBoundsItem[I].Component then
|
|
begin
|
|
ABounds := CachedBoundsItem[I].Bounds;
|
|
CachedBoundsItem[I].EmbeddedLink := ASetEmbedded;
|
|
Exit;
|
|
end;
|
|
Result := False;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.FindFontIndexByCaptionOptions(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer;
|
|
var
|
|
I: Integer;
|
|
Item: PdxPSLayoutCacheFontItem;
|
|
begin
|
|
for I := 0 to CachedFontItemCount - 1 do
|
|
begin
|
|
Item := CachedFontItems[I];
|
|
if Item^.CaptionOptions = ACaptionOptions then
|
|
begin
|
|
Result := Item^.FontIndex;
|
|
Exit;
|
|
end;
|
|
end;
|
|
Result := 0;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.FreeAndNilCachedBounds;
|
|
begin
|
|
ClearCachedBounds;
|
|
FreeAndNil(FCachedBounds)
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.FreeAndNilCachedFonts;
|
|
begin
|
|
ClearCachedFonts;
|
|
FreeAndNil(FCachedFonts);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.CreateOptions;
|
|
begin
|
|
inherited;
|
|
FOptionsSize := GetOptionsSizeClass.Create(Self);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.DestroyOptions;
|
|
begin
|
|
FreeAndNil(FOptionsSize);
|
|
inherited;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetOptionsPaginationClass: TdxCustomContainerReportLinkOptionsPaginationClass;
|
|
begin
|
|
Result := TdxLayoutControlReportLinkOptionsPagination;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetOptionsSizeClass: TdxLayoutControlReportLinkOptionsSizeClass;
|
|
begin
|
|
Result := TdxLayoutControlReportLinkOptionsSize;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetOptionsTransparentClass: TdxCustomContainerReportLinkOptionsTransparentClass;
|
|
begin
|
|
Result := TdxLayoutControlReportLinkOptionsTransparent;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.FindReportGroupLookAndFeel(ALayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSReportGroupLookAndFeel;
|
|
begin
|
|
Result := ReportCells.FindGroupLookAndFeelByData(ALayoutLookAndFeel)
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.FindReportItemByLayoutItem(ALayoutItem: TdxCustomLayoutItem): TdxReportCell;
|
|
|
|
function SearchCell(ACell: TdxReportCell): TdxReportCell;
|
|
var
|
|
I: Integer;
|
|
begin
|
|
Result := ACell;
|
|
if TObject(Result.Data) = ALayoutItem then Exit;
|
|
|
|
for I := 0 to ACell.CellCount - 1 do
|
|
begin
|
|
Result := SearchCell(ACell[I]);
|
|
if Result <> nil then Exit;
|
|
end;
|
|
Result := nil;
|
|
end;
|
|
|
|
begin
|
|
Result := SearchCell(RootCell);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.GetLayoutItemList(AControl: TdxLayoutControl;
|
|
AnItems: TList);
|
|
|
|
procedure EnumerateLayoutGroup(AGroup: TdxLayoutGroup);
|
|
var
|
|
I: Integer;
|
|
Item: TdxCustomLayoutItem;
|
|
begin
|
|
for I := 0 to AGroup.VisibleCount - 1 do
|
|
begin
|
|
Item := AGroup.VisibleItems[I];
|
|
// if IsComponentProcessed(Item) then
|
|
begin
|
|
AnItems.Add(Item);
|
|
if Item is TdxLayoutGroup then
|
|
EnumerateLayoutGroup(TdxLayoutGroup(Item));
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
begin
|
|
if IsComponentProcessed(AControl.Items) then
|
|
begin
|
|
AnItems.Add(AControl.Items);
|
|
EnumerateLayoutGroup(AControl.Items);
|
|
end;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetPreparedFontIndex(ACaptionOptions: TdxLayoutLookAndFeelCaptionOptions): Integer;
|
|
begin
|
|
with PreparationFont do
|
|
begin
|
|
Assign(ACaptionOptions.GetFont(LayoutControl));
|
|
Color := ACaptionOptions.GetTextColor;
|
|
if ACaptionOptions.HotTrack and (htsUnderlineCold in ACaptionOptions.HotTrackStyles) then
|
|
Style := Style + [fsUnderline];
|
|
if not dxIsTrueTypeFont(PreparationFont) then
|
|
Name := Font.Name;
|
|
end;
|
|
Result := AddFontToPool(PreparationFont);
|
|
end;
|
|
|
|
// IdxReportLinkController
|
|
|
|
function TdxLayoutControlReportLink.GetControlSiteBounds(AControl: TControl): TRect;
|
|
var
|
|
LayoutItem: TdxLayoutItem;
|
|
ReportItem: TdxReportCell;
|
|
begin
|
|
if not FindBoundsByComponent(AControl, Result, True) then
|
|
begin
|
|
LayoutItem := LayoutControl.FindItem(AControl);
|
|
Assert(LayoutItem <> nil);
|
|
ReportItem := FindReportItemByLayoutItem(LayoutItem);
|
|
Assert(ReportItem <> nil);
|
|
Result := (ReportItem as TdxReportLayoutItem).ControlBounds;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.AdjustLayoutBounds(const R: TRect);
|
|
begin
|
|
TcxControlAccess(LayoutControl).FBounds := R;
|
|
LayoutControl.Perform(DXM_PLACECONTROLS, 0, 0);
|
|
Application.ProcessMessages;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetAvailableBounds: TRect;
|
|
begin
|
|
Result := LayoutControl.ClientBounds;
|
|
if OptionsSize.AutoWidth then
|
|
with RealPrinterPage.PaintRectPixels do
|
|
begin
|
|
Result.Left := 0;
|
|
Result.Right := Right - Left - 1;
|
|
end;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetCachedBoundsCount: Integer;
|
|
begin
|
|
Result := CachedBounds.Count;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetCachedBoundsItem(Index: Integer): TdxLCBoundsCacheItem;
|
|
begin
|
|
Result := TdxLCBoundsCacheItem(CachedBounds[Index]);
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetCachedFontItem(Index: Integer): PdxPSLayoutCacheFontItem;
|
|
begin
|
|
Result := FCachedFonts[Index];
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetCachedFontItemCount: Integer;
|
|
begin
|
|
Result := FCachedFonts.Count;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetCurrentHost: TdxReportCell;
|
|
begin
|
|
Result := FindReportItemByLayoutItem(CurrentLayoutItem);
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetLayoutControl: TdxLayoutControl;
|
|
begin
|
|
Result := TdxLayoutControl(Container);
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetLayoutItemProducer(LayoutItem: TdxCustomLayoutItem): TdxPSCustomLayoutItemProducer;
|
|
begin
|
|
Result := LayoutItemProducerCache[dxPSLayoutItemProducerFactory[LayoutItem], LayoutItem];
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetLayoutLookAndFeelProducer(LayoutLookAndFeel: TdxCustomLayoutLookAndFeel): TdxPSLayoutLookAndFeelProducer;
|
|
begin
|
|
Result := LayoutLookAndFeelProducerCache[dxPSLayoutLookAndFeelProducerFactory[LayoutLookAndFeel], LayoutLookAndFeel];
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetOptionsPagination: TdxLayoutControlReportLinkOptionsPagination;
|
|
begin
|
|
Result := inherited OptionsPagination as TdxLayoutControlReportLinkOptionsPagination;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetOptionsTransparent: TdxLayoutControlReportLinkOptionsTransparent;
|
|
begin
|
|
Result := inherited OptionsTransparent as TdxLayoutControlReportLinkOptionsTransparent;
|
|
end;
|
|
|
|
function TdxLayoutControlReportLink.GetRootLayoutGroup: TdxLayoutGroup;
|
|
begin
|
|
Result := LayoutControl.Items;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.SetOptionsBehavior(Value: TdxLayoutControlReportLinkOptionsBehavior);
|
|
begin
|
|
FOptionsBehavior.Assign(Value);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.SetOptionsPagination(Value: TdxLayoutControlReportLinkOptionsPagination);
|
|
begin
|
|
inherited OptionsPagination := Value;
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.SetOptionsSize(Value: TdxLayoutControlReportLinkOptionsSize);
|
|
begin
|
|
OptionsSize.Assign(Value);
|
|
end;
|
|
|
|
procedure TdxLayoutControlReportLink.SetOptionsTransparent(Value: TdxLayoutControlReportLinkOptionsTransparent);
|
|
begin
|
|
inherited OptionsTransparent := Value;
|
|
end;
|
|
|
|
{ TdxPSLayoutControlDesignWindow }
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.DoInitialize;
|
|
begin
|
|
inherited;
|
|
|
|
with LayoutReportLink.OptionsPagination do
|
|
begin
|
|
chbxPaginateByGroups.Checked := Groups;
|
|
chbxPaginateByItems.Checked := Items;
|
|
end;
|
|
chbxPaginateByGroups.Visible := True;
|
|
chbxPaginateByItems.Visible := True;
|
|
|
|
with LayoutReportLink.OptionsTransparent do
|
|
begin
|
|
chbxTransparentGroups.Checked := Groups;
|
|
chbxTransparentItems.Checked := Items;
|
|
end;
|
|
chbxTransparentGroups.Visible := True;
|
|
chbxTransparentItems.Visible := True;
|
|
|
|
with LayoutReportLink.OptionsBehavior do
|
|
begin
|
|
chbxExpandedGroups.Checked := ExpandGroups;
|
|
chbxSkipEmptyGroups.Checked := SkipEmptyGroups;
|
|
chbxUnwrapTabs.Checked := UnwrapTabs;
|
|
chbxRiseActiveTabOntoTop.Checked := ActiveTabToTop;
|
|
BehaviorsTab.TabVisible := True;
|
|
end;
|
|
|
|
chbxAutoWidth.Checked := LayoutReportLink.OptionsSize.AutoWidth;
|
|
chbxAutoWidth.Visible := True;
|
|
lblSize.Visible := True;
|
|
{$IFNDEF PS4}
|
|
bvlSize.Visible := True;
|
|
{$ENDIF}
|
|
imgSize.Visible := True;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.SetOptionsGroupsByIndex(AnIndex: Integer; AValue: Boolean);
|
|
begin
|
|
if LockControlsUpdate then Exit;
|
|
|
|
if AnIndex < 2 then
|
|
begin
|
|
case AnIndex of
|
|
0: LayoutReportLink.OptionsBehavior.ExpandGroups := AValue;
|
|
1: LayoutReportLink.OptionsBehavior.SkipEmptyGroups := AValue;
|
|
end;
|
|
Modified := True;
|
|
end
|
|
else
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.SetOptionsPaginationByIndex(AnIndex: Integer;
|
|
AValue: Boolean);
|
|
begin
|
|
if LockControlsUpdate then Exit;
|
|
|
|
if AnIndex > 1 then
|
|
begin
|
|
case AnIndex of
|
|
2: LayoutReportLink.OptionsPagination.Groups := AValue;
|
|
3: LayoutReportLink.OptionsPagination.Items := AValue;
|
|
end;
|
|
Modified := True;
|
|
end
|
|
else
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.SetOptionsSizeByIndex(AnIndex: Integer;
|
|
AValue: Boolean);
|
|
begin
|
|
if LockControlsUpdate then Exit;
|
|
|
|
inherited;
|
|
if AnIndex = 0 then
|
|
begin
|
|
LayoutReportLink.OptionsSize.AutoWidth := AValue;
|
|
Modified := True;
|
|
end;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.SetOptionsTabsByIndex(AnIndex: Integer; AValue: Boolean);
|
|
begin
|
|
if LockControlsUpdate then Exit;
|
|
if AnIndex < 2 then
|
|
begin
|
|
case AnIndex of
|
|
0: LayoutReportLink.OptionsBehavior.UnwrapTabs := AValue;
|
|
1: LayoutReportLink.OptionsBehavior.ActiveTabToTop := AValue;
|
|
end;
|
|
Modified := True;
|
|
end
|
|
else
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.SetOptionsTransparentByIndex(AnIndex: Integer;
|
|
AValue: Boolean);
|
|
begin
|
|
if LockControlsUpdate then Exit;
|
|
|
|
if AnIndex > 3 then
|
|
begin
|
|
case AnIndex of
|
|
4: LayoutReportLink.OptionsTransparent.Groups := AValue;
|
|
5: LayoutReportLink.OptionsTransparent.Items := AValue;
|
|
end;
|
|
Modified := True;
|
|
end
|
|
else
|
|
inherited;
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.InitializeControlsTree;
|
|
var
|
|
Root: TTreeNode;
|
|
begin
|
|
inherited;
|
|
{$IFDEF PS4}
|
|
Root := TreeView_GetRoot(tvControls.InnerTreeView);
|
|
{$ELSE}
|
|
Root := TreeView_GetRoot(tvControls);
|
|
{$ENDIF}
|
|
if (Root <> nil) and (Root.Count <> 0) then
|
|
Root[0].Expand(False);
|
|
end;
|
|
|
|
procedure TdxPSLayoutControlDesignWindow.InitializeHiddenControlsTree;
|
|
var
|
|
Root: TTreeNode;
|
|
begin
|
|
inherited;
|
|
{$IFDEF PS4}
|
|
Root := TreeView_GetRoot(tvHiddenControls.InnerTreeView);
|
|
{$ELSE}
|
|
Root := TreeView_GetRoot(tvHiddenControls);
|
|
{$ENDIF}
|
|
if (Root <> nil) and (Root.Count <> 0) then
|
|
Root[0].Expand(False);
|
|
end;
|
|
|
|
function TdxPSLayoutControlDesignWindow.IsBoldNode(ANode: TTreeNode): Boolean;
|
|
begin
|
|
Result := inherited IsBoldNode(ANode) or (TreeView_GetNodeObject(ANode).Component is TdxLayoutGroup);
|
|
end;
|
|
|
|
function TdxPSLayoutControlDesignWindow.GetLayoutReportLink: TdxLayoutControlReportLink;
|
|
begin
|
|
Result := TdxLayoutControlReportLink(ReportLink);
|
|
end;
|
|
|
|
procedure RegisterAssistants;
|
|
begin
|
|
TdxPSLayoutLookAndFeelProducer.Register;
|
|
TdxPSLayoutStandardLookAndFeelProducer.Register;
|
|
TdxPSLayoutOfficeLookAndFeelProducer.Register;
|
|
TdxPSLayoutWebLookAndFeelProducer.Register;
|
|
|
|
TdxPSCustomLayoutItemProducer.Register;
|
|
TdxPSLayoutGroupProducer.Register;
|
|
TdxPSLayoutLabeledItemProducer.Register;
|
|
TdxPSLayoutEmptySpaceItemProducer.Register;
|
|
TdxPSLayoutSeparatorItemProducer.Register;
|
|
TdxPSLayoutSplitterItemProducer.Register;
|
|
TdxPSLayoutItemProducer.Register;
|
|
|
|
TdxPSLayoutControlProducer.Register;
|
|
|
|
TdxPSNativeLayoutControlProducer.Register;
|
|
end;
|
|
|
|
procedure RegisterItems;
|
|
begin
|
|
TdxReportLayoutControlHost.Register;
|
|
TdxCustomReportLayoutItem.Register;
|
|
TdxReportLayoutGroup.Register;
|
|
TdxReportLayoutLabeledItem.Register;
|
|
TdxReportLayoutEmptySpaceItem.Register;
|
|
TdxReportLayoutSeparatorItem.Register;
|
|
TdxReportLayoutSplitterItem.Register;
|
|
TdxReportLayoutItem.Register;
|
|
end;
|
|
|
|
procedure UnregisterAssistants;
|
|
begin
|
|
TdxPSNativeLayoutControlProducer.Unregister;
|
|
|
|
TdxPSLayoutControlProducer.Unregister;
|
|
|
|
TdxPSLayoutItemProducer.Unregister;
|
|
TdxPSLayoutSplitterItemProducer.Unregister;
|
|
TdxPSLayoutSeparatorItemProducer.Unregister;
|
|
TdxPSLayoutEmptySpaceItemProducer.Unregister;
|
|
TdxPSLayoutLabeledItemProducer.Unregister;
|
|
TdxPSLayoutGroupProducer.Unregister;
|
|
TdxPSCustomLayoutItemProducer.Unregister;
|
|
|
|
TdxPSLayoutWebLookAndFeelProducer.Unregister;
|
|
TdxPSLayoutOfficeLookAndFeelProducer.Unregister;
|
|
TdxPSLayoutStandardLookAndFeelProducer.Unregister;
|
|
TdxPSLayoutLookAndFeelProducer.Unregister;
|
|
|
|
TdxPSLayoutItemProducerFactory.ReleaseInstance;
|
|
TdxPSLayoutLookAndFeelProducerFactory.ReleaseInstance;
|
|
end;
|
|
|
|
procedure UnregisterItems;
|
|
begin
|
|
TdxReportLayoutItem.Unregister;
|
|
TdxReportLayoutSplitterItem.Unregister;
|
|
TdxReportLayoutSeparatorItem.Unregister;
|
|
TdxReportLayoutEmptySpaceItem.Unregister;
|
|
TdxReportLayoutLabeledItem.Unregister;
|
|
TdxReportLayoutGroup.Unregister;
|
|
TdxCustomReportLayoutItem.Unregister;
|
|
TdxReportLayoutControlHost.Unregister;
|
|
end;
|
|
|
|
initialization
|
|
RegisterAssistants;
|
|
RegisterItems;
|
|
|
|
dxPSRegisterReportLink(TdxLayoutControlReportLink, TdxLayoutControl, TdxPSLayoutControlDesignWindow);
|
|
|
|
finalization
|
|
dxPSUnregisterReportLink(TdxLayoutControlReportLink, TdxLayoutControl, TdxPSLayoutControlDesignWindow);
|
|
|
|
UnregisterItems;
|
|
UnregisterAssistants;
|
|
|
|
end.
|