Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0c0403e

Browse files
Add new TMessageBox.Warning method
1 parent 6e8e0f7 commit 0c0403e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

‎Src/UMessageBox.pas

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ TMessageBox = class sealed(TNoConstructObject)
142142
/// breaks.</param>
143143
class procedure Error(const Parent: TComponent; const Msg: string);
144144

145+
/// <summary>Displays a message in a warning dialogue box aligned over the
146+
/// parent control.</summary>
147+
/// <param name="Parent">TComponent [in] Dialogue box's parent control,
148+
/// over which dialogue box is aligned. May be nil, when active form is
149+
/// used for alignment.</param>
150+
/// <param name="Msg">string [in] Message displayed in dialogue box.
151+
/// Separate lines with LF or CRLF. Separate paragraphs with two line
152+
/// breaks.</param>
153+
class procedure Warning(const Parent: TComponent; const Msg: string);
154+
145155
/// <summary>Displays a message in a confirmation dialogue box aligned over
146156
/// the parent control.</summary>
147157
/// <param name="Parent">TComponent [in] Dialogue box's parent control,
@@ -397,6 +407,21 @@ class procedure TMessageBox.Information(const Parent: TComponent;
397407
);
398408
end;
399409

410+
class procedure TMessageBox.Warning(const Parent: TComponent;
411+
const Msg: string);
412+
begin
413+
MessageBeep(MB_ICONEXCLAMATION);
414+
Display(
415+
Parent,
416+
Msg,
417+
mtWarning,
418+
[TMessageBoxButton.Create(sBtnOK, mrOK, True, True)],
419+
DefaultTitle,
420+
DefaultIcon,
421+
False
422+
);
423+
end;
424+
400425
{ TMessageBoxButton }
401426

402427
constructor TMessageBoxButton.Create(const ACaption: TCaption;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /