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

📄 rm_class.pas

📁 这是一个功能强大
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    procedure CalcGeneratedData;
    procedure SetFont(Value: TFont);
    function GetWordwrap: Boolean;
    procedure SetWordwrap(Value: Boolean);
    function GetWordBreak: Boolean;
    procedure SetWordBreak(Value: Boolean);
    function GetCharWrap: Boolean;
    procedure SetCharWrap(Value: Boolean);
    function GetAutoWidth: Boolean;
    procedure SetAutoWidth(Value: Boolean);
    function GetMangeTag: Boolean;
    procedure SetMangeTag(Value: Boolean);
    function GetPrintAtAppendBlank: Boolean;
    procedure SetPrintAtAppendBlank(Value: Boolean);
    procedure SetRepeatedOptions(Value: TRMRepeatedOptions);
    function GetExportAsNumber: Boolean;
    procedure SetExportAsNumber(Value: Boolean);
    function GetDBFieldOnly: Boolean;
    procedure SetDBFieldOnly(Value: Boolean);
    function GetUnderlines: Boolean;
    procedure SetUnderlines(value: Boolean);
    function GetAutoAddBlank: Boolean;
    procedure SetAutoAddBlank(value: Boolean);
    function GetIsCurrency: Boolean;
    procedure SetIsCurrency(value: Boolean);
    procedure SetStyleName(Value: string);
    function GetFontAdapter: TRMPersistentCompAdapter;
  protected
    FMergeEmpty: Boolean;
    CurStrNo: Integer;
    MergeEmpty: Boolean;
    LineHeight: Integer;
    FFlagPlaceOnEndPage: Boolean;
    Exporting: Boolean;

    function SaveHtmlTagList: TWideStringList;
    function GetPropValue(aObject: TObject; aPropName: string;
      var aValue: Variant; aArgs: array of Variant): Boolean; override;
    function SetPropValue(aObject: TObject; aPropName: string;
      aValue: Variant): Boolean; override;

    procedure ApplyStyle(aStyle: TRMTextStyle);
    function CanMergeCell: Boolean;
    procedure AssignFont(aCanvas: TCanvas);
    procedure GetBlob; override;
    procedure Prepare; override;
    procedure ExpandMemoVariables; virtual;
    procedure WrapMemo1(aAddChar: Boolean);
    procedure WrapMemo(aAddChar: Boolean);
    procedure ShowMemo;
    function CalcHeight: Integer; override;
    function RemainHeight: Integer; override;
    procedure GetMemoVariables; override;
    procedure PlaceOnEndPage(aStream: TStream); override;
    procedure ExportData; override;
    function CalcWidth(aMemo: TWideStringList): Integer;
    procedure Set_AutoWidth(const aCanvas: TCanvas);
    procedure ShowUnderLines;

    property WantHook;
    property RotationType: TRMRotationType read FRotationType write FRotationType;
    property ScaleFontType: TRMScaleFontType read FScaleFontType write FScaleFontType;
    property FontScaleWidth: Integer read FFontScaleWidth write FFontScaleWidth;
    property WordWrap: Boolean read GetWordwrap write SetWordwrap;
    property WordBreak: Boolean read GetWordBreak write SetWordBreak;
    property CharWrap: Boolean read GetCharWrap write SetCharWrap;
    property AutoWidth: Boolean read GetAutoWidth write SetAutoWidth;
    property RepeatedOptions: TRMRepeatedOptions read FRepeatedOptions write SetRepeatedOptions;
    property ShowAtAppendBlank: Boolean read GetPrintAtAppendBlank write SetPrintAtAppendBlank;
    property ExportAsNumber: Boolean read GetExportAsNumber write SetExportAsNumber;
    property LastValue: string read FLastValue write FLastValue;
    property IsCurrency: Boolean read GetIsCurrency write SetIsCurrency;
  public
    constructor Create; override;
    destructor Destroy; override;
    function GetExportMode: TRMExportMode; override;

    procedure DefinePopupMenu(aPopup: TRMCustomMenuItem); override;
    procedure ShowEditor; override;
    procedure LoadFromStream(aStream: TStream); override;
    procedure SaveToStream(aStream: TStream); override;

    procedure Draw(aCanvas: TCanvas); override;

    property FontAdapter: TRMPersistentCompAdapter read GetFontAdapter;
  published
    property Highlight: TRMHighlight read FHighlight write FHighlight;
    property PrintFrame;
    property Printable;
    property BandAlign;
    property Font: TFont read FFont write SetFont;
    property GapLeft;
    property GapTop;
    property LineSpacing: Integer read FLineSpacing write FLineSpacing;
    property CharacterSpacing: Integer read FCharacterSpacing write FCharacterSpacing;
    property HideZeros;
    property LeftFrame;
    property TopFrame;
    property RightFrame;
    property BottomFrame;
    property ShadowStyle;
    property Memo;
    property ShiftWith;
    property StretchWith;
    property HAlign: TRMHAlign read FHAlign write SetHAlign;
    property VAlign: TRMVAlign read FVAlign write SetVAlign;
    property AutoAddBlank: Boolean read GetAutoAddBlank write SetAutoAddBlank;
    property AllowHtmlTag: Boolean read GetMangeTag write SetMangeTag;
    property DisplayFormat;
    property TextOnly;
    property FillColor;
    property ParentHeight;
    property ParentWidth;
    property DBFieldOnly: Boolean read GetDBFieldOnly write SetDBFieldOnly;
    property Underlines: Boolean read GetUnderlines write SetUnderlines;
    property DisplayBeginLine: Integer read FDisplayBeginLine write FDisplayBeginLine;
    property DisplayEndLine: Integer read FDisplayEndLine write FDisplayEndLine;
    property BrushStyle;
    property Cursor;
//    property ExpressionDelimiters;
    property Url;
    property ReprintOnOverFlow;
    property ShowAtNewColumn;
    property TabOrder;
//    property SubReport;
    property StyleName: string read FStyleName write SetStyleName;

    property OnBeforePrint;
    property OnBeforeCalc;
    property OnAfterCalc;
    property OnPreviewClick;
    property OnPreviewClickUrl;
  end;

  { TRMMemoView }
  TRMMemoView = class(TRMCustomMemoView)
  protected
    function DrawAsPicture: Boolean; override;
  published
    property RotationType;
    property ScaleFontType;
    property FontScaleWidth;
    property WordWrap;
    property WordBreak;
    property CharWrap;
    property AutoWidth;
    property RepeatedOptions;
    property ShowAtAppendBlank;
    property ExportAsNumber;
    property DataField;
  end;

  { TRMCalcOptions }
  TRMCalcOptions = class(TRMPersistent)
  private
    FParentView: TRMView;
    FCalcType: TRMDBCalcType;
    FAggrBandName: string;
    FResetAfterPrint: Boolean;
    FFilter: string;
    FIntalizeValue: string;
    FAggregateValue: string;
    FResetGroupName: string;

    function GetTotalCalc: Boolean;
    procedure SetTotalCalc(Value: Boolean);
    function GetCalcNoVisible: Boolean;
    procedure SetCalcNoVisible(Value: Boolean);
    function GetMemo: TWideStringList;
    procedure SetMemo(Value: TWideStringList);
  public
    constructor CreateComp(aView: TRMView);
  published
    property CalcType: TRMDBCalcType read FCalcType write FCalcType;
    property Filter: string read FFilter write FFilter;
    property ResetAfterPrint: Boolean read FResetAfterPrint write FResetAfterPrint;
    property ResetGroupName: string read FResetGroupName write FResetGroupName;
    property AggrBandName: string read FAggrBandName write FAggrBandName;
    property TotalCalc: Boolean read GetTotalCalc write SetTotalCalc;
    property CalcNoVisible: Boolean read GetCalcNoVisible write SetCalcNoVisible;
    property IntalizeValue: string read FIntalizeValue write FIntalizeValue;
    property AggregateValue: string read FAggregateValue write FAggregateValue;
    property Memo: TWideStringList read GetMemo write SetMemo;
  end;

  { TRMCalcMemoView }
  TRMCalcMemoView = class(TRMCustomMemoView)
  private
    FValueIndex, FOldValueIndex: Integer;
    FValues: TWideStringList;
    FOPZFilter: string;
    FResAssigned: Boolean;
    FValue: Double;
    FCurrencyValue: Currency;
    FSum: Double;
    FCount: Integer;
    FExpression: string;
    FCalcOptions: TRMCalcOptions;
    FResultExpression: string;
    FResetGroupBand: TRMView;
    //dejoy added begin
    FLastMasterViewValue: Variant; //masterview的最后一个值
    FLastAggValue: Double; //合计文本框的最后一个值
    //dejoy added end

    procedure GetValueInCalcHeight;
    function GetValue: Double;
    procedure AfterPrint(aIsHeaderBand: Boolean);
    procedure ResetValues;
    procedure OnResetAfterPrintClick(Sender: TObject);

    procedure SetResultExpression(Value: string);
    function GetOutBigNum: Boolean;
    procedure SetOutBigNum(Value: Boolean);
  protected
    function DrawAsPicture: Boolean; override;
    function GetPropValue(aObject: TObject; aPropName: string;
      var aValue: Variant; aArgs: array of Variant): Boolean; override;
    function SetPropValue(aObject: TObject; aPropName: string;
      aValue: Variant): Boolean; override;

    procedure Prepare; override;
    procedure ExpandMemoVariables; override;
    procedure PlaceOnEndPage(aStream: TStream); override;
    procedure Reset;
    procedure DoAggregate;

    property Expression: string read FExpression write FExpression;
  public
    constructor Create; override;
    destructor Destroy; override;

    procedure LoadFromStream(aStream: TStream); override;
    procedure SaveToStream(aStream: TStream); override;
    procedure DefinePopupMenu(aPopup: TRMCustomMenuItem); override;
  published
    property CalcOptions: TRMCalcOptions read FCalcOptions write FCalcOptions;

    property IsCurrency;
    property RotationType;
    property ScaleFontType;
    property FontScaleWidth;
    property WordWrap;
    property WordBreak;
    property AutoWidth;
    property RepeatedOptions;
    property ShowAtAppendBlank;
    property ExportAsNumber;
    property OutBigNum: Boolean read GetOutBigNum write SetOutBigNum;
    property ResultExpression: string read FResultExpression write SetResultExpression;
  end;

  TRMBlobType = (rmbtBitmap, rmbtMetafile, rmbtIcon, rmbtJPEG, rmbtGIF, rmbtAuto);
  TRMPictureFormat = (rmpfBorland, rmpfMicrosoft, rmpfAuto);

  { TRMPictureView }
  TRMPictureView = class(TRMReportView)
  private
    FPicture: TPicture;
    FPictureSource: TRMPictureSource;
    FBlobType: TRMBlobType;
    FPictureFormat: TRMPictureFormat;
    FTempFileType: TRMBlobType;
    FTempFileName: string;

    procedure OnPictureStretchedClick(Sender: TObject);
    procedure OnPictureCenterClick(Sender: TObject);
    procedure OnKeepAspectRatioClick(Sender: TObject);

    function GetPictureCenter: Boolean;
    procedure SetPictureCenter(const value: Boolean);
    function GetPictureRatio: Boolean;
    procedure SetPictureRatio(value: Boolean);
    function GetPictureStretched: Boolean;
    procedure SetPictureStretched(value: Boolean);
    function GetDirectDraw: Boolean;
    procedure SetDirectDraw(Value: Boolean);
    function GetUseTempFile: Boolean;
    procedure SetUSeTempFile(Value: Boolean);
  protected
    function GetPropValue(aObject: TObject; aPropName: string; var aValue: Variant;
      aArgs: array of Variant): Boolean; override;
    function SetPropValue(aObject: TObject; aPropName: string; aValue: Variant): Boolean; override;

    procedure ClearContents; override;
    procedure PlaceOnEndPage(aStream: TStream); override;
    procedure GetBlob; override;
    function GetViewCommon: string; override;
    procedure GetExportPicture(var aDstGraphic: TGraphic; aDrawFrame: Boolean); override;
  public
    constructor Create; override;
    destructor Destroy; override;

    procedure LoadFromStream(aStream: TStream); override;
    procedure SaveToStream(aStream: TStream); override;
    procedure Draw(aCanvas: TCanvas); override;
    procedure ShowEditor; override;
    procedure DefinePopupMenu(aPopup: TRMCustomMenuItem); override;
  published
    property UseTempFile: Boolean read GetUseTempFile write SetUseTempFile;
    property BlobType: TRMBlobType read FBlobType write FBlobType;
    property PictureFormat: TRMPictureFormat read FPictureFormat write FPictureFormat;
    property DataField;
    property Picture: TPicture read FPicture;
    property PictureCenter: Boolean read GetPictureCenter write SetPictureCenter;
    property PictureRatio: Boolean read GetPictureRatio write SetPictureRatio;
    property PictureStretched: Boolean read GetPictureStretched write SetPictureStretched;
    property Transparent;
    property DirectDraw: Boolean read GetDirectDraw write SetDirectDraw;
    property PictureSource: TRMPictureSource read FPictureSource write FPictureSource;
    property ReprintOnOverFlow;
    property ShiftWith;
    property BandAlign;
    property FillColor;
    property LeftFrame;
    property TopFrame;
    property RightFrame;
    property BottomFrame;
    property ShadowStyle;
    property ExpressionDelimiters;
    property Url;
    property Printable;
    property ParentHeight;
    property ParentWidth;
    property OnPreviewClick;
    property OnPreviewClickUrl;
  end;

  { TRMShapeView }
  TRMShapeView = class(TRMReportView)
  private
    FShape: TRMShapeType;
    FPen: TPen;
    FBrush: TBrush;

    procedure DrawShape;
    procedure SetPen(Value: TPen);
    procedure SetBrush(Value: TBrush);
  protected
    function GetViewCommon: string; override;
  public
    class function CanPlaceOnGridView: Boolean; override;
    constructor Create; override;
    destructor Destroy; override;
    procedure Draw(aCanvas: TCanvas); override;
    procedure LoadFromStream(aStream: TStream); override;
    procedure SaveToStream(aStream: TStream); override;
    procedure DefinePopupMenu(aPopup: TRMCustomMenuItem); override;
  published
    property Shape: TRMShapeType read FShape write FShape;
    property Pen: TPen read FPen write SetPen;

⌨️ 快捷键说明

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