From 7bd0691bd7de25fd5fdcebefea678501cf0c3ab5 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 1 Feb 2012 00:48:07 +0000 Subject: [PATCH] In PersistLocation get the new location of the dialog directly from the dialog rather than from the event as the data in the event is wrong Originally committed to SVN as r6411. --- aegisub/src/persist_location.cpp | 5 +++-- aegisub/src/persist_location.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aegisub/src/persist_location.cpp b/aegisub/src/persist_location.cpp index b6c654919..95c05e05b 100644 --- a/aegisub/src/persist_location.cpp +++ b/aegisub/src/persist_location.cpp @@ -35,6 +35,7 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) : x_opt(OPT_SET(options_prefix + "/Last/X")) , y_opt(OPT_SET(options_prefix + "/Last/Y")) , maximize_opt(OPT_SET(options_prefix + "/Maximized")) +, dialog(dialog) { dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this); dialog->Bind(wxEVT_ICONIZE, &PersistLocation::OnMinimize, this); @@ -78,8 +79,8 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix) } } -void PersistLocation::OnMove(wxMoveEvent &evt) { - wxPoint pos = evt.GetPosition(); +void PersistLocation::OnMove(wxMoveEvent &) { + wxPoint pos = dialog->GetPosition(); x_opt->SetInt(pos.x); y_opt->SetInt(pos.y); } diff --git a/aegisub/src/persist_location.h b/aegisub/src/persist_location.h index 105b62dc5..07c50368b 100644 --- a/aegisub/src/persist_location.h +++ b/aegisub/src/persist_location.h @@ -40,8 +40,9 @@ class PersistLocation { agi::OptionValue *x_opt; agi::OptionValue *y_opt; agi::OptionValue *maximize_opt; + class wxDialog *dialog; - void OnMove(wxMoveEvent &evt); + void OnMove(wxMoveEvent &); void OnMinimize(wxIconizeEvent &evt); public: