void Shader::OnRecent(wxCommandEvent& evt) { wxString file; if (m_RecentMenu->Get(evt.GetId(), file) && ConfirmSave() != wxID_CANCEL) { Open(file); } }
void Shader::OnNew(wxCommandEvent& evt) { if (ConfirmSave() != wxID_CANCEL) { NewProject(m_ProjectsMenu->GetLabelText(evt.GetId())); m_FileName.Empty(); } }
void Shader::Open() { if (ConfirmSave() != wxID_CANCEL) { wxFileDialog dialog(this, wxT("Open file"), m_FilePath, wxT(""), wxT("Shader files (*.graphshader)|*.graphshader|All files (*.*)|*.*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST); if (dialog.ShowModal() == wxID_OK) { Open(dialog.GetPath()); } } }
//----------------------------------------------------------------------------- // Name: void DestroyChildren(HWND hWnd)() // Desc: //----------------------------------------------------------------------------- void DestroyChildren(HWND hClient) { HWND hWnd = (HWND)SendMessage(hClient, WM_MDIGETACTIVE, 0, 0); HWND hLast = NULL; while (hWnd != hLast) { hLast = hWnd; ConfirmSave(hWnd); SendMessage(hClient, WM_MDIDESTROY, (WPARAM)hWnd, 0); hWnd = (HWND)SendMessage(hClient, WM_MDIGETACTIVE, 0, 0); } }
void Shader::OnClose(wxCloseEvent& evt) { SaveConfig(); if (evt.CanVeto()) { if (ConfirmSave() != wxID_CANCEL) { goto destroy; } else { evt.Veto(); } } else { Save(); destroy: Project::Destroy(); Destroy(); } }