void CreateDatabaseDialogue::OnTabChanged(wxNotebookEvent& event) { if (tabsNotebook == NULL) return; unsigned page = event.GetSelection(); if (page == tabsNotebook->GetPageCount() - 1) { wxString sql; GenerateScript(WxStringConcatenator(sql, _T("\n\n"))); scriptInput->SetValue(sql); } }
void CreateDatabaseDialogue::OnExecute(wxCommandEvent& event) { switch (modeInput->GetCurrentSelection()) { case MODE_EXECUTE: { std::vector<wxString> commands; GenerateScript(std::back_inserter(commands)); launcher->DoWork(new ExecuteScriptWork(launcher->GetDatabaseRef(), this, commands)); FindWindow(wxID_OK)->Disable(); FindWindow(wxID_CANCEL)->Disable(); return; // don't destroy the dialog } break; case MODE_WINDOW: { wxString script; GenerateScript(WxStringConcatenator(script, _T("\n\n"))); PQWXDatabaseEvent evt(launcher->GetServerConnection(), launcher->GetDatabaseName(), PQWX_ScriptToWindow); evt.SetString(script); // wxDialog will not propagate events up, but we need to reach the frame. GetParent()->ProcessEvent(evt); } break; case MODE_CLIPBOARD: { wxString script; GenerateScript(WxStringConcatenator(script, _T("\n\n"))); if (wxTheClipboard->Open()) { wxTheClipboard->SetData(new wxTextDataObject(script)); wxTheClipboard->Close(); } } break; case MODE_FILE: wxMessageBox(_T("TODO")); break; } Destroy(); }
void ffw_save(const char * filename) { char * _filename = strcopy(filename); char * _ = strcopy(""); int r = GenerateScript(cur_fv->sf, _filename , _, -1, -1, NULL, NULL, cur_fv->map, NULL, ly_fore); free(_); free(_filename); if(!r) err("Cannot save font to %s\n", filename); }