Dialogs: overload CreateMessageDlg function with parameter to set dialog caption.

git-svn-id: trunk@57360 -
This commit is contained in:
bart 2018-02-24 16:01:21 +00:00
parent 3f3f298212
commit 9801fd24ee
2 changed files with 11 additions and 3 deletions

View File

@ -679,7 +679,9 @@ function MessageDlgPos(const aMsg: string; DlgType: TMsgDlgType;
function MessageDlgPosHelp(const aMsg: string; DlgType: TMsgDlgType; function MessageDlgPosHelp(const aMsg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
const HelpFileName: string): TModalResult; overload; const HelpFileName: string): TModalResult; overload;
function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; function CreateMessageDialog(const aMsg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons): TForm; overload;
function CreateMessageDialog(const aCaption, aMsg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons): TForm; overload; Buttons: TMsgDlgButtons): TForm; overload;
function DefaultPromptDialog(const DialogCaption, function DefaultPromptDialog(const DialogCaption,
DialogMessage: String; DialogMessage: String;

View File

@ -562,14 +562,20 @@ begin
end; end;
end; end;
function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm; function CreateMessageDialog(const aMsg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons): TForm;
begin
Result := CreateMessageDialog('', aMsg, DlgType, Buttons);
end;
function CreateMessageDialog(const aCaption, aMsg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm;
var var
PDlg: TPromptDialog; PDlg: TPromptDialog;
Btns: PLongInt; Btns: PLongInt;
CancelValue, DefaultIndex, ButtonCount: Longint; CancelValue, DefaultIndex, ButtonCount: Longint;
begin begin
Btns := GetPromptUserButtons(Buttons, CancelValue, DefaultIndex, ButtonCount, False, mbOk); Btns := GetPromptUserButtons(Buttons, CancelValue, DefaultIndex, ButtonCount, False, mbOk);
PDlg := TPromptDialog.CreateMessageDialog('', Msg, DialogIds[DlgType], Btns, ButtonCount, DefaultIndex); PDlg := TPromptDialog.CreateMessageDialog(aCaption, aMsg, DialogIds[DlgType], Btns, ButtonCount, DefaultIndex);
Result := TForm(PDlg); Result := TForm(PDlg);
ReallocMem(Btns, 0); ReallocMem(Btns, 0);
end; end;