advsmoothcalendar.hpp

来自「TMSPack基本上涵盖了Delphi所有的基础控件」· HPP 代码 · 共 565 行 · 第 1/2 页

HPP
565
字号
	System::TDateTime FEndDate;
	TAdvSmoothCalendarDateRange FSelectedDateRange;
	System::TDateTime FHoverDate;
	System::TDateTime FFocusDate;
	System::TDateTime FSelectedDate;
	System::TDateTime FCurrentDate;
	Gdipfill::TGDIPFill* FFill;
	bool FTransparent;
	TAdvSmoothCalendarHeader* FHeader;
	int FNextYearFrom;
	int FNextYearTo;
	int FCurrentYearFrom;
	int FCurrentYearTo;
	int FNextYear;
	int FCurrentYear;
	int FYear;
	int FNextMonth;
	int FCurrentMonth;
	int FMonth;
	int FCurrentDay;
	TAdvSmoothCalendarDateAppearance* FDateAppearance;
	TAdvSmoothCalendarFooter* FFooter;
	bool FAnimation;
	TAdvSmoothCalendarDateSelectedEvent FOnSelectDate;
	TAdvSmoothCalendarDateModeChangedEvent FOnDateModeChanged;
	TAdvSmoothCalendarYearChangedEvent FOnYearChanged;
	TAdvSmoothCalendarMonthChangedEvent FOnMonthChanged;
	TAdvSmoothCalendarYearRangeChangedEvent FOnYearRangeChanged;
	bool FShowFocus;
	Graphics::TColor FFocusColor;
	bool FMultiSelect;
	TAdvSmoothCalendarMultiDateSelectedEvent FOnSelectMultiDate;
	bool FShowCurrentDate;
	bool FKeyBoardDateModeToggle;
	TAdvSmoothCalendarCurrentDayClickEvent FOnCurrentDayClick;
	TDate FMaxDate;
	TDate FMinDate;
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	void __fastcall SetFill(const Gdipfill::TGDIPFill* Value);
	void __fastcall SetTransparent(const bool Value);
	void __fastcall SetHeader(const TAdvSmoothCalendarHeader* Value);
	void __fastcall SetMonth(const int Value);
	void __fastcall SetYear(const int Value);
	void __fastcall SetDateAppearance(const TAdvSmoothCalendarDateAppearance* Value);
	void __fastcall SetFooter(const TAdvSmoothCalendarFooter* Value);
	void __fastcall SetAnimation(const bool Value);
	void __fastcall SetShowFocus(const bool Value);
	void __fastcall SetFocusColor(const Graphics::TColor Value);
	void __fastcall SetMultiSelect(const bool Value);
	void __fastcall SetEndDate(const System::TDateTime Value);
	void __fastcall SetSelectedDate(const System::TDateTime Value);
	void __fastcall SetStartDate(const System::TDateTime Value);
	void __fastcall SetHoveredDate(const System::TDateTime Value);
	void __fastcall SetShowCurrentDate(const bool Value);
	void __fastcall SetKeyBoardDateModeToggle(const bool Value);
	bool __fastcall DoStoreMaxDate(void);
	bool __fastcall DoStoreMinDate(void);
	void __fastcall SetMaxDate(const TDate Value);
	void __fastcall SetMinDate(const TDate Value);
	
protected:
	HIDESBASE void __fastcall Changed(void);
	void __fastcall DoChangeMode(System::TObject* Sender, TAdvSmoothCalendarDateMode Mode, TAdvSmoothCalendarDateMode ModeTo, bool &allow);
	void __fastcall DoSelectDate(System::TObject* Sender, TAdvSmoothCalendarDateMode Mode, System::TDateTime Date);
	void __fastcall DoSelectMultiDate(System::TObject* Sender, TAdvSmoothCalendarDateMode Mode, System::TDateTime StartDate, System::TDateTime EndDate);
	void __fastcall DoCurrentDateClick(System::TObject* Sender, bool &allow);
	void __fastcall DoChangeMonth(System::TObject* Sender, int Month);
	void __fastcall DoChangeYear(System::TObject* Sender, int Year);
	void __fastcall DoChangeYearRange(System::TObject* Sender, int YearFrom, int YearTo);
	void __fastcall FillChanged(System::TObject* Sender);
	void __fastcall HeaderChanged(System::TObject* Sender);
	void __fastcall FooterChanged(System::TObject* Sender);
	void __fastcall DateAppearanceChanged(System::TObject* Sender);
	void __fastcall AnimateCal(System::TObject* Sender);
	void __fastcall AnimateMode(Byte &opcModeStart, Byte opcModeStartTo);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	virtual void __fastcall CreateWnd(void);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	DYNAMIC void __fastcall DoEnter(void);
	DYNAMIC void __fastcall DoExit(void);
	DYNAMIC void __fastcall Resize(void);
	HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Message);
	HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
	void __fastcall InitPreview(void);
	Types::TRect __fastcall InsideRect();
	Types::TRect __fastcall GetArrowRect(bool left);
	Advsmoothgdip::TGPRectF __fastcall GetDateValuesRect();
	Types::TRect __fastcall GetFooterCaptionRect();
	Advsmoothgdip::TGPRectF __fastcall GetWeekDaysRect();
	Types::TRect __fastcall GetHeaderCaptionRect();
	int __fastcall GetCountRows(void);
	int __fastcall GetVersionNr(void);
	double __fastcall GetCellWidth(void);
	double __fastcall GetCellHeight(void);
	int __fastcall GetShadowOffset(void);
	
public:
	__fastcall virtual TAdvSmoothCalendar(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvSmoothCalendar(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	virtual void __fastcall Paint(void);
	void __fastcall DrawBackGround(void);
	void __fastcall DrawHeader(void);
	void __fastcall DrawFooter(void);
	void __fastcall DrawDayOfWeek(void);
	void __fastcall DrawWeekNumbers(void);
	void __fastcall DrawArrow(bool left);
	void __fastcall DrawDays(int Month, int Year, float XPos);
	void __fastcall DrawMonths(int Year, float XPos);
	void __fastcall DrawYears(int YearFrom, int YearTo, float XPos);
	void __fastcall PreviousDate(void);
	void __fastcall NextDate(void);
	void __fastcall ToggleMode(void);
	void __fastcall SelectDate(Classes::TShiftState Shift, System::TDateTime Date);
	int __fastcall GetDayOfWeekColumn(System::TDateTime date);
	int __fastcall GetCurrentDay(Word year, Word month);
	System::TDateTime __fastcall XYToDate(int X, int Y);
	System::TDateTime __fastcall GetStartDate(void);
	System::TDateTime __fastcall GetEndDate(void);
	__property System::TDateTime HoveredDate = {read=FHoverDate, write=SetHoveredDate};
	__property System::TDateTime EndDate = {read=GetEndDate, write=SetEndDate};
	__property System::TDateTime StartDate = {read=GetStartDate, write=SetStartDate};
	__property System::TDateTime SelectedDate = {read=FSelectedDate, write=SetSelectedDate};
	__property bool KeyBoardDateModeToggle = {read=FKeyBoardDateModeToggle, write=SetKeyBoardDateModeToggle, default=1};
	void __fastcall SetComponentStyle(Advstyleif::TTMSStyle AStyle);
	
__published:
	__property bool Animation = {read=FAnimation, write=SetAnimation, default=1};
	__property int Year = {read=FYear, write=SetYear, nodefault};
	__property int Month = {read=FMonth, write=SetMonth, nodefault};
	__property TDate MaxDate = {read=FMaxDate, write=SetMaxDate, stored=DoStoreMaxDate};
	__property TDate MinDate = {read=FMinDate, write=SetMinDate, stored=DoStoreMinDate};
	__property Gdipfill::TGDIPFill* Fill = {read=FFill, write=SetFill};
	__property TAdvSmoothCalendarDateAppearance* DateAppearance = {read=FDateAppearance, write=SetDateAppearance};
	__property TAdvSmoothCalendarHeader* Header = {read=FHeader, write=SetHeader};
	__property TAdvSmoothCalendarFooter* Footer = {read=FFooter, write=SetFooter};
	__property bool Transparent = {read=FTransparent, write=SetTransparent, default=0};
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
	__property TAdvSmoothCalendarDateSelectedEvent OnSelectDate = {read=FOnSelectDate, write=FOnSelectDate};
	__property TAdvSmoothCalendarMultiDateSelectedEvent OnSelectMultiDate = {read=FOnSelectMultiDate, write=FOnSelectMultiDate};
	__property TAdvSmoothCalendarDateModeChangedEvent OnDateModeChanged = {read=FOnDateModeChanged, write=FOnDateModeChanged};
	__property TAdvSmoothCalendarMonthChangedEvent OnMonthChanged = {read=FOnMonthChanged, write=FOnMonthChanged};
	__property TAdvSmoothCalendarYearChangedEvent OnYearChanged = {read=FOnYearChanged, write=FOnYearChanged};
	__property TAdvSmoothCalendarYearRangeChangedEvent OnYearRangeChanged = {read=FOnYearRangeChanged, write=FOnYearRangeChanged};
	__property TAdvSmoothCalendarCurrentDayClickEvent OnCurrentDayClick = {read=FOnCurrentDayClick, write=FOnCurrentDayClick};
	__property bool ShowFocus = {read=FShowFocus, write=SetShowFocus, default=1};
	__property bool ShowCurrentDate = {read=FShowCurrentDate, write=SetShowCurrentDate, default=1};
	__property Graphics::TColor FocusColor = {read=FFocusColor, write=SetFocusColor, default=0};
	__property bool MultiSelect = {read=FMultiSelect, write=SetMultiSelect, default=0};
	__property TabOrder  = {default=-1};
	__property TabStop  = {default=0};
	__property Visible  = {default=1};
	__property ShowHint ;
	__property Align  = {default=0};
	__property Anchors  = {default=3};
	__property Constraints ;
	__property DragMode  = {default=0};
	__property DragCursor  = {default=-12};
	__property DragKind  = {default=0};
	__property OnCanResize ;
	__property OnConstrainedResize ;
	__property OnContextPopup ;
	__property OnDblClick ;
	__property OnDockDrop ;
	__property OnDockOver ;
	__property OnDragDrop ;
	__property OnDragOver ;
	__property OnEndDock ;
	__property OnEndDrag ;
	__property OnEnter ;
	__property OnExit ;
	__property OnGetSiteInfo ;
	__property OnMouseActivate ;
	__property OnMouseEnter ;
	__property OnMouseLeave ;
	__property OnResize ;
	__property OnStartDock ;
	__property OnStartDrag ;
	__property OnUnDock ;
	__property PopupMenu ;
	__property OnMouseMove ;
	__property OnMouseUp ;
	__property OnMouseDown ;
	__property OnClick ;
	__property OnKeyDown ;
	__property OnKeyUp ;
	__property OnKeyPress ;
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvSmoothCalendar(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
	#pragma option pop
	
private:
	void *__ITMSStyle;	/* Advstyleif::ITMSStyle */
	
public:
	operator ITMSStyle*(void) { return (ITMSStyle*)&__ITMSStyle; }
	
};


class PASCALIMPLEMENTATION TAdvSmoothCalendarHeader : public Classes::TPersistent 
{
	typedef Classes::TPersistent inherited;
	
private:
	TAdvSmoothCalendar* FOwner;
	TAdvSmoothCalendarCaptionLocation FCaptionPosition;
	Graphics::TFont* FFont;
	int FHeight;
	Classes::TNotifyEvent FOnChange;
	bool FVisible;
	int FCaptionTop;
	int FCaptionLeft;
	Gdipfill::TGDIPFill* FFill;
	bool FArrowsVisible;
	Graphics::TColor FArrowColor;
	int FArrowSize;
	void __fastcall SetCaptionLeft(const int Value);
	void __fastcall SetCaptionPosition(const TAdvSmoothCalendarCaptionLocation Value);
	void __fastcall SetCaptionTop(const int Value);
	void __fastcall SetFill(const Gdipfill::TGDIPFill* Value);
	void __fastcall SetFont(const Graphics::TFont* Value);
	void __fastcall SetHeight(const int Value);
	void __fastcall SetVisible(const bool Value);
	void __fastcall SetArrowColor(const Graphics::TColor Value);
	void __fastcall SetArrowsVisible(const bool Value);
	void __fastcall SetArrowSize(const int Value);
	
protected:
	void __fastcall Changed(void);
	void __fastcall FontChanged(System::TObject* Sender);
	void __fastcall FillChanged(System::TObject* Sender);
	int __fastcall GetHeight(void);
	
public:
	__fastcall TAdvSmoothCalendarHeader(TAdvSmoothCalendar* AOwner);
	__fastcall virtual ~TAdvSmoothCalendarHeader(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	
__published:
	__property Gdipfill::TGDIPFill* Fill = {read=FFill, write=SetFill};
	__property Graphics::TColor ArrowColor = {read=FArrowColor, write=SetArrowColor, default=16777215};
	__property bool ArrowsVisible = {read=FArrowsVisible, write=SetArrowsVisible, default=1};
	__property int ArrowSize = {read=FArrowSize, write=SetArrowSize, default=10};
	__property int Height = {read=FHeight, write=SetHeight, default=25};
	__property TAdvSmoothCalendarCaptionLocation CaptionPosition = {read=FCaptionPosition, write=SetCaptionPosition, default=5};
	__property int CaptionLeft = {read=FCaptionLeft, write=SetCaptionLeft, default=0};
	__property int CaptionTop = {read=FCaptionTop, write=SetCaptionTop, default=0};
	__property Graphics::TFont* Font = {read=FFont, write=SetFont};
	__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
	__property bool Visible = {read=FVisible, write=SetVisible, default=1};
};


#pragma option push -b-
enum TAdvSmoothCalendarForceDateMode { fdNone, fdDay, fdMonth, fdYear };
#pragma option pop

typedef DynamicArray<Advsmoothgdip::TGPRectF >  AdvSmoothCalendar__7;

//-- var, const, procedure ---------------------------------------------------
static const Shortint MAJ_VER = 0x1;
static const Shortint MIN_VER = 0x0;
static const Shortint REL_VER = 0x0;
static const Shortint BLD_VER = 0x0;

}	/* namespace Advsmoothcalendar */
using namespace Advsmoothcalendar;
#pragma pack(pop)
#pragma option pop

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

⌨️ 快捷键说明

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