mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 14:59:11 +02:00
LCL: unduplicate message dialog standard captions localization code (patch by Bart Broersma, bug #19757)
git-svn-id: trunk@31748 -
This commit is contained in:
parent
211d9b8926
commit
51fed03303
@ -501,28 +501,12 @@ begin
|
||||
end;
|
||||
|
||||
function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm;
|
||||
|
||||
function MsgDlgCaptions(const DlgType: TMsgDlgType): String;
|
||||
begin
|
||||
case DlgType of
|
||||
mtWarning: Result := rsMtWarning;
|
||||
mtError: Result := rsMtError;
|
||||
mtInformation: Result := rsMtInformation;
|
||||
mtConfirmation: Result := rsMtConfirmation;
|
||||
mtCustom: Result := rsMtCustom;
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
PDlg: TPromptDialog;
|
||||
aCaption: String;
|
||||
Btns: PLongInt;
|
||||
CancelValue, DefaultIndex, ButtonCount: Longint;
|
||||
begin
|
||||
if DlgType <> mtCustom then
|
||||
aCaption := MsgDlgCaptions(DlgType)
|
||||
else
|
||||
aCaption := Application.Title;
|
||||
Btns := GetPromptUserButtons(Buttons, CancelValue, DefaultIndex, ButtonCount, False, mbOk);
|
||||
PDlg := TPromptDialog.CreateMessageDialog(aCaption, Msg, DialogIds[DlgType], Btns, ButtonCount, DefaultIndex);
|
||||
Result := TForm(PDlg);
|
||||
|
Loading…
Reference in New Issue
Block a user