Audacity 3.2.0
AudacityMessageBox.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 AudacityMessageBox.cpp
6
7 Paul Licameli split this out of ErrorDialog.cpp
8
9**********************************************************************/
10
11#include "AudacityMessageBox.h"
12#include "Internat.h"
13
14#include "Journal.h"
15#include "wxArrayStringEx.h"
16
18 const TranslatableString& caption,
19 long style, wxWindow *parent, int x, int y)
20{
21 // wxMessageBox is implemented with native message boxes and does not
22 // use the wxWidgets message machinery. Therefore the wxEventFilter that
23 // most journal recording relies on fails us here. So if replaying, don't
24 // really make the modal dialog, but just return the expected value.
25 return Journal::IfNotPlaying( L"MessageBox", [&]{
26 return ::wxMessageBox(
27 message.Translation(), caption.Translation(),
28 style, parent, x, y);
29 } );
30}
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
int IfNotPlaying(const wxString &string, const InteractiveAction &action)
Call action only if not replaying; synchronize on string and int values.
Definition: Journal.cpp:352