📄 erpreportcontrol.h
字号:
END_MESSAGE_MAP(TScrollingWinControl);
};
//-----------------------------------------------------------------------
//TRptControl
//TRptComponent
//-----------------------------------------------------------------------
class TRptComponent : public TObject
{
friend TRptLines;
friend TReport;
friend TRptControl;
friend TRptContainer;
friend TRptComponentList;
friend TRptCell;
friend TBillReport;
private:
TCanvas *FCanvas;
TRptGlobalInfo *FGlobalInfo;
TRptComponent * FOwner;
TReport * FReport;
TRptComponent * __fastcall GetChild(int Index);
void __fastcall SetChild(int Index, TRptComponent * AChild);
int __fastcall GetChildCount();
char * __fastcall FindField(char * c, bool head);
AnsiString __fastcall GetFieldValue(char * c1, char * c2);
protected:
double FTempPageHeight;
TRptComponentList *FChild;
bool FActive;
TRect FRect;
int AddRecordCount;
//output fuction
int __fastcall TextHeight(const AnsiString Value);
int __fastcall TextWidth(const AnsiString Value);
void __fastcall TextOut(int x, int y, const AnsiString Value);
void __fastcall Line(int x0, int y0, int x1, int y1,int width, int Style);
void __fastcall SetFont(TFont *AFont);
void __fastcall DrawFocusRect(TRect Rect);
void __fastcall ReDraw();
//下面是用于输出的函数
virtual void __fastcall SetCanvas(TCanvas * ACanvas) = 0;
virtual void __fastcall SetGlobalInfo(TRptGlobalInfo * AGlobalInfo) = 0;
AnsiString __fastcall SetRecord(const AnsiString Value);
virtual bool __fastcall GetMouseOn() = 0;
virtual double __fastcall DrawHeight() = 0; // 绘图高度
virtual int __fastcall Select(int Top, int Left, TRect Rect) = 0;
virtual int __fastcall GetWidth() = 0;
virtual void __fastcall SetWidth(int Width) = 0;
virtual int __fastcall GetHeight() = 0;
virtual void __fastcall SetHeight(int Height) = 0;
virtual void __fastcall Assign(TRptComponent* AObject);
virtual void __fastcall UpdatePosition(double Top, double Left, double MinHeight) = 0;
virtual void __fastcall Draw() = 0;
virtual void __fastcall MouseMove(int MouseX, int MouseY) = 0;
virtual void __fastcall MouseDown(int MouseX, int MouseY) = 0;
virtual void __fastcall MouseUp(int MouseX, int MouseY) = 0;
virtual void __fastcall Click() = 0;
virtual void __fastcall DblClick() = 0;
virtual void __fastcall Drag(TPoint Start, TPoint End) = 0;
virtual void __fastcall SetCondition(AnsiString Value) = 0;
virtual void __fastcall AssignActive(TRptComponent* ASource) = 0;
virtual void __fastcall DeleteActive() = 0;
virtual void __fastcall SetActive(bool Active) = 0;
virtual void __fastcall Adjust() = 0;
virtual int __fastcall GetPageHeight() = 0;
virtual TRptComponent* __fastcall Clone(TRptComponent * AOwner) = 0;
virtual void __fastcall LastVariable() = 0;
virtual void __fastcall DrawContainRelation() = 0;
virtual void __fastcall FirstRecord() = 0;
virtual void __fastcall AddRecord() = 0;
virtual void __fastcall LastRecord() = 0;
__property bool Active = {read = FActive, write = SetActive};
public:
__fastcall TRptComponent(TRptComponent *AOwner, TReport *AReport);
__fastcall ~TRptComponent();
virtual void __fastcall Delete(TRptComponent *AObject) = 0;
void __fastcall InsertChild(int Index, TRptComponent* AChild);
AnsiString Condition;
TRptContainerType ContainerType;
int CoteNum;
virtual void __fastcall VDivide() = 0;
virtual void __fastcall HDivide() = 0;
virtual void __fastcall LoadFromStream();
virtual void __fastcall SaveToStream();
//属性
__property TRptComponent * Owner = {read=FOwner};
__property int ChildCount = {read=GetChildCount};
__property TRptComponent * Child[int Index] = {read=GetChild, write=SetChild};
__property int Width = {read=GetWidth, write= SetWidth};
__property int Height = {read = GetHeight, write = SetHeight};
__property TReport * Report = {read= FReport};
__property bool MouseOn = {read=GetMouseOn};
__property TCanvas * Canvas = {read=FCanvas, write=SetCanvas};
__property TRptGlobalInfo * GlobalInfo = {read=FGlobalInfo, write=SetGlobalInfo};
};
//------------------------------------------------------------------------
//TRptComponent
//TRptContainer
//------------------------------------------------------------------------
class TRptContainer : public TRptComponent
{
friend TRptControl;
friend TReport;
friend TBillReport;
private:
TRptPattern FPattern;
bool FInSinglePage;
bool __fastcall GetMouseOn();
void __fastcall DoSthing(int Sthing, int Top, int Left, int MinHeight, int MouseX, int MouseY);
AnsiString FOldCondition;
void __fastcall SetCanvas(TCanvas * ACanvas);
void __fastcall SetGlobalInfo(TRptGlobalInfo * AGlobalInfo);
void __fastcall HalfHeight();
void __fastcall HalfWidth();
protected:
int __fastcall Select(int Top, int Left, TRect Rect);
int __fastcall GetWidth();
void __fastcall SetWidth(int Width);
int __fastcall GetHeight();
void __fastcall SetHeight(int Height);
void __fastcall MouseMove(int MouseX, int MouseY);
void __fastcall MouseDown(int MouseX, int MouseY);
void __fastcall MouseUp(int MouseX, int MouseY);
void __fastcall Click();
void __fastcall DblClick();
void __fastcall Drag(TPoint Start, TPoint End);
void __fastcall SetActive(bool Active);
void __fastcall Adjust();
TRptComponent* __fastcall Clone(TRptComponent * AOwner);
void __fastcall DrawContainRelation();
void __fastcall FirstRecord();
void __fastcall AddRecord();
void __fastcall LastRecord();
void __fastcall LastVariable();
void __fastcall AssignActive(TRptComponent* ASource);
void __fastcall DeleteActive();
public:
__fastcall TRptContainer(TRptComponent *AOwner, TReport *AReport);
__fastcall ~TRptContainer();
void __fastcall Optimize();
void __fastcall Delete(TRptComponent *AObject);
void __fastcall SetCondition(AnsiString Value);
void __fastcall Assign(TRptComponent* AObject);
void __fastcall VDivide();
void __fastcall HDivide();
void __fastcall UpdatePosition(double Top, double Left, double MinHeight);
double __fastcall DrawHeight();
void __fastcall Draw();
int __fastcall GetPageHeight();
void __fastcall LoadFromStream();
void __fastcall SaveToStream();
__property TRptPattern Pattern = {read=FPattern, write=FPattern};
__property bool InSinglePage = {read=FInSinglePage, write=FInSinglePage};
};
//-------------------------------------------------------------------------
//TRptContainer
//TRptCell
//-------------------------------------------------------------------------
class TRptCell : public TRptComponent
{
friend TRptLines;
friend TReport;
private:
double FWidth;
double FHeight;
AnsiString FValue;
AnsiString FDrawValue;
TRptLines * FLines;
TFont * FFont;
bool FFLastVariable;
void __fastcall SetCanvas(TCanvas * ACanvas);
void __fastcall SetGlobalInfo(TRptGlobalInfo * AGlobalInfo);
int __fastcall TestDrawTextWidth(AnsiString Value);
bool __fastcall GetMouseOn();
bool FMouseOn;
bool FSelected;
void __fastcall AssignActive(TRptComponent* ASource);
void __fastcall DeleteActive();
void __fastcall SetActive(bool Active);
void __fastcall Adjust();
int __fastcall GetPageHeight();
protected:
void __fastcall Draw();
double __fastcall DrawHeight(); // 绘图高度
void __fastcall FirstRecord();
void __fastcall AddRecord();
void __fastcall LastRecord();
int __fastcall Select(int Top, int Left, TRect Rect);
int __fastcall GetWidth();
void __fastcall SetWidth(int Width);
int __fastcall GetHeight();
void __fastcall SetHeight(int Height);
void __fastcall UpdatePosition(double Top, double Left, double MinHeight);
void __fastcall MouseMove(int MouseX, int MouseY);
void __fastcall MouseDown(int MouseX, int MouseY);
void __fastcall MouseUp(int MouseX, int MouseY);
void __fastcall Click();
void __fastcall DblClick();
void __fastcall Drag(TPoint Start, TPoint End);
void __fastcall Delete(TRptComponent *AObject);
void __fastcall LastVariable();
TRptComponent* __fastcall Clone(TRptComponent * AOwner);
void __fastcall DrawContainRelation();
public:
__fastcall TRptCell(TRptComponent * AOwner, TReport * AReport);
__fastcall ~TRptCell();
void __fastcall Assign(TRptComponent* AObject);
void __fastcall VDivide();
void __fastcall HDivide();
void __fastcall SetCondition(AnsiString Value);
void __fastcall LoadFromStream();
void __fastcall SaveToStream();
TRptAlign VAlign;
TRptAlign HAlign;
__property AnsiString Value = {read=FValue, write=FValue};
__property TFont* Font = {read=FFont};
__property TRptLines *Lines = {read=FLines};
__property double mmHeight = {read=FHeight, write=FHeight};
};
//---------------------------------------------------------------------
//TRptCell
//TRptField
//---------------------------------------------------------------------
class TRptField : public TObject
{
private:
TRptFields *FOwner;
AnsiString FFieldName;
TRptFieldType FFieldType;
AnsiString FValue;
protected:
public:
__fastcall TRptField(TRptFields* AOwner, AnsiString FieldName, TRptFieldType FieldType);
__fastcall ~TRptField(void);
AnsiString Name;
AnsiString Desc;
int Width;
int Scale;
__property AnsiString FieldName = {read=FFieldName};
__property TRptFieldType FieldType = {read=FFieldType};
__property AnsiString Value = {read=FValue, write=FValue};
};
//----------------------------------------------------------------------
//TRptField
//TRptVariable
//----------------------------------------------------------------------
class TRptVariable : public TObject
{
private:
TRptVariables *FOwner;
AnsiString FVariableName;
TRptFieldType FVariableType;
AnsiString FValue;
AnsiString FCondition;
AnsiString FOldCondition;
AnsiString FContext;
AnsiString FClearCondition;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -