⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frxclass.pas

📁 报表源码 FastReport 3 is new generation of the report generators components. It consists of report engin
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    FClipped:Boolean;
    FDisplayFormat:TfrxFormat;
    FExpressionDelimiters:String;
    FFlowTo:TfrxCustomMemoView;
    FGapX:Extended;
    FGapY:Extended;
    FHAlign:TfrxHAlign;
    FHideZeros:Boolean;
    FHighlight:TfrxHighlight;
    FLineSpacing:Extended;
    FMemo:TStrings;
    FParagraphGap:Extended;
    FPartMemo:String;
    FRotation:Integer;
    FRTLReading:Boolean;
    FStyle:String;
    FSuppressRepeated:Boolean;
    FTempMemo:String;
    FUnderlines:Boolean;
    FVAlign:TfrxVAlign;
    FValue:Variant;
    FWordBreak:Boolean;
    FWordWrap:Boolean;
    procedure SetMemo(const Value:TStrings);
    procedure SetRotation(Value:Integer);
    procedure SetText(const Value:String);
    function AdjustCalcHeight:Extended;
    function AdjustCalcWidth:Extended;
    function GetText:String;
    function IsExprDelimitersStored:Boolean;
    function IsLineSpacingStored:Boolean;
    function IsGapXStored:Boolean;
    function IsGapYStored:Boolean;
    function IsHighlightStored:Boolean;
    function IsParagraphGapStored:Boolean;
    procedure SetHighlight(const Value:TfrxHighlight);
    procedure SetDisplayFormat(const Value:TfrxFormat);
    procedure SetStyle(const Value:String);
    function IsCharSpacingStored:Boolean;
  protected
    FLastValue:Variant;
    FTotalPages:Integer;
    FTextRect:TRect;
    function CalcAndFormat(const Expr:String):String;
    procedure BeginDraw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    procedure SetDrawParams(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended);
    procedure Notification(AComponent:TComponent; Operation:TOperation); override;
  public
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
    class function GetDescription:String; override;
    function Diff(AComponent:TfrxComponent):String; override;
    function CalcHeight:Extended; override;
    function CalcWidth:Extended; virtual;
    function DrawPart:Extended; override;
    function GetComponentText:String; override;
    function FormatData(const Value:Variant; AFormat:TfrxFormat = nil):String;
    function WrapText(WrapWords:Boolean):String;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    procedure BeforePrint; override;
    procedure GetData; override;
    procedure AfterPrint; override;
    procedure InitPart; override;
    procedure ApplyStyle(Style:TfrxStyleItem);
    procedure ExtractTotalPages;
    property Text:String read GetText write SetText;
    property Value:Variant read FValue write FValue;
    // analogue of Memo property
    property Lines:TStrings read FMemo write SetMemo;

    property AllowExpressions:Boolean read FAllowExpressions write FAllowExpressions default True;
    property AllowHTMLTags:Boolean read FAllowHTMLTags write FAllowHTMLTags default False;
    property AutoWidth:Boolean read FAutoWidth write FAutoWidth default False;
    property CharSpacing:Extended read FCharSpacing write FCharSpacing stored IsCharSpacingStored;
    property Clipped:Boolean read FClipped write FClipped default True;
    property DisplayFormat:TfrxFormat read FDisplayFormat write SetDisplayFormat;
    property ExpressionDelimiters:String read FExpressionDelimiters
      write FExpressionDelimiters stored IsExprDelimitersStored;
    property FlowTo:TfrxCustomMemoView read FFlowTo write FFlowTo;
    property GapX:Extended read FGapX write FGapX stored IsGapXStored;
    property GapY:Extended read FGapY write FGapY stored IsGapYStored;
    property HAlign:TfrxHAlign read FHAlign write FHAlign default haLeft;
    property HideZeros:Boolean read FHideZeros write FHideZeros default False;
    property Highlight:TfrxHighlight read FHighlight write SetHighlight
      stored IsHighlightStored;
    property LineSpacing:Extended read FLineSpacing write FLineSpacing stored IsLineSpacingStored;
    property Memo:TStrings read FMemo write SetMemo;
    property ParagraphGap:Extended read FParagraphGap write FParagraphGap stored IsParagraphGapStored;
    property Rotation:Integer read FRotation write SetRotation default 0;
    property RTLReading:Boolean read FRTLReading write FRTLReading default False;
    property Style:String read FStyle write SetStyle;
    property SuppressRepeated:Boolean read FSuppressRepeated write FSuppressRepeated default False;
    property Underlines:Boolean read FUnderlines write FUnderlines default False;
    property WordBreak:Boolean read FWordBreak write FWordBreak default False;
    property WordWrap:Boolean read FWordWrap write FWordWrap default True;
    property VAlign:TfrxVAlign read FVAlign write FVAlign default vaTop;
  end;

  TfrxMemoView = class(TfrxCustomMemoView)
  published
    property AutoWidth;
    property AllowExpressions;
    property AllowHTMLTags;
    property BrushStyle;
    property CharSpacing;
    property Clipped;
    property Color;
    property DataField;
    property DataSet;
    property DataSetName;
    property DisplayFormat;
    property ExpressionDelimiters;
    property FlowTo;
    property Font;
    property Frame;
    property GapX;
    property GapY;
    property HAlign;
    property HideZeros;
    property Highlight;
    property LineSpacing;
    property Memo;
    property ParagraphGap;
    property ParentFont;
    property Rotation;
    property RTLReading;
    property Style;
    property SuppressRepeated;
    property Underlines;
    property WordBreak;
    property WordWrap;
    property VAlign;
  end;

  TfrxSysMemoView = class(TfrxCustomMemoView)
  public
    class function GetDescription:String; override;
  published
    property AutoWidth;
    property BrushStyle;
    property CharSpacing;
    property Color;
    property DisplayFormat;
    property Font;
    property Frame;
    property GapX;
    property GapY;
    property HAlign;
    property HideZeros;
    property Highlight;
    property Memo;
    property ParentFont;
    property Rotation;
    property RTLReading;
    property Style;
    property SuppressRepeated;
    property VAlign;
  end;

  TfrxCustomLineView = class(TfrxStretcheable)
  private
    FDiagonal:Boolean;
    procedure DrawDiagonalLine;
  public
    constructor Create(AOwner:TComponent); override;
    constructor DesignCreate(AOwner:TComponent; Flags:Word); override;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    property Diagonal:Boolean read FDiagonal write FDiagonal default False;
  end;

  TfrxLineView = class(TfrxCustomLineView)
  public
    class function GetDescription:String; override;
  published
    property Frame;
    property Diagonal;
  end;

  TfrxPictureView = class(TfrxView)
  private
    FAutoSize:Boolean;
    FCenter:Boolean;
    FKeepAspectRatio:Boolean;
    FPicture:TPicture;
    FPictureChanged:Boolean;
    FStretched:Boolean;
    procedure SetPicture(const Value:TPicture);
    procedure PictureChanged(Sender:TObject);
    procedure SetAutoSize(const Value:Boolean);
  public
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
    function Diff(AComponent:TfrxComponent):String; override;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    procedure GetData; override;
    class function GetDescription:String; override;
  published
    property AutoSize:Boolean read FAutoSize write SetAutoSize default False;
    property Center:Boolean read FCenter write FCenter default False;
    property DataField;
    property DataSet;
    property DataSetName;
    property Frame;
    property KeepAspectRatio:Boolean read FKeepAspectRatio write FKeepAspectRatio default True;
    property Picture:TPicture read FPicture write SetPicture;
    property Stretched:Boolean read FStretched write FStretched default True;
  end;

  TfrxShapeView = class(TfrxView)
  private
    FCurve:Integer;
    FShape:TfrxShapeKind;
  public
    constructor Create(AOwner:TComponent); override;
    constructor DesignCreate(AOwner:TComponent; Flags:Word); override;
    function Diff(AComponent:TfrxComponent):String; override;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    class function GetDescription:String; override;
  published
    property BrushStyle;
    property Color;
    property Curve:Integer read FCurve write FCurve default 0;
    property Frame;
    property Shape:TfrxShapeKind read FShape write FShape default skRectangle;
  end;

  TfrxSubreport = class(TfrxView)
  private
    FPage:TfrxReportPage;
    FPrintOnParent:Boolean;
    procedure SetPage(const Value:TfrxReportPage);
  public
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    class function GetDescription:String; override;
  published
    property Page:TfrxReportPage read FPage write SetPage;
    property PrintOnParent:Boolean read FPrintOnParent write FPrintOnParent
      default False;
  end;

{ Bands }
  TfrxChild = class;

  TfrxBand = class(TfrxReportComponent)
  private
    FAllowSplit:Boolean;
    FChild:TfrxChild;
    FKeepChild:Boolean;
    FOnAfterCalcHeight:TfrxNotifyEvent;
    FOutlineText:String;
    FOverflow:Boolean;
    FStartNewPage:Boolean;
    FStretched:Boolean;
    FPrintChildIfInvisible:Boolean;
    FVertical:Boolean;
    function GetBandName:String;
  protected
    procedure Notification(AComponent:TComponent; Operation:TOperation); override;
    procedure SetLeft(Value:Extended); override;
    procedure SetTop(Value:Extended); override;
    procedure SetHeight(Value:Extended); override;
  public
    FSubBands:TList; { list of subbands }
    FHeader, FFooter, FGroup:TfrxBand; { h./f./g. bands }
    FLineN:Integer; { used for Line# }
    FLineThrough:Integer; { used for LineThrough# }
    FOriginalObjectsCount:Integer; { used for TfrxSubReport.PrintOnParent }
    FHasVBands:Boolean; { whether the band should show vbands }
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
    function BandNumber:Integer;
    procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
    class function GetDescription:String; override;
    property AllowSplit:Boolean read FAllowSplit write FAllowSplit default False;
    property BandName:String read GetBandName;
    property Child:TfrxChild read FChild write FChild;
    property KeepChild:Boolean read FKeepChild write FKeepChild default False;
    property OutlineText:String read FOutlineText write FOutlineText;
    property Overflow:Boolean read FOverflow write FOverflow;
    property PrintChildIfInvisible:Boolean read FPrintChildIfInvisible
      write FPrintChildIfInvisible default False;
    property StartNewPage:Boolean read FStartNewPage write FStartNewPage default False;
    property Stretched:Boolean read FStretched write FStretched default False;
  published
    property Font;
    property Height;
    property Left;
    property ParentFont;
    property Restrictions;
    property Top;
    property Vertical:Boolean read FVertical write FVertical default False;
    property Visible;
    property Width;
    property OnAfterCalcHeight:TfrxNotifyEvent read FOnAfterCalcHeight
      write FOnAfterCalcHeight;
    property OnAfterPrint;
    property OnBeforePrint;
  end;

  TfrxBandClass = class of TfrxBand;

  TfrxDataBand = class(TfrxBand)
  private
    FColumnGap:Extended;
    FColumnWidth:Extended;
    FColumns:Integer;
    FCurColumn:Integer;
    FDataSet:TfrxDataSet;
    FDataSetName:String;
    FFooterAfterEach:Boolean;
    FKeepFooter:Boolean;
    FKeepHeader:Boolean;
    FKeepTogether:Boolean;
    FPrintIfDetailEmpty:Boolean;
    FRowCount:Integer;
    FOnMasterDetail:TfrxNotifyEvent;
    FVirtualDataSet:TfrxUserDataSet;
    procedure SetCurColumn(Value:Integer);
    procedure SetRowCount(const Value:Integer);
    procedure SetDataSet(const Value:TfrxDataSet);
    procedure SetDataSetName(const Value:String);
    function GetDataSetName:String;
  protected
    procedure Notification(AComponent:TComponent; Operation:TOperation); override;
  public
    FMaxY:Extended; { used for columns }
    constructor Create(AOwner:TComponent); override;
    destructor Destroy; override;
    class function GetDescription:String; override;
    property CurColumn:Integer read FCurColumn write SetCurColumn;
    property VirtualDataSet:TfrxUserDataSet read FVirtualDataSet;
  published
    property AllowSplit;
    property Child;
    property Columns:Integer read FColumns write FColumns default 0;
    property ColumnWidth:Extended read FColumnWidth write FColumnWidth;
    property ColumnGap:Extended read FColumnGap write FColumnGap;
    property DataSet:TfrxDataSet read FDataSet write SetDataSet;
    property DataSetName:String read GetDataSetName write SetDataSetName;
    property FooterAfterEach:Boolean read FFooterAfterEach write FFooterAfterEach default False;
    property KeepChild;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -