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

📄 aafont.hpp

📁 是一个免费并开源的支持农历的月历控件
💻 HPP
📖 第 1 页 / 共 3 页
字号:
	TUserLabel* __fastcall AddItem(AnsiString AName, AnsiString AText, TLabelStyle AStyle);
	int __fastcall IndexOf(const AnsiString Name);
	void __fastcall Check(AnsiString &AText, Classes::TAlignment &Align);
	__property TUserLabel* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
	__property Classes::TNotifyEvent OnChanged = {read=FOnChanged, write=FOnChanged};
public:
	#pragma option push -w-inl
	/* TCollection.Destroy */ inline __fastcall virtual ~TUserLabels(void) { }
	#pragma option pop
	
};


class DELPHICLASS TPackParam;
class PASCALIMPLEMENTATION TPackParam : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	Controls::TControl* FOwner;
	
protected:
	__property Controls::TControl* Owner = {read=FOwner};
	
public:
	__fastcall virtual TPackParam(Controls::TControl* AOwner);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TPackParam(void) { }
	#pragma option pop
	
};


class DELPHICLASS TDrag;
class PASCALIMPLEMENTATION TDrag : public TPackParam 
{
	typedef TPackParam inherited;
	
private:
	Controls::TCursor __fastcall GetDragCursor(void);
	Controls::TDragKind __fastcall GetDragKind(void);
	Controls::TDragMode __fastcall GetDragMode(void);
	void __fastcall SetDragCursor(const Controls::TCursor Value);
	void __fastcall SetDragKind(const Controls::TDragKind Value);
	void __fastcall SetDragMode(const Controls::TDragMode Value);
	
__published:
	__property Controls::TDragKind DragKind = {read=GetDragKind, write=SetDragKind, default=0};
	__property Controls::TCursor DragCursor = {read=GetDragCursor, write=SetDragCursor, default=-12};
	__property Controls::TDragMode DragMode = {read=GetDragMode, write=SetDragMode, default=0};
public:
	#pragma option push -w-inl
	/* TPackParam.Create */ inline __fastcall virtual TDrag(Controls::TControl* AOwner) : TPackParam(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TDrag(void) { }
	#pragma option pop
	
};


class DELPHICLASS TParentEffect;
class PASCALIMPLEMENTATION TParentEffect : public TPackParam 
{
	typedef TPackParam inherited;
	
private:
	bool __fastcall GetParentBiDiMode(void);
	bool __fastcall GetParentColor(void);
	bool __fastcall GetParentFont(void);
	bool __fastcall GetParentShowHint(void);
	void __fastcall SetParentBiDiMode(const bool Value);
	void __fastcall SetParentColor(const bool Value);
	void __fastcall SetParentFont(const bool Value);
	void __fastcall SetParentShowHint(const bool Value);
	
protected:
	__property bool ParentBiDiMode = {read=GetParentBiDiMode, write=SetParentBiDiMode, default=1};
	
__published:
	__property bool ParentColor = {read=GetParentColor, write=SetParentColor, default=1};
	__property bool ParentFont = {read=GetParentFont, write=SetParentFont, default=1};
	__property bool ParentShowHint = {read=GetParentShowHint, write=SetParentShowHint, default=1};
public:
	#pragma option push -w-inl
	/* TPackParam.Create */ inline __fastcall virtual TParentEffect(Controls::TControl* AOwner) : TPackParam(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TPersistent.Destroy */ inline __fastcall virtual ~TParentEffect(void) { }
	#pragma option pop
	
};


#pragma option push -b-
enum TBackGroundMode { bmTiled, bmStretched, bmCenter, bmNormal };
#pragma option pop

class DELPHICLASS TCustomParam;
class DELPHICLASS TAAGraphicControl;
typedef Byte TProgress;

class PASCALIMPLEMENTATION TAAGraphicControl : public Controls::TGraphicControl 
{
	typedef Controls::TGraphicControl inherited;
	
private:
	TAAFontEx* FAAFont;
	Classes::TNotifyEvent FOnMouseLeave;
	Classes::TNotifyEvent FOnMouseEnter;
	bool FAutoUpdate;
	TDrag* FDrag;
	TParentEffect* FParentEffect;
	int FUpdateCount;
	Controls::TBorderWidth FBorder;
	bool Inited;
	bool Drawing;
	int AHeight;
	int AWidth;
	void __fastcall SetBorder(const Controls::TBorderWidth Value);
	void __fastcall SetDrag(const TDrag* Value);
	void __fastcall SetParentEffect(const TParentEffect* Value);
	AnsiString __fastcall GetWrapText(const AnsiString Line, const AnsiString BreakStr, const Sysutils::TSysCharSet &BreakChars, int MaxCol);
	void __fastcall SetAutoUpdate(const bool Value);
	
protected:
	virtual void __fastcall SetAutoSize(bool Value);
	void __fastcall OnEffectChanged(System::TObject* Sender);
	void __fastcall CopyParentImage(Graphics::TCanvas* Dest);
	void __fastcall WrapText(const AnsiString S, Classes::TStrings* Strs, int Col);
	void __fastcall Blend(Graphics::TBitmap* DesBmp, Graphics::TBitmap* BkBmp, Graphics::TBitmap* ForeBmp, TProgress AProgress);
	void __fastcall DrawTiled(Graphics::TCanvas* Canvas, const Types::TRect &Rect, Graphics::TGraphic* G);
	void __fastcall DrawBackGround(Graphics::TCanvas* Canvas, const Types::TRect &Rect, Graphics::TGraphic* G, TBackGroundMode Mode);
	virtual void __fastcall WndProc(Messages::TMessage &message);
	virtual void __fastcall PaintCanvas(void);
	virtual void __fastcall Paint(void);
	virtual void __fastcall Loaded(void);
	virtual void __fastcall LoadedEx(void);
	virtual void __fastcall Reset(void);
	DYNAMIC void __fastcall Resize(void);
	__property int UpdateCount = {read=FUpdateCount, nodefault};
	__property TAAFontEx* AAFont = {read=FAAFont};
	__property AutoSize  = {default=1};
	__property bool AutoUpdate = {read=FAutoUpdate, write=SetAutoUpdate, default=1};
	__property Controls::TBorderWidth Border = {read=FBorder, write=SetBorder, default=0};
	
public:
	__fastcall virtual TAAGraphicControl(Classes::TComponent* AOwner);
	__fastcall virtual ~TAAGraphicControl(void);
	__property Canvas ;
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	HIDESBASE void __fastcall Changed(void);
	
__published:
	__property TDrag* Drag = {read=FDrag, write=SetDrag};
	__property TParentEffect* ParentEffect = {read=FParentEffect, write=SetParentEffect};
	__property Align  = {default=0};
	__property Anchors  = {default=3};
	__property Constraints ;
	__property Enabled  = {default=1};
	__property ShowHint ;
	__property Hint ;
	__property PopupMenu ;
	__property Visible  = {default=1};
	__property OnClick ;
	__property OnContextPopup ;
	__property OnDblClick ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDock ;
	__property OnEndDrag ;
	__property OnMouseDown ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property Classes::TNotifyEvent OnMouseEnter = {read=FOnMouseEnter, write=FOnMouseEnter};
	__property Classes::TNotifyEvent OnMouseLeave = {read=FOnMouseLeave, write=FOnMouseLeave};
	__property OnStartDock ;
	__property OnStartDrag ;
};


class PASCALIMPLEMENTATION TCustomParam : public TNotifyClass 
{
	typedef TNotifyClass inherited;
	
private:
	Classes::TAlignment FAlignment;
	bool FWordWrap;
	bool FTransparent;
	Stdctrls::TTextLayout FLayout;
	TAAGraphicControl* FOwner;
	Graphics::TPicture* FBackGround;
	TBackGroundMode FBackGroundMode;
	void __fastcall BackGroundChanged(System::TObject* Sender);
	void __fastcall SetAlignment(const Classes::TAlignment Value);
	void __fastcall SetLayout(const Stdctrls::TTextLayout Value);
	void __fastcall SetTransparent(const bool Value);
	void __fastcall SetWordWrap(const bool Value);
	void __fastcall SetQuality(const TAAQuality Value);
	void __fastcall SetFontEffect(const TAAEffect* Value);
	TAAQuality __fastcall GetQuality(void);
	TAAEffect* __fastcall GetFontEffect(void);
	Graphics::TColor __fastcall GetColor(void);
	Graphics::TFont* __fastcall GetFont(void);
	void __fastcall SetColor(const Graphics::TColor Value);
	void __fastcall SetFont(const Graphics::TFont* Value);
	void __fastcall SetBackGround(const Graphics::TPicture* Value);
	void __fastcall SetBackGroundMode(const TBackGroundMode Value);
	bool __fastcall IsColorStroed(void);
	
protected:
	bool __fastcall IsBackEmpty(void);
	__property TAAGraphicControl* Owner = {read=FOwner};
	__property Graphics::TFont* Font = {read=GetFont, write=SetFont};
	__property TAAQuality Quality = {read=GetQuality, write=SetQuality, default=1};
	__property Classes::TAlignment Alignment = {read=FAlignment, write=SetAlignment, default=0};
	__property Stdctrls::TTextLayout Layout = {read=FLayout, write=SetLayout, default=0};
	__property bool WordWrap = {read=FWordWrap, write=SetWordWrap, default=0};
	__property bool Transparent = {read=FTransparent, write=SetTransparent, default=0};
	__property TAAEffect* FontEffect = {read=GetFontEffect, write=SetFontEffect};
	__property Graphics::TPicture* BackGround = {read=FBackGround, write=SetBackGround};
	__property TBackGroundMode BackGroundMode = {read=FBackGroundMode, write=SetBackGroundMode, default=2};
	__property Graphics::TColor BackColor = {read=GetColor, write=SetColor, stored=IsColorStroed, nodefault};
	
public:
	__fastcall virtual TCustomParam(TAAGraphicControl* AOwner, Classes::TNotifyEvent ChangedProc);
	__fastcall virtual ~TCustomParam(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
};


#pragma option push -b-
enum TLabelEffect { leOnlyALine, leUntilNextLabel };
#pragma option pop

typedef short TRowPitch;

class DELPHICLASS TCustomTextParam;
class PASCALIMPLEMENTATION TCustomTextParam : public TCustomParam 
{
	typedef TCustomParam inherited;
	
private:
	Classes::TStrings* FLines;
	TLabelEffect FLabelEffect;
	TRowPitch FRowPitch;
	TAAEffect* FFontEffect;
	void __fastcall LinesChanged(System::TObject* Sender);
	void __fastcall SetLines(const Classes::TStrings* Value);
	void __fastcall SetLabelEffect(const TLabelEffect Value);
	void __fastcall SetRowPitch(const TRowPitch Value);
	HIDESBASE void __fastcall SetFontEffect(const TAAEffect* Value);
	
protected:
	virtual bool __fastcall IsLinesStored(void);
	__property Classes::TStrings* Lines = {read=FLines, write=SetLines, stored=IsLinesStored};
	__property TRowPitch RowPitch = {read=FRowPitch, write=SetRowPitch, default=20};
	__property TLabelEffect LabelEffect = {read=FLabelEffect, write=SetLabelEffect, default=1};
	__property TAAEffect* FontEffect = {read=FFontEffect, write=SetFontEffect};
	
public:
	__fastcall virtual TCustomTextParam(TAAGraphicControl* AOwner, Classes::TNotifyEvent ChangedProc);
	__fastcall virtual ~TCustomTextParam(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
};


class DELPHICLASS TAACustomText;
class PASCALIMPLEMENTATION TAACustomText : public TAAGraphicControl 
{
	typedef TAAGraphicControl inherited;
	
private:
	TFontLabels* FFonts;
	Classes::TNotifyEvent FOnTextReady;
	Classes::TNotifyEvent FOnComplete;
	Classes::TNotifyEvent FOnPainted;
	TUserLabels* FLabels;
	bool FLabelsInited;
	bool FFontsInited;
	void __fastcall SetFonts(const TFontLabels* Value);
	void __fastcall SetLabels(const TUserLabels* Value);
	
protected:
	virtual void __fastcall CreateDefLabels(void);
	virtual void __fastcall CreateDefFonts(void);
	void __fastcall CreateDefault(void);
	virtual bool __fastcall UseDefaultLabels(void);
	virtual void __fastcall LoadedEx(void);
	void __fastcall OnLabelChanged(System::TObject* Sender);
	__property Classes::TNotifyEvent OnComplete = {read=FOnComplete, write=FOnComplete};
	__property Classes::TNotifyEvent OnTextReady = {read=FOnTextReady, write=FOnTextReady};
	__property Classes::TNotifyEvent OnPainted = {read=FOnPainted, write=FOnPainted};
	
public:
	__fastcall virtual TAACustomText(Classes::TComponent* AOwner);
	__fastcall virtual ~TAACustomText(void);
	
__published:
	__property TFontLabels* Fonts = {read=FFonts, write=SetFonts};
	__property TUserLabels* Labels = {read=FLabels, write=SetLabels};
};


//-- var, const, procedure ---------------------------------------------------
static const Byte csMaxProgress = 0xff;
extern PACKAGE int HSLRange;
extern PACKAGE Graphics::TColor __fastcall HSLtoRGB(double H, double S, double L);
extern PACKAGE Graphics::TColor __fastcall HSLRangeToRGB(int H, int S, int L);
extern PACKAGE void __fastcall RGBtoHSL(Graphics::TColor RGB, double &H, double &S, double &L);
extern PACKAGE void __fastcall RGBtoHSLRange(Graphics::TColor RGB, int &H, int &S, int &L);

}	/* namespace Aafont */
using namespace Aafont;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// AAFont

⌨️ 快捷键说明

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