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

📄 flexcontrols.hpp

📁 FlexGraphics是一套创建矢量图形的VCL组件
💻 HPP
📖 第 1 页 / 共 3 页
字号:
	Flexprops::TLineCapProp* FEndCapProp;
	Flexprops::TDataProp* FPointsProp;
	Flexprops::TDataProp* FPathPointsProp;
	Flexprops::TBoolProp* FIsSolidProp;
	
protected:
	DynamicArray<Windows::TPoint >  FPoints;
	bool FZeroPoints;
	DynamicArray<Flexpath::TPointType >  FPointTypes;
	bool FChanging;
	Flexpath::TPathInfo FCurveInfo;
	bool FCurveInfoChanged;
	DynamicArray<Windows::TPoint >  FResizePoints;
	virtual void __fastcall CreateProperties(void);
	virtual void __fastcall ControlCreate(void);
	virtual void __fastcall ControlDestroy(void);
	virtual void __fastcall ControlTranslate(const Flexutils::TTranslateInfo &TranslateInfo);
	virtual void __fastcall CreateInDesign(Flexbase::TFlexCreateInDesignInfo &Info);
	virtual void __fastcall MirrorInResize(bool HMirror, bool VMirror);
	virtual bool __fastcall MovePathPoints(int PointIndex, Windows::TPoint &Delta, Flexpath::TSelectedArray 
		Selected, bool Smooth, bool Symmetric);
	virtual bool __fastcall MovePathSegment(int FirstIndex, int NextIndex, Windows::TPoint &Delta, const 
		double SegmentCurvePos);
	virtual Flexactions::TPointsHistoryAction* __fastcall RecordPointsAction(void);
	virtual Windows::TPoint __fastcall GetPoint(int Index);
	virtual int __fastcall GetPointCount(void);
	virtual void __fastcall SetPoint(int Index, const Windows::TPoint &Value);
	virtual Flexpath::TPointType __fastcall GetPointType(int Index);
	virtual void __fastcall SetPointType(int Index, const Flexpath::TPointType Value);
	virtual void __fastcall PointsChanged(void);
	virtual Windows::TPoint __fastcall GetAnchorPoint();
	virtual void __fastcall StartResizing(const Windows::TRect &SelRect);
	virtual void __fastcall FinishResizing(void);
	virtual void __fastcall Paint(Graphics::TCanvas* Canvas, Windows::TRect &PaintRect);
	virtual void __fastcall DoNotify(Flexutils::TFlexNotify Notify);
	virtual void __fastcall PropChanged(System::TObject* Sender, Flexprops::TCustomProp* Prop);
	virtual void __fastcall PropStored(System::TObject* Sender, Flexprops::TCustomProp* Prop, bool &IsStored
		, const AnsiString PropName);
	void __fastcall GetPointsData(System::TObject* Sender, Variant &Value);
	void __fastcall SetPointsData(System::TObject* Sender, Variant &Value);
	void __fastcall GetPathPointsData(System::TObject* Sender, Variant &Value);
	void __fastcall SetPathPointsData(System::TObject* Sender, Variant &Value);
	virtual bool __fastcall GetIsPointsClosed(void);
	virtual void __fastcall SetIsPointsClosed(bool Value);
	virtual Windows::TRect __fastcall GetRefreshRect(int RefreshX, int RefreshY);
	int __fastcall InternalInsertPoints(int Index, int Count);
	void __fastcall InternalDeletePoints(int Index, int Count);
	virtual Flexpath::PPathInfo __fastcall GetPointsInfo(void);
	virtual Windows::TPoint __fastcall GetDefaultLinkPoint(int Index);
	virtual int __fastcall GetDefaultLinkPointCount(void);
	
public:
	virtual bool __fastcall EndUpdate(void);
	#pragma option push -w-inl
	/* virtual class method */ virtual Controls::TCursor __fastcall CursorInCreate() { return CursorInCreate(__classid(TFlexCurve)
		); }
	#pragma option pop
	/*         class method */ static Controls::TCursor __fastcall CursorInCreate(TMetaClass* vmt);
	virtual bool __fastcall IsPointInside(int PaintX, int PaintY);
	virtual int __fastcall InsertPoint(int Index, const Windows::TPoint &Point);
	virtual int __fastcall InsertNearestPoint(const Windows::TPoint &Point);
	virtual int __fastcall InsertCurvePoints(int Index, const Windows::TPoint &Point, const Windows::TPoint 
		&CtrlPointA, const Windows::TPoint &CtrlPointB);
	virtual void __fastcall DeletePoint(int Index);
	virtual void __fastcall SetPointsEx(const Flexpath::TPointArray APoints, const Flexpath::TPointTypeArray 
		ATypes);
	virtual void __fastcall GetPointsEx(/* out */ Flexpath::TPointArray &APoints, /* out */ Flexpath::TPointTypeArray 
		&ATypes);
	virtual bool __fastcall FlattenPoints(const float Curvature);
	virtual bool __fastcall FindNearestPoint(const Windows::TPoint &Point, Flexpath::TNearestPoint &Nearest
		);
	virtual bool __fastcall FindNearestPathSegment(const Windows::TPoint &Point, int &FirstIndex, int &
		NextIndex, Flexpath::PNearestPoint Nearest, bool ForInsert, bool ForSelect);
	virtual bool __fastcall EditPoints(Flexpath::TPathEditFunc Func, const Flexpath::TSelectedArray Selected
		, Flexpath::PPathEditParams Params);
	virtual Flexpath::TPathEditFuncs __fastcall EditPointsCaps(const Flexpath::TSelectedArray Selected)
		;
	__property Flexprops::TBrushProp* BrushProp = {read=FBrushProp};
	__property Flexprops::TPenProp* PenProp = {read=FPenProp};
	__property Flexprops::TLineCapProp* BeginCapProp = {read=FBeginCapProp};
	__property Flexprops::TLineCapProp* EndCapProp = {read=FEndCapProp};
	__property Flexprops::TBoolProp* IsSolidProp = {read=FIsSolidProp};
public:
	#pragma option push -w-inl
	/* TFlexControl.Create */ inline __fastcall virtual TFlexCurve(Flexbase::TFlexPanel* AOwner, Flexbase::TFlexControl* 
		AParent, Flexbase::TFlexLayer* ALayer) : Flexbase::TFlexControl(AOwner, AParent, ALayer) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TFlexControl.Destroy */ inline __fastcall virtual ~TFlexCurve(void) { }
	#pragma option pop
	
};


typedef int TTextCharWidth[256];

typedef _ABC TTextCharABCs[256];

struct TTextWordInfo;
typedef TTextWordInfo *PTextWordInfo;

struct TTextWordInfo
{
	int WordBegin;
	int WordEnd;
	int Size;
} ;

struct TTextLine;
typedef TTextLine *PTextLine;

struct TTextLine
{
	char *Text;
	int Length;
	int Pos;
} ;

typedef DynamicArray<TTextWordInfo >  TTextWordInfoArray;

class DELPHICLASS TTextFormator;
class PASCALIMPLEMENTATION TTextFormator : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	#pragma pack(push, 1)
	tagLOGFONTA FLogFont;
	#pragma pack(pop)
	
	bool FLogFontValid;
	int FCharWidth[256];
	_ABC FCharABC[256];
	int FEMSquare;
	double FPixelSize;
	int FHeight;
	int FLineSpace;
	HDC FDC;
	_ABC __fastcall GetCharABC(char AChar);
	int __fastcall GetCharWidth(char AChar);
	
protected:
	tagSIZE FLineSize;
	int FLineLeftSpace;
	int FLineRightSpace;
	bool __fastcall CheckFontIdentical(HDC DC);
	bool __fastcall SkipWhite(TTextLine &Line, bool &NeedBreak);
	void __fastcall GetWord(TTextLine &Line);
	bool __fastcall GetLine(TTextLine &Line, int LineWidth, int &LineBegin, int &LineEnd, bool WordWrap
		);
	void __fastcall LineExtent(char * ALine, int ACount);
	
public:
	bool __fastcall Setup(HDC DC, const double PixelSize, bool DivideOnEMSquare, bool RoundHeight);
	tagSIZE __fastcall CharExtent(char * Text, int CharCount, bool LineBreaks, bool WordWrap, int PaintWidth
		, bool InLogicalUnits, Windows::PInteger LineCount);
	void __fastcall CharWordInfos(char * Text, int CharCount, TTextWordInfoArray &WordInfos, int &WordCount
		, int &WordWidth, bool InLogicalUnits);
	tagSIZE __fastcall TextExtent(const AnsiString Text);
	int __fastcall TextHeight(const AnsiString Text);
	int __fastcall TextWidth(const AnsiString Text);
	void __fastcall TextOut(int X, int Y, const AnsiString Text);
	void __fastcall CharOut(int X, int Y, char * Text, int CharCount);
	void __fastcall TextRect(const Windows::TRect &Rect, const AnsiString Text, bool WordWrap, Classes::TAlignment 
		Align, Stdctrls::TTextLayout ALayout, bool WidthJustify, int LogicalWidth, int Rotation);
	__property int Height = {read=FHeight, nodefault};
	__property int LineSpace = {read=FLineSpace, nodefault};
	__property int EMSquare = {read=FEMSquare, nodefault};
	__property double PixelSize = {read=FPixelSize};
	__property _ABC CharABC[char AChar] = {read=GetCharABC};
	__property int CharWidth[char AChar] = {read=GetCharWidth};
public:
	#pragma option push -w-inl
	/* TObject.Create */ inline __fastcall TTextFormator(void) : System::TObject() { }
	#pragma option pop
	#pragma option push -w-inl
	/* TObject.Destroy */ inline __fastcall virtual ~TTextFormator(void) { }
	#pragma option pop
	
};


class DELPHICLASS TFlexText;
class PASCALIMPLEMENTATION TFlexText : public TFlexBox 
{
	typedef TFlexBox inherited;
	
private:
	Flexprops::TBoolProp* FAutoSizeProp;
	Flexprops::TStrListProp* FTextProp;
	Flexprops::TFontProp* FFontProp;
	Flexprops::TBoolProp* FWordWrapProp;
	Flexprops::TBoolProp* FGrayedProp;
	Flexprops::TEnumProp* FAlignmentProp;
	Flexprops::TEnumProp* FLayoutProp;
	Flexprops::TIntProp* FAngleProp;
	Flexprops::TBoolProp* FPreciseProp;
	Flexprops::TBoolProp* FPreciseJustifyProp;
	Flexprops::TBoolProp* FAutoScaleFontSizeProp;
	Flexprops::TIntProp* FMaxFontSizeProp;
	bool FAutoSizeChanging;
	Classes::TAlignment __fastcall GetAlignment(void);
	Stdctrls::TTextLayout __fastcall GetLayout(void);
	bool __fastcall GetWordWrap(void);
	void __fastcall SetAlignment(const Classes::TAlignment Value);
	void __fastcall SetLayout(const Stdctrls::TTextLayout Value);
	void __fastcall SetWordWrap(const bool Value);
	bool __fastcall GetGrayed(void);
	void __fastcall SetGrayed(const bool Value);
	tagSIZE __fastcall GetTextSize();
	
protected:
	TTextFormator* FFormator;
	Windows::TRect FRefreshRect;
	int FRefreshScale;
	void __fastcall GetLeftRightExtra(HDC DC, int &Left, int &Right);
	void __fastcall DoDrawText(Graphics::TCanvas* Canvas, Windows::TRect &Rect, int Flags, const AnsiString 
		Text);
	virtual void __fastcall CreateProperties(void);
	virtual void __fastcall ControlCreate(void);
	virtual void __fastcall ControlDestroy(void);
	virtual void __fastcall ControlTranslate(const Flexutils::TTranslateInfo &TranslateInfo);
	virtual Flexbase::TFlexControl* __fastcall CreateCurveControl(void);
	virtual void __fastcall Paint(Graphics::TCanvas* Canvas, Windows::TRect &PaintRect);
	virtual void __fastcall PropChanged(System::TObject* Sender, Flexprops::TCustomProp* Prop);
	virtual void __fastcall PropStored(System::TObject* Sender, Flexprops::TCustomProp* Prop, bool &IsStored
		, const AnsiString PropName);
	virtual Windows::TRect __fastcall GetRefreshRect(int RefreshX, int RefreshY);
	void __fastcall AutoSizeChanged(void);
	__property tagSIZE TextSize = {read=GetTextSize};
	
public:
	#pragma option push -w-inl
	/* virtual class method */ virtual Controls::TCursor __fastcall CursorInCreate() { return CursorInCreate(__classid(TFlexText)
		); }
	#pragma option pop
	/*         class method */ static Controls::TCursor __fastcall CursorInCreate(TMetaClass* vmt);
	void __fastcall DrawTextEx(Graphics::TCanvas* Canvas, Windows::TRect &R, bool CalcOnly, bool Scaled
		, const AnsiString AText, Classes::TAlignment AAlignment, Stdctrls::TTextLayout ALayout, bool AWordWrap

⌨️ 快捷键说明

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