advglowbutton.hpp

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

HPP
783
字号
protected:
	DYNAMIC void __fastcall Resize(void);
	virtual void __fastcall Paint(void);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	
__published:
	__property Graphics::TColor Color = {read=FColor, write=FColor, nodefault};
	__property Graphics::TColor ColorTo = {read=FColorTo, write=FColorTo, nodefault};
public:
	#pragma option push -w-inl
	/* THintWindow.Create */ inline __fastcall virtual TShortCutHintWindow(Classes::TComponent* AOwner) : Controls::THintWindow(AOwner) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TCustomControl.Destroy */ inline __fastcall virtual ~TShortCutHintWindow(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TShortCutHintWindow(HWND ParentWindow) : Controls::THintWindow(ParentWindow) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TAdvCustomGlowButton : public Controls::TCustomControl 
{
	typedef Controls::TCustomControl inherited;
	
private:
	bool FActive;
	bool FDown;
	bool FLeftDown;
	bool FMouseDown;
	Extctrls::TTimer* FTimer;
	int FStepHover;
	int FStepPush;
	int FTimeInc;
	TGlowState FGlowState;
	Controls::TImageList* FImages;
	Imglist::TImageIndex FImageIndex;
	TAdvButtonState FState;
	bool FMouseInControl;
	bool FMouseEnter;
	bool FDownChecked;
	bool FInitialDown;
	bool FDragging;
	TAdvButtonStyle FStyle;
	int FGroupIndex;
	bool FAllowAllUp;
	bool FTransparent;
	TButtonLayout FLayout;
	bool FDropDownButton;
	bool FDropDownSplit;
	TDropDownDirection FDropDownDirection;
	Menus::TPopupMenu* FDropDownMenu;
	Classes::TNotifyEvent FOnDropDown;
	TDropDownPosition FDropDownPosition;
	TGlowButtonAppearance* FAppearance;
	Controls::TImageList* FDisabledImages;
	Controls::TImageList* FInternalImages;
	Controls::TImageList* FHotImages;
	Gdipicture::TGDIPPicture* FIPicture;
	Gdipicture::TGDIPPicture* FIDisabledPicture;
	Gdipicture::TGDIPPicture* FIHotPicture;
	bool FShowCaption;
	Advgdip::TAntiAlias FAntiAlias;
	Controls::TModalResult FModalResult;
	bool FDefault;
	bool FCancel;
	bool FInButton;
	Forms::TFormBorderStyle FBorderStyle;
	TButtonPosition FButtonPosition;
	Advhintinfo::TAdvHintInfo* FOfficeHint;
	bool FCheckLinked;
	bool FGroupIndexLinked;
	TFocusType FFocusType;
	TShortCutHintWindow* FShortCutHint;
	TShortCutHintPos FShortCutHintPos;
	AnsiString FShortCutHintText;
	bool FShowDisabled;
	Controls::TKeyEvent FOnInternalKeyDown;
	Classes::TNotifyEvent FOnMouseLeave;
	Classes::TNotifyEvent FOnMouseEnter;
	bool FDroppedDown;
	bool FOverlappedText;
	int FSpacing;
	bool FAutoSize;
	bool FWordWrap;
	bool FDoAutoSize;
	bool FFirstPaint;
	int FMarginVert;
	int FMarginHorz;
	bool FRounded;
	TGlowButtonDrawEvent FOnDrawButton;
	WideString FWideCaption;
	Advgdip::StringTrimming FTrimming;
	Extctrls::TTimer* FRepeatTimer;
	int FInitRepeatPause;
	int FRepeatPause;
	bool FRepeatClick;
	Classes::TNotifyEvent FOnInternalClick;
	TButtonSizeState FButtonSizeState;
	TButtonSizeState FMaxButtonSizeState;
	TSetButtonSizeEvent FOnSetButtonSize;
	TButtonLayout FOldLayout;
	TDropDownPosition FOldDropDownPosition;
	TButtonSizeState FMinButtonSizeState;
	Forms::TCustomForm* FParentForm;
	bool FIsVista;
	Classes::TStringList* FNotes;
	Graphics::TFont* FNotesFont;
	bool FGotButtonClick;
	TOnGetShortCutHintPos FOnGetShortCutHintPos;
	void __fastcall SetOfficeHint(const Advhintinfo::TAdvHintInfo* Value);
	void __fastcall SetButtonPosition(const TButtonPosition Value);
	void __fastcall SetBorderStyle(const Forms::TBorderStyle Value);
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	void __fastcall SetDefault(const bool Value);
	void __fastcall SetAntiAlias(const Advgdip::TAntiAlias Value);
	void __fastcall SetShowCaption(const bool Value);
	void __fastcall SetDisabledPicture(const Gdipicture::TGDIPPicture* Value);
	void __fastcall SetHotPicture(const Gdipicture::TGDIPPicture* Value);
	void __fastcall SetPicture(const Gdipicture::TGDIPPicture* Value);
	void __fastcall SetTransparent(const bool Value);
	void __fastcall UpdateExclusive(void);
	void __fastcall UpdateTracking(void);
	void __fastcall SetImageIndex(const Imglist::TImageIndex Value);
	void __fastcall SetImages(const Controls::TImageList* Value);
	HIDESBASE MESSAGE void __fastcall CMDialogKey(Messages::TWMKey &Message);
	HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
	HIDESBASE MESSAGE void __fastcall CMFocusChanged(Controls::TCMFocusChanged &Message);
	MESSAGE void __fastcall WMGetDlgCode(Messages::TMessage &Message);
	MESSAGE void __fastcall CNCommand(Messages::TWMCommand &Message);
	HIDESBASE MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Msg);
	HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Msg);
	MESSAGE void __fastcall WMSetText(Messages::TWMSetText &Message);
	HIDESBASE MESSAGE void __fastcall WMEraseBkGnd(Messages::TWMEraseBkgnd &Message);
	HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Msg);
	HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
	MESSAGE void __fastcall CMButtonPressed(Messages::TMessage &Message);
	HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Msg);
	HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Msg);
	MESSAGE void __fastcall WMLDblClk(Messages::TWMMouse &Msg);
	void __fastcall TimerProc(System::TObject* Sender);
	void __fastcall OnAppearanceChanged(System::TObject* Sender);
	void __fastcall SetDown(bool Value);
	void __fastcall SetStyle(const TAdvButtonStyle Value);
	void __fastcall SetGroupIndex(const int Value);
	void __fastcall SetAllowAllUp(const bool Value);
	void __fastcall SetLayout(const TButtonLayout Value);
	void __fastcall SetDropDownButton(const bool Value);
	void __fastcall PopupBtnDown(void);
	void __fastcall SetDropDownPosition(const TDropDownPosition Value);
	void __fastcall SetDropDownDirection(const TDropDownDirection Value);
	void __fastcall SetAppearance(const TGlowButtonAppearance* Value);
	void __fastcall SetDisabledImages(const Controls::TImageList* Value);
	void __fastcall PictureChanged(System::TObject* Sender);
	void __fastcall DoDropDown(void);
	void __fastcall SetSpacing(const int Value);
	void __fastcall SetAutoSizeEx(const bool Value);
	void __fastcall SetShowDisabled(const bool Value);
	void __fastcall SetWordWrap(const bool Value);
	void __fastcall SetMarginVert(const int Value);
	void __fastcall SetMarginHorz(const int Value);
	void __fastcall SetRounded(const bool Value);
	void __fastcall SetTrimming(const Advgdip::StringTrimming Value);
	void __fastcall PerformResize(void);
	HIDESBASE bool __fastcall IsFontStored(void);
	void __fastcall SetButtonSizeState(const TButtonSizeState Value);
	void __fastcall SetMaxButtonSizeState(const TButtonSizeState Value);
	void __fastcall SetMinButtonSizeState(const TButtonSizeState Value);
	void __fastcall SetNotes(const Classes::TStrings* Value);
	Classes::TStrings* __fastcall GetNotes(void);
	void __fastcall SetNotesFont(const Graphics::TFont* Value);
	void __fastcall SetWideCaption(const WideString Value);
	
protected:
	bool FHot;
	bool FDefaultPicDrawing;
	bool FDefaultCaptionDrawing;
	bool FCustomizerCreated;
	int FCommandID;
	virtual void __fastcall TimerExpired(System::TObject* Sender);
	virtual void __fastcall DrawGlyphCaption(void);
	virtual void __fastcall GetToolImage(Graphics::TBitmap* bmp);
	void __fastcall SetDroppedDown(bool Value);
	virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
	virtual void __fastcall Paint(void);
	virtual void __fastcall Loaded(void);
	DYNAMIC void __fastcall DoEnter(void);
	DYNAMIC void __fastcall DoExit(void);
	DYNAMIC void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyPress(char &Key);
	DYNAMIC TMetaClass* __fastcall GetActionLinkClass(void);
	DYNAMIC void __fastcall ActionChange(System::TObject* Sender, bool CheckDefaults);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
	__property TGlowState GlowState = {read=FGlowState, write=FGlowState, nodefault};
	__property bool Down = {read=FDownChecked, write=SetDown, default=0};
	__property TAdvButtonStyle Style = {read=FStyle, write=SetStyle, default=0};
	__property TAdvButtonState State = {read=FState, write=FState, nodefault};
	__property int GroupIndex = {read=FGroupIndex, write=SetGroupIndex, default=0};
	__property bool AllowAllUp = {read=FAllowAllUp, write=SetAllowAllUp, default=0};
	__property TButtonLayout Layout = {read=FLayout, write=SetLayout, default=0};
	__property bool DroppedDown = {read=FDroppedDown, nodefault};
	__property bool DropDownButton = {read=FDropDownButton, write=SetDropDownButton, default=0};
	__property TDropDownDirection DropDownDirection = {read=FDropDownDirection, write=SetDropDownDirection, default=0};
	__property TDropDownPosition DropDownPosition = {read=FDropDownPosition, write=SetDropDownPosition, default=0};
	__property bool DropDownSplit = {read=FDropDownSplit, write=FDropDownSplit, default=1};
	__property Menus::TPopupMenu* DropDownMenu = {read=FDropDownMenu, write=FDropDownMenu};
	__property Classes::TNotifyEvent OnDropDown = {read=FOnDropDown, write=FOnDropDown};
	virtual int __fastcall GetVersionNr(void);
	virtual bool __fastcall IsMenuButton(void);
	virtual bool __fastcall CanDrawBorder(void);
	virtual bool __fastcall CanDrawFocused(void);
	void __fastcall InternalClick(void);
	__property bool CheckLinked = {read=FCheckLinked, write=FCheckLinked, nodefault};
	__property bool GroupIndexLinked = {read=FGroupIndexLinked, write=FGroupIndexLinked, nodefault};
	__property Controls::TKeyEvent OnInternalKeyDown = {read=FOnInternalKeyDown, write=FOnInternalKeyDown};
	__property Classes::TNotifyEvent OnInternalClick = {read=FOnInternalClick, write=FOnInternalClick};
	__property TOnGetShortCutHintPos OnGetShortCutHintPos = {read=FOnGetShortCutHintPos, write=FOnGetShortCutHintPos};
	__property bool OverlappedText = {read=FOverlappedText, write=FOverlappedText, nodefault};
	__property bool DoAutoSize = {read=FDoAutoSize, write=FDoAutoSize, nodefault};
	__property TButtonSizeState ButtonSizeState = {read=FButtonSizeState, write=SetButtonSizeState, nodefault};
	__property TButtonSizeState MaxButtonSizeState = {read=FMaxButtonSizeState, write=SetMaxButtonSizeState, default=2};
	__property TButtonSizeState MinButtonSizeState = {read=FMinButtonSizeState, write=SetMinButtonSizeState, default=0};
	__property TSetButtonSizeEvent OnSetButtonSize = {read=FOnSetButtonSize, write=FOnSetButtonSize};
	tagSIZE __fastcall GetButtonSize(TButtonSizeState BtnSizeState);
	
public:
	__fastcall virtual TAdvCustomGlowButton(Classes::TComponent* AOwner);
	__fastcall virtual ~TAdvCustomGlowButton(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	virtual void __fastcall CreateWnd(void);
	DYNAMIC void __fastcall Click(void);
	__property TGlowButtonAppearance* Appearance = {read=FAppearance, write=SetAppearance};
	void __fastcall ShowShortCutHint(void);
	void __fastcall HideShortCutHint(void);
	void __fastcall SetComponentStyle(Advstyleif::TTMSStyle AStyle);
	__property WideString WideCaption = {read=FWideCaption, write=SetWideCaption};
	
__published:
	__property Align  = {default=0};
	__property Action ;
	__property Anchors  = {default=3};
	__property Advgdip::TAntiAlias AntiAlias = {read=FAntiAlias, write=SetAntiAlias, default=1};
	__property bool AutoSize = {read=FAutoSize, write=SetAutoSizeEx, default=0};
	__property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
	__property bool Cancel = {read=FCancel, write=FCancel, default=0};
	__property Caption ;
	__property Constraints ;
	__property bool Default = {read=FDefault, write=SetDefault, default=0};
	__property Font  = {stored=IsFontStored};
	__property Imglist::TImageIndex ImageIndex = {read=FImageIndex, write=SetImageIndex, default=-1};

⌨️ 快捷键说明

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