taskdialog.hpp

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

HPP
512
字号
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TAdvMessageForm(HWND ParentWindow) : Forms::TForm(ParentWindow) { }
	#pragma option pop
	
};


class PASCALIMPLEMENTATION TCustomAdvTaskDialog : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	AnsiString FTitle;
	AnsiString FContent;
	AnsiString FFooter;
	AnsiString FInstruction;
	TCommonButtons FCommonButtons;
	AnsiString FExpandedText;
	AnsiString FCollapsControlText;
	AnsiString FExpandControlText;
	int FButtonResult;
	bool FVerifyResult;
	AnsiString FVerifyText;
	Classes::TStringList* FCustomButtons;
	Graphics::TIcon* FCustomIcon;
	TTaskDialogOptions FOptions;
	Classes::TStringList* FRadioButtons;
	unsigned FhWnd;
	Classes::TNotifyEvent FOnCreated;
	Classes::TNotifyEvent FOnTimer;
	int FProgressBarMin;
	int FProgressBarMax;
	TTaskDialogHyperlinkClickEvent FOnDialogHyperlinkClick;
	TTaskDialogButtonClickEvent FOnDialogClick;
	TTaskDialogButtonClickEvent FOnDialogRadioClick;
	TTaskDialogVerifyClickEvent FOnDialogVerifyClick;
	TTaskDialogProgressEvent FOnDialogProgress;
	TTaskDialogCloseEvent FOnDialogClose;
	TInputGetTextEvent FOnDialogInputGetText;
	TInputSetTextEvent FOnDialogInputSetText;
	TTaskDialogIcon FIcon;
	TTaskDialogFooterIcon FFooterIcon;
	int FDefaultButton;
	int FDefaultRadioButton;
	TAdvMessageForm* FDialogForm;
	TTaskDialogPosition FDlgPosition;
	bool FApplicationIsParent;
	unsigned FModalParent;
	int FMinFormWidth;
	TNonNativeDialog FNonNativeDialog;
	TInputType FInputType;
	AnsiString FInputText;
	Classes::TStrings* FInputItems;
	Controls::TWinControl* FInputControl;
	AnsiString __fastcall GetVersion();
	void __fastcall SetVersion(const AnsiString Value);
	int __fastcall GetVersionNr(void);
	void __fastcall SetCustomButtons(const Classes::TStringList* Value);
	void __fastcall SetRadioButtons(const Classes::TStringList* Value);
	void __fastcall SetContent(const AnsiString Value);
	void __fastcall SetInstruction(const AnsiString Value);
	void __fastcall SetFooter(const AnsiString Value);
	void __fastcall SetExpandedText(const AnsiString Value);
	void __fastcall SetCustomIcon(const Graphics::TIcon* Value);
	void __fastcall SetInputItems(const Classes::TStrings* Value);
	
protected:
	virtual Controls::TWinControl* __fastcall CreateButton(Classes::TComponent* AOwner);
	virtual Controls::TWinControl* __fastcall CreateRadioButton(Classes::TComponent* AOwner);
	virtual void __fastcall InitRadioButton(Forms::TForm* AOwner, Controls::TWinControl* Btn, int btnIndex, Classes::TNotifyEvent OnClickEvent);
	virtual void __fastcall SetRadioButtonState(Controls::TWinControl* Btn, bool Checked);
	virtual void __fastcall SetRadioButtonCaption(Controls::TWinControl* Btn, AnsiString Value);
	virtual void __fastcall SetButtonCaption(Controls::TWinControl* aButton, AnsiString Value);
	virtual void __fastcall SetButtonCancel(Controls::TWinControl* aButton, bool Value);
	virtual void __fastcall SetButtonDefault(Controls::TWinControl* aButton, bool Value);
	virtual void __fastcall SetButtonModalResult(Controls::TWinControl* aButton, int Value);
	virtual int __fastcall GetButtonModalResult(Controls::TWinControl* aButton);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
	__property Classes::TStringList* CustomButtons = {read=FCustomButtons, write=SetCustomButtons};
	__property Graphics::TIcon* CustomIcon = {read=FCustomIcon, write=SetCustomIcon};
	__property Classes::TStringList* RadioButtons = {read=FRadioButtons, write=SetRadioButtons};
	__property TCommonButtons CommonButtons = {read=FCommonButtons, write=FCommonButtons, nodefault};
	__property int DefaultButton = {read=FDefaultButton, write=FDefaultButton, nodefault};
	__property int DefaultRadioButton = {read=FDefaultRadioButton, write=FDefaultRadioButton, nodefault};
	__property TTaskDialogPosition DialogPosition = {read=FDlgPosition, write=FDlgPosition, default=0};
	__property AnsiString ExpandedText = {read=FExpandedText, write=SetExpandedText};
	__property AnsiString Footer = {read=FFooter, write=SetFooter};
	__property TTaskDialogFooterIcon FooterIcon = {read=FFooterIcon, write=FFooterIcon, default=0};
	__property TTaskDialogIcon Icon = {read=FIcon, write=FIcon, default=0};
	__property AnsiString InputText = {read=FInputText, write=FInputText};
	__property TInputType InputType = {read=FInputType, write=FInputType, nodefault};
	__property Classes::TStrings* InputItems = {read=FInputItems, write=SetInputItems};
	__property Controls::TWinControl* InputControl = {read=FInputControl, write=FInputControl};
	__property AnsiString Title = {read=FTitle, write=FTitle};
	__property AnsiString Instruction = {read=FInstruction, write=SetInstruction};
	__property AnsiString Content = {read=FContent, write=SetContent};
	__property AnsiString ExpandControlText = {read=FExpandControlText, write=FExpandControlText};
	__property AnsiString CollapsControlText = {read=FCollapsControlText, write=FCollapsControlText};
	__property TTaskDialogOptions Options = {read=FOptions, write=FOptions, nodefault};
	__property bool ApplicationIsParent = {read=FApplicationIsParent, write=FApplicationIsParent, default=1};
	__property AnsiString VerificationText = {read=FVerifyText, write=FVerifyText};
	__property TNonNativeDialog NonNativeDialog = {read=FNonNativeDialog, write=FNonNativeDialog, default=0};
	__property int NonNativeMinFormWidth = {read=FMinFormWidth, write=FMinFormWidth, default=350};
	__property int ProgressBarMin = {read=FProgressBarMin, write=FProgressBarMin, default=0};
	__property int ProgressBarMax = {read=FProgressBarMax, write=FProgressBarMax, default=100};
	__property AnsiString Version = {read=GetVersion, write=SetVersion};
	__property Classes::TNotifyEvent OnDialogCreated = {read=FOnCreated, write=FOnCreated};
	__property TTaskDialogCloseEvent OnDialogClose = {read=FOnDialogClose, write=FOnDialogClose};
	__property TTaskDialogButtonClickEvent OnDialogButtonClick = {read=FOnDialogClick, write=FOnDialogClick};
	__property TInputSetTextEvent OnDialogInputSetText = {read=FOnDialogInputSetText, write=FOnDialogInputSetText};
	__property TInputGetTextEvent OnDialogInputGetText = {read=FOnDialogInputGetText, write=FOnDialogInputGetText};
	__property TTaskDialogButtonClickEvent OnDialogRadioClick = {read=FOnDialogRadioClick, write=FOnDialogRadioClick};
	__property TTaskDialogHyperlinkClickEvent OnDialogHyperlinkClick = {read=FOnDialogHyperlinkClick, write=FOnDialogHyperlinkClick};
	__property Classes::TNotifyEvent OnDialogTimer = {read=FOnTimer, write=FOnTimer};
	__property TTaskDialogVerifyClickEvent OnDialogVerifyClick = {read=FOnDialogVerifyClick, write=FOnDialogVerifyClick};
	__property TTaskDialogProgressEvent OnDialogProgress = {read=FOnDialogProgress, write=FOnDialogProgress};
	
public:
	__property unsigned hWnd = {read=FhWnd, write=FhWnd, nodefault};
	__fastcall virtual TCustomAdvTaskDialog(Classes::TComponent* AOwner);
	__fastcall virtual ~TCustomAdvTaskDialog(void);
	virtual int __fastcall Execute(void);
	void __fastcall Clear(void);
	void __fastcall EnableButton(int ButtonID, bool Enabled);
	void __fastcall ElevateButton(int ButtonID, bool Enabled);
	void __fastcall ClickButton(int ButtonID);
	__property int RadioButtonResult = {read=FButtonResult, write=FButtonResult, nodefault};
	__property bool VerifyResult = {read=FVerifyResult, write=FVerifyResult, nodefault};
	__property unsigned ModalParent = {read=FModalParent, write=FModalParent, nodefault};
};


class DELPHICLASS TAdvTaskDialog;
class PASCALIMPLEMENTATION TAdvTaskDialog : public TCustomAdvTaskDialog 
{
	typedef TCustomAdvTaskDialog inherited;
	
__published:
	__property CustomButtons ;
	__property CustomIcon ;
	__property RadioButtons ;
	__property CommonButtons ;
	__property DefaultButton ;
	__property DefaultRadioButton ;
	__property DialogPosition  = {default=0};
	__property ExpandedText ;
	__property Footer ;
	__property FooterIcon  = {default=0};
	__property Icon  = {default=0};
	__property Title ;
	__property Instruction ;
	__property Content ;
	__property ExpandControlText ;
	__property CollapsControlText ;
	__property Options ;
	__property ApplicationIsParent  = {default=1};
	__property VerificationText ;
	__property NonNativeDialog  = {default=0};
	__property NonNativeMinFormWidth  = {default=350};
	__property ProgressBarMin  = {default=0};
	__property ProgressBarMax  = {default=100};
	__property Version ;
	__property OnDialogCreated ;
	__property OnDialogClose ;
	__property OnDialogButtonClick ;
	__property OnDialogRadioClick ;
	__property OnDialogHyperlinkClick ;
	__property OnDialogTimer ;
	__property OnDialogVerifyClick ;
	__property OnDialogProgress ;
public:
	#pragma option push -w-inl
	/* TCustomAdvTaskDialog.Create */ inline __fastcall virtual TAdvTaskDialog(Classes::TComponent* AOwner) : TCustomAdvTaskDialog(AOwner) { }
	#pragma option pop
	#pragma option push -w-inl
	/* TCustomAdvTaskDialog.Destroy */ inline __fastcall virtual ~TAdvTaskDialog(void) { }
	#pragma option pop
	
};


class DELPHICLASS TAdvInputTaskDialog;
class PASCALIMPLEMENTATION TAdvInputTaskDialog : public TCustomAdvTaskDialog 
{
	typedef TCustomAdvTaskDialog inherited;
	
public:
	__fastcall virtual TAdvInputTaskDialog(Classes::TComponent* AOwner);
	virtual int __fastcall Execute(void);
	
__published:
	__property ApplicationIsParent  = {default=1};
	__property CustomButtons ;
	__property CustomIcon ;
	__property CommonButtons ;
	__property DefaultButton ;
	__property DialogPosition  = {default=0};
	__property ExpandedText ;
	__property Footer ;
	__property FooterIcon  = {default=0};
	__property Icon  = {default=0};
	__property InputControl ;
	__property InputType ;
	__property InputText ;
	__property InputItems ;
	__property Instruction ;
	__property Title ;
	__property Content ;
	__property ExpandControlText ;
	__property CollapsControlText ;
	__property VerificationText ;
	__property OnDialogCreated ;
	__property OnDialogClose ;
	__property OnDialogButtonClick ;
	__property OnDialogVerifyClick ;
	__property OnDialogInputSetText ;
	__property OnDialogInputGetText ;
public:
	#pragma option push -w-inl
	/* TCustomAdvTaskDialog.Destroy */ inline __fastcall virtual ~TAdvInputTaskDialog(void) { }
	#pragma option pop
	
};


typedef AnsiString TaskDialog__6[6];

//-- var, const, procedure ---------------------------------------------------
static const Shortint MAJ_VER = 0x1;
static const Shortint MIN_VER = 0x5;
static const Shortint REL_VER = 0x0;
static const Shortint BLD_VER = 0x6;
extern PACKAGE bool DRAWBORDER;
extern PACKAGE AnsiString ButtonNames[6];
extern PACKAGE int __fastcall AdvMessageDlgPos(TCustomAdvTaskDialog* TaskDialog, int X, int Y);
extern PACKAGE bool __fastcall AdvShowMessage(const AnsiString Title, const AnsiString Instruction, const AnsiString content, const AnsiString verify, TTaskDialogIcon tiIcon)/* overload */;
extern PACKAGE bool __fastcall AdvShowMessage(const AnsiString Instruction)/* overload */;
extern PACKAGE bool __fastcall AdvShowMessage(const AnsiString Title, const AnsiString Instruction)/* overload */;
extern PACKAGE bool __fastcall AdvShowMessage(const AnsiString Title, const AnsiString Instruction, TTaskDialogIcon tiIcon)/* overload */;
extern PACKAGE bool __fastcall AdvShowMessageFmt(const AnsiString Instruction, System::TVarRec * Parameters, const int Parameters_Size);
extern PACKAGE int __fastcall AdvMessageBox(HWND hWnd, char * lpInstruction, char * lpTitle, unsigned flags);
extern PACKAGE int __fastcall AdvMessageDlg(const AnsiString Instruction, Dialogs::TMsgDlgType DlgType, Dialogs::TMsgDlgButtons Buttons, int HelpCtx)/* overload */;
extern PACKAGE int __fastcall AdvMessageDlg(const AnsiString Instruction, Dialogs::TMsgDlgType DlgType, Dialogs::TMsgDlgButtons Buttons, int HelpCtx, Dialogs::TMsgDlgBtn DefaultButton)/* overload */;
extern PACKAGE bool __fastcall AdvInputQueryDlg(AnsiString ACaption, AnsiString APrompt, AnsiString &Value);
extern PACKAGE void __fastcall Register(void);

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

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

⌨️ 快捷键说明

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