void FCEFWebBrowserWindow::OnBrowserClosed() { if(OnCloseWindow().IsBound()) { OnCloseWindow().Execute(TWeakPtr<IWebBrowserWindow>(SharedThis(this))); } Scripting->UnbindCefBrowser(); InternalCefBrowser = nullptr; }
void PreferencesDialog::OnButton(wxCommandEvent& event) { switch (event.GetId()) { case ID_B_DONE: { wxCloseEvent fake; OnCloseWindow(fake); // handle on-exit stuff there break; } case ID_B_CANCEL: EndModal(wxCANCEL); break; // quality page stuff case ID_B_Q_LOW: iWormSegments->SetInteger(2); iWormSides->SetInteger(4); iBondSides->SetInteger(4); iHelixSides->SetInteger(8); iAtomSlices->SetInteger(5); iAtomStacks->SetInteger(3); break; case ID_B_Q_MED: iWormSegments->SetInteger(6); iWormSides->SetInteger(6); iBondSides->SetInteger(6); iHelixSides->SetInteger(12); iAtomSlices->SetInteger(10); iAtomStacks->SetInteger(8); break; case ID_B_Q_HIGH: iWormSegments->SetInteger(10); iWormSides->SetInteger(20); iBondSides->SetInteger(16); iHelixSides->SetInteger(30); iAtomSlices->SetInteger(20); iAtomStacks->SetInteger(14); break; // cache page stuff case ID_B_CACHE_BROWSE: { DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(tCache, ID_T_CACHE_FOLDER, wxTextCtrl) wxString path; path = wxDirSelector("Select a cache folder:", tCache->GetValue()); if (path.size() > 0 && wxDirExists(path.c_str())) tCache->SetValue(path); break; } case ID_B_CACHE_CLEAR: TruncateCache(0); break; default: event.Skip(); } }
void SFMLWorld::RunWorld(void) { window = new sf::RenderWindow(sf::VideoMode(windowWidth, windowHeight), "World window"); Clock cl = Clock(); totalElapsedSeconds = 0.0f; worldOver = false; float elapsed; sf::Event windowEvent; InitializeWorld(); cl.restart(); while (window->isOpen() && !worldOver) { //Handle window events first. while (window->pollEvent(windowEvent)) { if (windowEvent.type == sf::Event::Closed) { OnCloseWindow(); } else if (windowEvent.type == sf::Event::Resized) { OnWindowResized(windowEvent.size.width, windowEvent.size.height); } else { OnOtherWindowEvent(windowEvent); } } //Get elapsed time. elapsed = cl.getElapsedTime().asSeconds(); totalElapsedSeconds += elapsed; cl.restart(); //Call functions. if (elapsed > 0.0f) { UpdateWorld(elapsed); RenderWorld(elapsed); } } OnWorldEnd(); }
void AudacityLogger::OnClose(wxCommandEvent & WXUNUSED(e)) { wxCloseEvent dummy; OnCloseWindow(dummy); }
void SFMLWorld::RunWorld(void) { contextSettings = GenerateContext(); window = new sf::RenderWindow(GetModeToUse(windowWidth, windowHeight), GetWindowTitle().c_str(), GetSFStyleFlags(), contextSettings); Clock cl = Clock(); totalElapsedSeconds = 0.0f; worldOver = false; float elapsed; sf::Event windowEvent; InitializeWorld(); windowHasFocus = true; cl.restart(); while (window->isOpen() && !worldOver) { //Handle window events first. while (window->pollEvent(windowEvent)) { if (windowEvent.type == sf::Event::Closed) { OnCloseWindow(); } else if (windowEvent.type == sf::Event::Resized) { OnWindowResized(windowEvent.size.width, windowEvent.size.height); } else if (windowEvent.type == sf::Event::LostFocus) { windowHasFocus = false; OnWindowLostFocus(); } else if (windowEvent.type == sf::Event::GainedFocus) { windowHasFocus = true; OnWindowGainedFocus(); } else { OnOtherWindowEvent(windowEvent); } } //Get elapsed time. elapsed = cl.getElapsedTime().asSeconds(); cl.restart(); totalElapsedSeconds += elapsed; //Update various managers. Input.Update(elapsed, totalElapsedSeconds); Timers.UpdateTimers(elapsed); //Update and render. if (elapsed > 0.0f) { UpdateWorld(elapsed); RenderWorld(elapsed); } } OnWorldEnd(); delete window; window = 0; }
void PhonebookWindow::CloseWindow(){ PhoneBookModell.SaveToFile("phonebook.csv"); close(); emit OnCloseWindow(); }