Audacity  3.0.3
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 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
Journal.h
Internat.h
wxArrayStringEx.h
AudacityMessageBox.h
Journal::IfNotPlaying
int IfNotPlaying(const wxString &string, const InteractiveAction &action)
Call action only if not replaying; synchronize on string and int values.
Definition: Journal.cpp:257
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79