Fixed new dialogs not closing.

This commit is contained in:
WrinklyNinja
2014-02-09 20:27:44 +00:00
parent bd2d39d9e5
commit e15ddfd487
4 changed files with 21 additions and 0 deletions
+10
View File
@@ -189,6 +189,7 @@ MiniEditor::MiniEditor(wxWindow *parent, const wxString& title, const std::list<
Bind(wxEVT_BUTTON, &MiniEditor::OnRemoveRow, this, BUTTON_RemoveRow);
Bind(wxEVT_TOGGLEBUTTON, &MiniEditor::OnAddRowToggle, this, BUTTON_AddRow);
Bind(wxEVT_CHECKBOX, &MiniEditor::OnFilterToggle, this);
Bind(wxEVT_BUTTON, &MiniEditor::OnApply, this, wxID_APPLY);
//Set up layout.
wxBoxSizer * bigBox = new wxBoxSizer(wxVERTICAL);
@@ -400,6 +401,15 @@ void MiniEditor::OnDragStart(wxListEvent& event) {
wxDragResult result = dropSource.DoDragDrop();
}
void MiniEditor::OnApply(wxCommandEvent& event) {
//Apply any current edits.
wxString currentPlugin = pluginText->GetLabelText();
if (!currentPlugin.empty())
ApplyEdits(currentPlugin, pluginList);
EndModal(event.GetId());
}
const std::list<boss::Plugin>& MiniEditor::GetEditedPlugins() const {
return _editedPlugins;
}
+1
View File
@@ -89,6 +89,7 @@ public:
void OnAddRowToggle(wxCommandEvent& event);
void OnFilterToggle(wxCommandEvent& event);
void OnDragStart(wxListEvent& event);
void OnApply(wxCommandEvent& event);
const std::list<boss::Plugin>& GetEditedPlugins() const;
private:
+8
View File
@@ -498,6 +498,10 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
}
_loadOrder->SetColumnWidth(0, wxLIST_AUTOSIZE);
//Set up event handling.
Bind(wxEVT_BUTTON, &LoadOrderPreview::OnYesNo, this, wxID_YES);
Bind(wxEVT_BUTTON, &LoadOrderPreview::OnYesNo, this, wxID_NO);
//Set up layout.
wxBoxSizer * bigBox = new wxBoxSizer(wxVERTICAL);
@@ -517,3 +521,7 @@ LoadOrderPreview::LoadOrderPreview(wxWindow *parent, const wxString title, const
SetIcon(wxIconLocation("BOSS.exe"));
SetSizerAndFit(bigBox);
}
void LoadOrderPreview::OnYesNo(wxCommandEvent& event) {
EndModal(event.GetId());
}
+2
View File
@@ -133,6 +133,8 @@ private:
class LoadOrderPreview : public wxDialog {
public:
LoadOrderPreview(wxWindow *parent, const wxString title, const std::list<boss::Plugin>& plugins, const boss::Game& game);
void OnYesNo(wxCommandEvent& event);
private:
wxListView * _loadOrder;
};