bool BaseSetupDlg::Run(String& vars) { upp <<= GetVar("UPP"); output <<= GetVar("OUTPUT"); base <<= vars; new_base = IsNull(vars); while(TopWindow::Run() == IDOK) { String varname = ~base; String varfile = VarFilePath(varname); if(varname != vars) { if(FileExists(varfile) && !PromptOKCancel(NFormat("Overwrite existing assembly [* \1%s\1]?", varfile))) continue; if(!SaveVars(varname)) { Exclamation(NFormat("Error writing assmbly [* \1%s\1].", VarFilePath(varname))); continue; } } SetVar("UPP", ~upp); SetVar("OUTPUT", ~output); Vector<String> paths = SplitDirs(upp.GetText().ToString()); for(int i = 0; i < paths.GetCount(); i++) RealizeDirectory(paths[i]); RealizeDirectory(output); vars = varname; return true; } return false; }
//Funcion checks if player definitly can move bool MainGame::WillMove() { if(aithinking) { return true; } if(currentmove != currentmaxmove) { return PromptOKCancel(L_DELETEMOVE); } return true; }
void DockBase::DelWidgetLayout(String name) { int id = layouts.Find(name); if(id < 0) return; if(PromptOKCancel(Format(t_("Do you really want to delete layout '%s'"), name))) { layouts.RemoveKey(name); controlpanel.layoutlist.Remove(id); id--; controlpanel.layoutlist.SetIndex(layoutindex = id); } }
void MapEditor::OnMoveLevel(int s, int e) { _map.GetLevels().Swap(s - 1, e - 1); if (PromptOKCancel(t_("Recalculate mipmaps for moved levels now?"))) { OnLevelMapCalc( _map.GetLevels()[s - 1], s - 1 ); OnLevelMapCalc( _map.GetLevels()[e - 1], e - 1 ); } SetTimeCallback(1, THISBACK(UpdateLevelList)); }
void Ide::AddPackage(const String& p) { const Workspace& wspc = IdeWorkspace(); for(int i = 0; i < wspc.GetCount(); i++){ if(wspc[i] == p) return; } if(!PromptOKCancel("Package [* " + p + "] is not yet in the workspace.&Do you want to add it?")) return; OptItem& m = actual.uses.Add(); m.text = p; SaveLoadPackage(); }
void SelectPackageDlg::OnBaseRemove() { int c = base.GetCursor(); if(c < 0) return; String next; if(c + 1 < base.GetCount()) next = base.Get(c + 1); else if(c > 0) next = base.Get(c - 1); String vars = base.Get(0); String varpath = VarFilePath(vars); if(PromptOKCancel(NFormat("Remove base file [* \1%s\1]?", varpath)) && !FileDelete(varpath)) Exclamation(NFormat("Error deleting file [* \1%s\1].", varpath)); SyncBase(next); }
void DockBase::DeleteWidgetGroup(String name) { TreeCtrl& tree = grouptab.grouptree; if(name == t_("Default")) return; if(PromptOKCancel(Format(t_("Do you really want to delete group '%s'"), name))) { groups.RemoveKey(name); int id = tree.Find(name); if(id >= 0) { tree.RemoveChildren(id); tree.Remove(id); } tree.Refresh(); } }
void DockBase::OnAddNewLayout() { String name; if(EditText(name, t_("Add new layout"), t_("Layout name:"), 32)) { if(IsNull(name)) { Exclamation(t_("You must enter a name for the new layout")); return; } else if(layouts.Find(name) >= 0) { if(!PromptOKCancel(Format(t_("Layout '%s' adready exists. Do you want to overwrite it?"), name))) return; } NewWidgetLayout(name); RefreshPanel(); } }
bool FileTabsExample::OnCloseAllConfirm() { return PromptOKCancel("Close all tabs?") == 0; }
bool FileTabsExample::OnCloseConfirm(Value v) { return PromptOKCancel(Format("Close '%s'?", DeQtf((String)v))) == 0; }
void bigmailer::DataPageImportCSV() { FileSel fs ; fs.ActiveDir(ConfigFile("")) ; fs.Type("csv files", "*.csv") ; if ( ! fs.ExecuteOpen(t_("")) ) return; csvResult csv ; if ( ! csv.ImportFrom(fs.Get()) ) return ; WithcsvToDefLayout<TopWindow> dlg; CtrlLayout(dlg, "Import From CSV"); for (int i = 0; i < csv.fields.GetCount(); i++) { dlg.dropName.Add( csv.fields[i] ) ; dlg.dropEmail.Add( csv.fields[i] ) ; } dlg.dropName.SetIndex(0) ; dlg.dropEmail.SetIndex(1) ; dlg.btOk.WhenAction = Breaker(IDOK) ; dlg.btCancel.WhenAction = Breaker( IDCANCEL ) ; if (dlg.Execute() == IDOK) { if (PromptOKCancel("Con esta operación se van a eliminar [* TODOS]") == IDOK) { // añadimos la cabecera theDefList.fields.Clear() ; theDefList.fields.Add( dlg.dropName.GetValue() ) ; theDefList.fields.Add( dlg.dropEmail.GetValue() ) ; for (int i = 0; i < csv.fields.GetCount(); i++) { String f = csv.fields[i] ; if (f != theDefList.fields[0] && f != theDefList.fields[1]) theDefList.fields.Add(f) ; } theDefList.data.Clear() ; for (int i = 0; i < csv.values.GetCount(); i++) // para cada registro { Vector<String>& line = csv.values[i] ; Vector<String>& record = theDefList.data.Add() ; for (int j = 0; j < theDefList.fields.GetCount(); j++) { String fieldName = theDefList.fields[j] ; for (int k = 0; k < csv.fields.GetCount(); k++) { if (fieldName == csv.fields[k]) { record.Add( line[k] ) ; break ; } } } } theDefList.Save() ; DataPageFill() ; } } }
void RasterCtrlTestWindow::Menu_File_Exit_cb() { if ( PromptOKCancel( "Exit RasterCtrlTest ?" ) ) Break(); } // END RasterCtrlTestWindow::Menu_File_Exit_cb()