📄 flexcontrols.hpp
字号:
Flexprops::TLineCapProp* FBeginCapProp;
Flexprops::TLineCapProp* FEndCapProp;
Flexprops::TDataProp* FPointsProp;
Flexprops::TDataProp* FPathPointsProp;
Flexprops::TBoolProp* FIsSolidProp;
protected:
DynamicArray<Types::TPoint > FPoints;
bool FZeroPoints;
DynamicArray<Flexpath::TPointType > FPointTypes;
bool FChanging;
Flexpath::TPathInfo FCurveInfo;
bool FCurveInfoChanged;
DynamicArray<Types::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, Types::TPoint &Delta, Flexpath::TSelectedArray Selected, bool Smooth = false, bool Symmetric = false);
virtual bool __fastcall MovePathSegment(int FirstIndex, int NextIndex, Types::TPoint &Delta, const double SegmentCurvePos);
virtual Flexactions::TPointsHistoryAction* __fastcall RecordPointsAction(void);
virtual Types::TPoint __fastcall GetPoint(int Index);
virtual int __fastcall GetPointCount(void);
virtual void __fastcall SetPoint(int Index, const Types::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 Types::TPoint __fastcall GetAnchorPoint();
virtual void __fastcall StartResizing(const Types::TRect &SelRect);
virtual void __fastcall FinishResizing(void);
virtual void __fastcall Paint(Graphics::TCanvas* Canvas, Types::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 Types::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 Types::TPoint __fastcall GetDefaultLinkPoint(int Index);
virtual int __fastcall GetDefaultLinkPointCount(void);
public:
virtual bool __fastcall EndUpdate(void);
/* virtual class method */ virtual Controls::TCursor __fastcall CursorInCreate(TMetaClass* vmt);
virtual bool __fastcall IsPointInside(int PaintX, int PaintY);
virtual int __fastcall InsertPoint(int Index, const Types::TPoint &Point);
virtual int __fastcall InsertNearestPoint(const Types::TPoint &Point);
virtual int __fastcall InsertCurvePoints(int Index, const Types::TPoint &Point, const Types::TPoint &CtrlPointA, const Types::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 Types::TPoint &Point, Flexpath::TNearestPoint &Nearest);
virtual bool __fastcall FindNearestPathSegment(const Types::TPoint &Point, int &FirstIndex, int &NextIndex, Flexpath::PNearestPoint Nearest = (void *)(0x0), bool ForInsert = true, bool ForSelect = false);
virtual bool __fastcall EditPoints(Flexpath::TPathEditFunc Func, const Flexpath::TSelectedArray Selected, Flexpath::PPathEditParams Params = (void *)(0x0));
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
{
public:
int WordBegin;
int WordEnd;
int Size;
} ;
struct TTextLine;
typedef TTextLine *PTextLine;
struct TTextLine
{
public:
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:
#pragma pack(push,1)
tagSIZE FLineSize;
#pragma pack(pop)
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 = false, bool RoundHeight = true);
tagSIZE __fastcall CharExtent(char * Text, int CharCount, bool LineBreaks = false, bool WordWrap = false, int PaintWidth = 0x0, bool InLogicalUnits = false, System::PInteger LineCount = (void *)(0x0));
void __fastcall CharWordInfos(char * Text, int CharCount, TTextWordInfoArray &WordInfos, int &WordCount, int &WordWidth, bool InLogicalUnits = false);
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 Types::TRect &Rect, const AnsiString Text, bool WordWrap, Classes::TAlignment Align = (Classes::TAlignment)(0x0), Stdctrls::TTextLayout ALayout = (Stdctrls::TTextLayout)(0x0), bool WidthJustify = false, int LogicalWidth = 0x0, int Rotation = 0x0);
__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;
#pragma pack(push,1)
Types::TRect FRefreshRect;
#pragma pack(pop)
int FRefreshScale;
void __fastcall GetLeftRightExtra(HDC DC, int &Left, int &Right);
void __fastcall DoDrawText(Graphics::TCanvas* Canvas, Types::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, Types::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 Types::TRect __fastcall GetRefreshRect(int RefreshX, int RefreshY);
void __fastcall AutoSizeChanged(void);
__property tagSIZE TextSize = {read=GetTextSize};
public:
/* virtual class method */ virtual Controls::TCursor __fastcall CursorInCreate(TMetaClass* vmt);
void __fastcall DrawTextEx(Graphics::TCanvas* Canvas, Types::TRect &R, bool CalcOnly, bool Scaled, const AnsiString AText, Classes::TAlignment AAlignment, Stdctrls::TTextLayout ALayout, bool AWordWrap, bool APrecise, bool APreciseJustify, int LogSize = 0x0, int AFontHeight = 0x0);
virtual void __fastcall DrawTextCpp(Graphics::TCanvas* Canvas, Types::TRect &R, bool CalcOnly, bool Scaled);
__property TTextFormator* Formator = {read=FFormator};
__property Flexprops::TBoolProp* AutoSizeProp = {read=FAutoSizeProp};
__property Flexprops::TStrListProp* TextProp = {read=FTextProp};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -