mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
Fix #10: find/replace was broken after tab index change.
Also: improve tab order to get a total order
This commit is contained in:
@@ -44,7 +44,6 @@
|
|||||||
SetWindow::SetWindow(Window* parent, const SetP& set)
|
SetWindow::SetWindow(Window* parent, const SetP& set)
|
||||||
: wxFrame(parent, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
|
: wxFrame(parent, wxID_ANY, _TITLE_("magic set editor"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
|
||||||
, current_panel(nullptr)
|
, current_panel(nullptr)
|
||||||
, find_dialog(nullptr)
|
|
||||||
, find_data(wxFR_DOWN)
|
, find_data(wxFR_DOWN)
|
||||||
, number_of_recent_sets(0)
|
, number_of_recent_sets(0)
|
||||||
{
|
{
|
||||||
@@ -169,7 +168,6 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
|||||||
// if we don't destroy the panel we could crash in ~CardsPanel, since it expected
|
// if we don't destroy the panel we could crash in ~CardsPanel, since it expected
|
||||||
// the insertSymbolMenu to be removed by destroyUI but not deleted.
|
// the insertSymbolMenu to be removed by destroyUI but not deleted.
|
||||||
current_panel->destroyUI(GetToolBar(), GetMenuBar());
|
current_panel->destroyUI(GetToolBar(), GetMenuBar());
|
||||||
delete find_dialog;
|
|
||||||
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
@@ -197,7 +195,6 @@ SetWindow::~SetWindow() {
|
|||||||
// destroy ui of selected panel
|
// destroy ui of selected panel
|
||||||
current_panel->destroyUI(GetToolBar(), GetMenuBar());
|
current_panel->destroyUI(GetToolBar(), GetMenuBar());
|
||||||
// cleanup (see find stuff)
|
// cleanup (see find stuff)
|
||||||
delete find_dialog;
|
|
||||||
delete export_menu;
|
delete export_menu;
|
||||||
// remove from list of set windows
|
// remove from list of set windows
|
||||||
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
|
||||||
@@ -740,16 +737,15 @@ void SetWindow::onEditPaste(wxCommandEvent&) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetWindow::onEditFind(wxCommandEvent&) {
|
void SetWindow::onEditFind(wxCommandEvent&) {
|
||||||
delete find_dialog;
|
find_dialog = make_unique<wxFindReplaceDialog>(this, &find_data, _("Find"));
|
||||||
find_dialog = new wxFindReplaceDialog(this, &find_data, _("Find"));
|
|
||||||
find_dialog->Show();
|
find_dialog->Show();
|
||||||
|
find_dialog->SetPosition(this->GetPosition());
|
||||||
}
|
}
|
||||||
void SetWindow::onEditFindNext(wxCommandEvent&) {
|
void SetWindow::onEditFindNext(wxCommandEvent&) {
|
||||||
current_panel->doFind(find_data);
|
current_panel->doFind(find_data);
|
||||||
}
|
}
|
||||||
void SetWindow::onEditReplace(wxCommandEvent&) {
|
void SetWindow::onEditReplace(wxCommandEvent&) {
|
||||||
delete find_dialog;
|
find_dialog = make_unique<wxFindReplaceDialog>(this, &find_data, _("Replace"), wxFR_REPLACEDIALOG);
|
||||||
find_dialog = new wxFindReplaceDialog(this, &find_data, _("Replace"), wxFR_REPLACEDIALOG);
|
|
||||||
find_dialog->Show();
|
find_dialog->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ private:
|
|||||||
size_t number_of_recentSets;
|
size_t number_of_recentSets;
|
||||||
|
|
||||||
// data for find/replace
|
// data for find/replace
|
||||||
wxDialog* find_dialog;
|
unique_ptr<wxDialog> find_dialog;
|
||||||
wxFindReplaceData find_data;
|
wxFindReplaceData find_data;
|
||||||
|
|
||||||
// --------------------------------------------------- : Panel managment
|
// --------------------------------------------------- : Panel managment
|
||||||
|
|||||||
Reference in New Issue
Block a user