📄 frxclass.pas
字号:
property Width;
property Height;
property Font;
property GroupIndex;
property ParentFont;
property Enabled:Boolean read GetEnabled write SetEnabled default True;
property Visible;
end;
IfrxDataSet = interface(IUnknown)
['{AF1529F7-431B-4105-B222-185180B1CAD5}']
function Get_UserName(out Value:WideString):HResult; stdcall;
function Set_UserName(const Value:WideString):HResult; stdcall;
function Get_RangeBegin(out Value:TfrxRangeBegin):HResult; stdcall;
function Set_RangeBegin(Value:TfrxRangeBegin):HResult; stdcall;
function Get_RangeEndCount(out Value:Integer):HResult; stdcall;
function Set_RangeEndCount(Value:Integer):HResult; stdcall;
function Get_RangeEnd(out Value:TfrxRangeEnd):HResult; stdcall;
function Set_RangeEnd(Value:TfrxRangeEnd):HResult; stdcall;
end;
TfrxDataSet = class(TfrxDialogComponent , IfrxDataSet)
private
FCloseDataSource:Boolean;
FEnabled:Boolean;
FOpenDataSource:Boolean;
FRangeBegin:TfrxRangeBegin;
FRangeEnd:TfrxRangeEnd;
FRangeEndCount:Integer;
FReportRef:TfrxReport;
FUserName:String;
FOnCheckEOF:TfrxCheckEOFEvent;
FOnFirst:TNotifyEvent;
FOnNext:TNotifyEvent;
FOnPrior:TNotifyEvent;
FOnOpen:TNotifyEvent;
FOnClose:TNotifyEvent;
protected
FInitialized:Boolean;
FRecNo:Integer;
function GetDisplayText(Index:String):String; virtual;
function GetDisplayWidth(Index:String):Integer; virtual;
function GetFieldType(Index:String):TfrxFieldType; virtual;
function GetValue(Index:String):Variant; virtual;
procedure SetName(const NewName:TComponentName); override;
procedure SetUserName(const Value:String); virtual;
public
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
{ Navigation methods }
procedure Initialize; virtual;
procedure Finalize; virtual;
procedure Open; virtual;
procedure Close; virtual;
procedure First; virtual;
procedure Next; virtual;
procedure Prior; virtual;
function Eof:Boolean; virtual;
{ Data access }
function FieldsCount:Integer; virtual;
function HasField(const fName:String):Boolean;
function IsBlobField(const fName:String):Boolean; virtual;
function RecordCount:Integer; virtual;
procedure AssignBlobTo(const fName:String; Obj:TObject); virtual;
procedure GetFieldList(List:TStrings); virtual;
property DisplayText[Index:String]:String read GetDisplayText;
property DisplayWidth[Index:String]:Integer read GetDisplayWidth;
property FieldType[Index:String]:TfrxFieldType read GetFieldType;
property Value[Index:String]:Variant read GetValue;
property CloseDataSource:Boolean read FCloseDataSource write FCloseDataSource;
{ OpenDataSource is kept for backward compatibility only }
property OpenDataSource:Boolean read FOpenDataSource write FOpenDataSource default True;
property RecNo:Integer read FRecNo;
property ReportRef:TfrxReport read FReportRef write FReportRef;
property OnClose:TNotifyEvent read FOnClose write FOnClose;
property OnOpen:TNotifyEvent read FOnOpen write FOnOpen;
published
property Enabled:Boolean read FEnabled write FEnabled default True;
property RangeBegin:TfrxRangeBegin read FRangeBegin write FRangeBegin default rbFirst;
property RangeEnd:TfrxRangeEnd read FRangeEnd write FRangeEnd default reLast;
property RangeEndCount:Integer read FRangeEndCount write FRangeEndCount default 0;
property UserName:String read FUserName write SetUserName;
property OnCheckEOF:TfrxCheckEOFEvent read FOnCheckEOF write FOnCheckEOF;
property OnFirst:TNotifyEvent read FOnFirst write FOnFirst;
property OnNext:TNotifyEvent read FOnNext write FOnNext;
property OnPrior:TNotifyEvent read FOnPrior write FOnPrior;
private { Interface section }
function IfrxDataset.Get_UserName = IfrxDataset_Get_UserName;
function IfrxDataset.Set_UserName = IfrxDataset_Set_UserName;
function IfrxDataset.Get_RangeBegin = IfrxDataset_Get_RangeBegin;
function IfrxDataset.Set_RangeBegin = IfrxDataset_Set_RangeBegin;
function IfrxDataset.Get_RangeEndCount = IfrxDataset_Get_RangeEndCount;
function IfrxDataset.Set_RangeEndCount = IfrxDataset_Set_RangeEndCount;
function IfrxDataset.Get_RangeEnd = IfrxDataset_Get_RangeEnd;
function IfrxDataset.Set_RangeEnd = IfrxDataset_Set_RangeEnd;
function IfrxDataset_Get_UserName(out Value:WideString):HResult; stdcall;
function IfrxDataset_Set_UserName(const Value:WideString):HResult; stdcall;
function IfrxDataset_Get_RangeBegin(out Value:TfrxRangeBegin):HResult; stdcall;
function IfrxDataset_Set_RangeBegin(Value:TfrxRangeBegin):HResult; stdcall;
function IfrxDataset_Get_RangeEndCount(out Value:Integer):HResult; stdcall;
function IfrxDataset_Set_RangeEndCount(Value:Integer):HResult; stdcall;
function IfrxDataset_Get_RangeEnd(out Value:TfrxRangeEnd):HResult; stdcall;
function IfrxDataset_Set_RangeEnd(Value:TfrxRangeEnd):HResult; stdcall;
end;
IfrxUserDataSet = interface(IUnknown)
['{0ED40089-6575-4110-B24D-B09DD08C6F73}']
function Get_Fields(out Value:WideString):HResult; stdcall;
function Set_Fields(const Value:WideString):HResult; stdcall;
function Get_Name(out Value:WideString):HResult; stdcall;
function Set_Name(const Value:WideString):HResult; stdcall;
end;
TfrxUserDataSet = class(TfrxDataset, IfrxUserDataSet)
private
FFields:TStrings;
FOnGetValue:TfrxGetValueEvent;
procedure SetFields(const Value:TStrings);
protected
function GetDisplayText(Index:String):String; override;
function GetValue(Index:String):Variant; override;
public
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
function FieldsCount:Integer; override;
procedure GetFieldList(List:TStrings); override;
published
property Fields:TStrings read FFields write SetFields;
property OnGetValue:TfrxGetValueEvent read FOnGetValue write FOnGetValue;
private
function IfrxUserDataSet.Get_Fields = IfrxUserDataSet_Get_Fields;
function IfrxUserDataSet.Set_Fields = IfrxUserDataSet_Set_Fields;
function IfrxUserDataSet.Get_Name = IfrxUserDataSet_Get_Name;
function IfrxUserDataSet.Set_Name = IfrxUserDataSet_Set_Name;
function IfrxUserDataSet_Get_Fields(out Value:WideString):HResult; stdcall;
function IfrxUserDataSet_Set_Fields(const Value:WideString):HResult; stdcall;
function IfrxUserDataSet_Get_Name(out Value:WideString):HResult; stdcall;
function IfrxUserDataSet_Set_Name(const Value:WideString):HResult; stdcall;
end;
TfrxCustomDBDataSet = class(TfrxDataSet)
private
FAliases:TStrings;
FFields:TStringList;
procedure SetFieldAliases(const Value:TStrings);
protected
property Fields:TStringList read FFields;
public
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
function ConvertAlias(const fName:String):String;
function GetAlias(const fName:String):String;
function FieldsCount:Integer; override;
published
property CloseDataSource;
property FieldAliases:TStrings read FAliases write SetFieldAliases;
property OpenDataSource;
property OnClose;
property OnOpen;
end;
TfrxDBComponents = class(TComponent)
public
function GetDescription:String; virtual;
end;
TfrxCustomDatabase = class(TfrxDialogComponent)
protected
procedure SetConnected(Value:Boolean); virtual;
procedure SetDatabaseName(const Value:String); virtual;
procedure SetLoginPrompt(Value:Boolean); virtual;
procedure SetParams(Value:TStrings); virtual;
function GetConnected:Boolean; virtual;
function GetDatabaseName:String; virtual;
function GetLoginPrompt:Boolean; virtual;
function GetParams:TStrings; virtual;
public
procedure SetLogin(const Login, Password:String); virtual;
property Connected:Boolean read GetConnected write SetConnected default False;
property DatabaseName:String read GetDatabaseName write SetDatabaseName;
property LoginPrompt:Boolean read GetLoginPrompt write SetLoginPrompt default True;
property Params:TStrings read GetParams write SetParams;
end;
TfrxComponentClass = class of TfrxComponent;
{ Report Objects }
TfrxFrame = class(TPersistent)
private
FColor:TColor;
FDropShadow:Boolean;
FShadowWidth:Extended;
FShadowColor:TColor;
FStyle:TfrxFrameStyle;
FTyp:TfrxFrameTypes;
FWidth:Extended;
function IsShadowWidthStored:Boolean;
function IsTypStored:Boolean;
function IsWidthStored:Boolean;
public
constructor Create;
procedure Assign(Source:TPersistent); override;
function Diff(AFrame:TfrxFrame):String;
published
property Color:TColor read FColor write FColor default clBlack;
property DropShadow:Boolean read FDropShadow write FDropShadow default False;
property ShadowColor:TColor read FShadowColor write FShadowColor default clBlack;
property ShadowWidth:Extended read FShadowWidth write FShadowWidth stored IsShadowWidthStored;
property Style:TfrxFrameStyle read FStyle write FStyle default fsSolid;
property Typ:TfrxFrameTypes read FTyp write FTyp stored IsTypStored;
property Width:Extended read FWidth write FWidth stored IsWidthStored;
end;
TfrxView = class(TfrxReportComponent)
private
FAlign:TfrxAlign;
FBrushStyle:TBrushStyle;
FColor:TColor;
FCursor:TCursor;
FDataField:String;
FDataSet:TfrxDataSet;
FDataSetName:String;
FFrame:TfrxFrame;
FPrintable:Boolean;
FShiftMode:TfrxShiftMode;
FTagStr:String;
FTempTag:String;
FTempURL:String;
FURL:String;
procedure SetFrame(const Value:TfrxFrame);
procedure SetDataSet(const Value:TfrxDataSet);
procedure SetDataSetName(const Value:String);
function GetDataSetName:String;
protected
FX:Integer;
FY:Integer;
FX1:Integer;
FY1:Integer;
FDX:Integer;
FDY:Integer;
FFrameWidth:Integer;
FScaleX:Extended;
FScaleY:Extended;
FOffsetX:Extended;
FOffsetY:Extended;
FCanvas:TCanvas;
procedure BeginDraw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); virtual;
procedure DrawBackground; virtual;
procedure DrawFrame; virtual;
procedure DrawLine(x, y, x1, y1, w:Integer);
procedure Notification(AComponent:TComponent; Operation:TOperation); override;
public
constructor Create(AOwner:TComponent); override;
destructor Destroy; override;
function Diff(AComponent:TfrxComponent):String; override;
function IsDataField:Boolean;
procedure Draw(Canvas:TCanvas; ScaleX, ScaleY, OffsetX, OffsetY:Extended); override;
procedure BeforePrint; override;
procedure GetData; override;
procedure AfterPrint; override;
property BrushStyle:TBrushStyle read FBrushStyle write FBrushStyle default bsSolid;
property Color:TColor read FColor write FColor default clTransparent;
property DataField:String read FDataField write FDataField;
property DataSet:TfrxDataSet read FDataSet write SetDataSet;
property DataSetName:String read GetDataSetName write SetDataSetName;
property Frame:TfrxFrame read FFrame write SetFrame;
published
property Align:TfrxAlign read FAlign write FAlign default baNone;
property Cursor:TCursor read FCursor write FCursor default crDefault;
property Printable:Boolean read FPrintable write FPrintable default True;
property ShiftMode:TfrxShiftMode read FShiftMode write FShiftMode default smAlways;
property TagStr:String read FTagStr write FTagStr;
property URL:String read FURL write FURL;
property Left;
property Top;
property Width;
property Height;
property GroupIndex;
property Restrictions;
property Visible;
property OnAfterData;
property OnAfterPrint;
property OnBeforePrint;
property OnPreviewClick;
end;
TfrxStretcheable = class(TfrxView)
private
FStretchMode:TfrxStretchMode;
public
FSaveHeight:Extended;
constructor Create(AOwner:TComponent); override;
function CalcHeight:Extended; virtual;
function DrawPart:Extended; virtual;
procedure InitPart; virtual;
published
property StretchMode:TfrxStretchMode read FStretchMode write FStretchMode
default smDontStretch;
end;
TfrxHighlight = class(TPersistent)
private
FActive:Boolean;
FColor:TColor;
FCondition:String;
FFont:TFont;
procedure SetFont(const Value:TFont);
public
constructor Create;
destructor Destroy; override;
procedure Assign(Source:TPersistent); override;
published
property Active:Boolean read FActive write FActive default False;
property Font:TFont read FFont write SetFont;
property Color:TColor read FColor write FColor default clTransparent;
property Condition:String read FCondition write FCondition;
end;
TfrxFormat = class(TPersistent)
private
FDecimalSeparator:String;
FFormatStr:String;
FKind:TfrxFormatKind;
public
procedure Assign(Source:TPersistent); override;
published
property DecimalSeparator:String read FDecimalSeparator write FDecimalSeparator;
property FormatStr:String read FFormatStr write FFormatStr;
property Kind:TfrxFormatKind read FKind write FKind default fkText;
end;
TfrxCustomMemoView = class(TfrxStretcheable)
private
FAllowExpressions:Boolean;
FAllowHTMLTags:Boolean;
FAutoWidth:Boolean;
FCharSpacing:Extended;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -