projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable warnings around all wx includes.
[dcpomatic.git]
/
src
/
wx
/
i18n_hook.cc
diff --git
a/src/wx/i18n_hook.cc
b/src/wx/i18n_hook.cc
index 84dcd761fdbfdc914397ef15639ea5fc5bc7b5b2..15b9c1024c322bf731a39cba86b085a3647400ae 100644
(file)
--- a/
src/wx/i18n_hook.cc
+++ b/
src/wx/i18n_hook.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018
-2021
Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
This file is part of DCP-o-matic.
@@
-18,35
+18,44
@@
*/
*/
+
#include "i18n_hook.h"
#include "instant_i18n_dialog.h"
#include "wx_util.h"
#include "lib/cross.h"
#include "i18n_hook.h"
#include "instant_i18n_dialog.h"
#include "wx_util.h"
#include "lib/cross.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
#include <wx/wx.h>
-#include <boost/bind.hpp>
+DCPOMATIC_ENABLE_WARNINGS
+#include <boost/bind/bind.hpp>
+
using std::map;
using std::string;
using std::map;
using std::string;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
+
map<string, string> I18NHook::_translations;
map<string, string> I18NHook::_translations;
-I18NHook::I18NHook (wxWindow* window)
+I18NHook::I18NHook (wxWindow* window
, wxString original
)
: _window (window)
: _window (window)
+ , _original (original)
{
_window->Bind (wxEVT_MIDDLE_DOWN, bind(&I18NHook::handle, this, _1));
}
{
_window->Bind (wxEVT_MIDDLE_DOWN, bind(&I18NHook::handle, this, _1));
}
+
void
I18NHook::handle (wxMouseEvent& ev)
{
void
I18NHook::handle (wxMouseEvent& ev)
{
- wxString const original = get_text ();
-
- InstantI18NDialog* d = new InstantI18NDialog (_window, get_text());
+ auto d = new InstantI18NDialog (_window, get_text());
d->ShowModal();
set_text (d->get());
d->Destroy ();
d->ShowModal();
set_text (d->get());
d->Destroy ();
-
wxWindow*
w = _window;
+
auto
w = _window;
while (w) {
if (w->GetContainingSizer()) {
w->GetContainingSizer()->Layout();
while (w) {
if (w->GetContainingSizer()) {
w->GetContainingSizer()->Layout();
@@
-56,5
+65,5
@@
I18NHook::handle (wxMouseEvent& ev)
ev.Skip ();
ev.Skip ();
- _translations[wx_to_std(original)] = wx_to_std(get_text());
+ _translations[wx_to_std(
_
original)] = wx_to_std(get_text());
}
}