diff options
Diffstat (limited to 'src/MainWindow.cpp')
| -rw-r--r-- | src/MainWindow.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7a8c27f..e379319 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -78,7 +78,7 @@ void MainWindow::OnAuiNotebookPageCheck(wxAuiNotebookEvent& event){ } void MainWindow::AddPage(wxWindow* window, TabInfos* infos){ - window->SetClientData(infos); + window->SetClientData(infos); // Allows to have safer cast in this class notebook->AddPage(window, window->GetLabel()); notebook->SetSelection(notebook->GetPageIndex(window)); // Refresh tab that require knowledge on other tabs @@ -121,10 +121,9 @@ void MainWindow::OnMenuItemClick(wxCommandEvent &event) { for (wxMenuItem *item : items) { if (item->GetId() == id) { wxLogDebug("Selected %s", item->GetItemLabel()); - EngineTab *bt = new EngineTab((wxWindow *)notebook, + EngineTab *et = new EngineTab((wxWindow *)notebook, item->GetItemLabel().ToStdString()); - notebook->AddPage(bt, bt->GetLabel()); - notebook->SetSelection(notebook->GetPageIndex(bt)); + AddPage(et,et); } } } else if (id == 1) { // Settings @@ -185,7 +184,7 @@ void MainWindow::OnRefreshEngineList(wxCommandEvent &event) { } while (conf->GetNextGroup(engine_name, index)); } CONFIG_CLOSE(conf); - ApplyPreferences(); // Propagate motifications + ApplyPreferences(); // Propagate informations to the tabs that require it } void MainWindow::NewEngine() { @@ -257,7 +256,7 @@ void MainWindow::OnPageChange(wxAuiNotebookEvent &event) { } void MainWindow::OnRefreshTabTitle(wxCommandEvent &event) { - GameTab *win = dynamic_cast<GameTab *>(event.GetEventObject()); + GameTab *win = (GameTab*)event.GetEventObject(); int page = notebook->GetPageIndex(win); if (page != wxNOT_FOUND) { notebook->SetPageText(page, win->GetLabel()); |
