Unit Msgdlg32

****************************************************************} { } { Improved Delphi MessageDlg and InputDialog Functions } { } { Copyright (c) 1996-1997 Steven J. Colagiovanni } { } {

Classes

TMessageDlg -

Functions

CreateMsgBox -
FormCenteredMsgDlg -
InputDlg - Restore the original Screen.
InputQry - ********** Improved InputBox and InputQuery functions **********
MsgDlg - Restore the original Screen.
MsgDlgPos - Result := TForm.
Register - Create
ShowMsg -
ShowMsgPos -

Types

TDefaultBtn
TMessageBoxStyle
TMsgBoxBtn
TMsgBoxButtons
TMsgBoxType

Constants

mbAbortRetryIgnore
mbOKCancel
mbRetryCancel
mbYesNo
mbYesNoCancel
SMsgboxAbort
SMsgboxAll
SMsgboxCancel
SMsgboxHelp
SMsgboxIgnore
SMsgboxNo
SMsgboxOK
SMsgboxRetry
SMsgboxYes

Variables


Functions


function CreateMsgBox(const AMsg: string; const ACaption: string; AType: TMsgBoxType; AButtons: TMsgBoxButtons; ADefaultButton: TDefaultBtn): TForm;


function FormCenteredMsgDlg(const AMsg: string; const ACaption: string; AType: TMsgBoxType; AButtons: TMsgBoxButtons; ADefaultButton: TDefaultBtn; HelpCtx: Longint; AForm: TForm): Word;


function InputDlg(const ACaption, APrompt, ADefault: string): string;

Restore the original Screen.Cursor

function InputQry(const ACaption, APrompt: string; var Value: string): Boolean;

********** Improved InputBox and InputQuery functions **********

function MsgDlg(const AMsg: string; const ACaption: string; AType: TMsgBoxType; AButtons: TMsgBoxButtons; ADefaultButton: TDefaultBtn): Word;

Restore the original Screen.Cursor

function MsgDlgPos(const AMsg: string; const ACaption: string; AType: TMsgBoxType; AButtons: TMsgBoxButtons; ADefaultButton: TDefaultBtn; HelpCtx: Longint; X, Y: Integer): Word;

Result := TForm.CreateNew(Application);

procedure Register;

Create

procedure ShowMsg(const AMsg: string);


procedure ShowMsgPos(const AMsg: string; X, Y: Integer);


Types


TDefaultBtn = (dfFirst, dfSecond, dfThird, dfFourth);

TMessageBoxStyle = (msScreenCentered, msFormCentered, msCustomPosition);
Default Button
TMsgBoxBtn = (mbYes, mbAll, mbNo, mbOK, mbAbort, mbRetry,
                        mbIgnore, mbCancel, mbHelp);

TMsgBoxButtons = set of TMsgBoxBtn

TMsgBoxType = (mtWarning, mtError, mtInformation, mtConfirmation,
			mtCustom);

Constants

mbAbortRetryIgnore = [mbAbort, mbRetry, mbIgnore]

mbOKCancel = [mbOK, mbCancel]

mbRetryCancel = [mbRetry, mbCancel]

mbYesNo = [mbYes, mbNo]

mbYesNoCancel = [mbYes, mbNo, mbCancel]

SMsgboxAbort = '&Abort'

SMsgboxAll = 'Yes to &All'

SMsgboxCancel = 'Cancel'

SMsgboxHelp = '&Help'

SMsgboxIgnore = '&Ignore'

SMsgboxNo = '&No'

SMsgboxOK = 'OK'

SMsgboxRetry = '&Retry'

SMsgboxYes = '&Yes'


Variables