Example #1
0
void defMsg::Load( String filePath )
{

	Clear() ;

	path = filePath ;
	name = GetFileTitle(path) ;
	VectorMap<String,String> ini = LoadIniFile(path) ;
	from = ini.Get("from")  ;
	subject = ini.Get("subject")  ;

	String s ;
	for (int i = 0; true; i++)
	{
		s = ini.Get("body" + AsString(i), "") ;
		if (s.IsEmpty())
			break ;
		qtfBody += s + "\r\n" ;
	}

	// guardamos este como Ășltimo cargado
	theCfg.lastMsg = path ;
	theCfg.Save() ;

}
Example #2
0
VectorMap<String, Value> Pdb::DataMap(const ArrayCtrl& a)
{
	VectorMap<String, Value> r;
	for(int i = 0; i < a.GetCount(); i++)
		r.Add(a.Get(i, 0), a.Get(i, 1));
	return r;
}
Example #3
0
void OutMode::CmdOptions()
{
	const Workspace& wspc = ide.IdeWorkspace();
	int pi = wspc.GetCount() > 0 ? 0 : -1;
	if (pi < 0) {
		PromptOK("No main package");
		return;
	}
	VectorMap<String, String> bm = ide.GetMethodVars(~method);
	if (bm.GetCount() == 0) {
		PromptOK("Invalid build method");
		return;
	}
	One<Host> host = ide.CreateHost(false);
	One<Builder> b = ide.CreateBuilder(~host);
	const String& p = wspc[pi];
	String output = NativePath(ide.OutDir(ide.PackageConfig(wspc, pi, bm, ~config, *host, *b), p, bm, true));
	if (output.Right(1) == ".")
		output = output.Left(output.GetCount() - 1);
	const ModePane& pane = ~mode == 0 ? debug : release;
	int blitzpackage = pane.package.Get(0, 2);
	bool blitzbuild = !wspc.package[pi].noblitz && pane.blitz
		&& (IsNull(blitzpackage) ? true : blitzpackage);
	CmdBuildOptionsWindow window(p, ~method, ~config, output,
		~mode, ide.hydra1_threads, pane.linkmode, blitzbuild, pane.map, ide.console.verbosebuild);
	LoadFromGlobal(window, "CmdBuildOptionsWindow");
	window.GenerateCmd();
	window.Run();
	StoreToGlobal(window, "CmdBuildOptionsWindow");
}
Example #4
0
void OutMode::Preset()
{
	int q = ide.recent_buildmode.Find(~method);
	SyncLock();
	if(q < 0) {
		VectorMap<String, String> map = GetMethodVars(~method);
		debug.linkmode = atoi(map.Get("DEBUG_LINKMODE", "0"));
		debug.debug = atoi(map.Get("DEBUG_INFO", "0"));
		debug.blitz = MapFlag(map, "DEBUG_BLITZ");
		release.linkmode = atoi(map.Get("RELEASE_LINKMODE", "0"));
		release.debug <<= 0;
		release.blitz = MapFlag(map, "RELEASE_BLITZ");
	}
	else {
		StringStream ss(ide.recent_buildmode[q]);
		TargetMode x;
		String dummy;
		int m;
		ss / m;
		ss % dummy;
		ss / m;
		mode = !!m;
		ss % x;
		debug.Load(x);
		ss % x;
		release.Load(x);
	}
}
Example #5
0
int  GetClipboardFormatCode(const char *format_id)
{
	GuiLock ___;
	int x = (int)(intptr_t)format_id;
	if(x >= 0 && x < 65535)
		return x;
	String fmt = format_id;
	if(fmt == "text")
		return CF_TEXT;
	if(fmt == "wtext")
		return CF_UNICODETEXT;
	if(fmt == "dib")
		return CF_DIB;
	if(fmt == "files")
		return CF_HDROP;
	static StaticMutex m;
	Mutex::Lock __(m);
	static VectorMap<String, int> format_map;
	int f = format_map.Find(format_id);
	if(f < 0) {
		f = format_map.GetCount();
		format_map.Add(format_id,
#ifdef PLATFORM_WINCE
			::RegisterClipboardFormat(ToSystemCharset(format_id))
#else
			::RegisterClipboardFormat(format_id)
#endif
		);
	}
	return format_map[f];
}
Example #6
0
Vector<FaceInfo> GetAllFacesSys()
{
	VectorMap<String, FaceInfo> list;
	sList = &list;
	list.Add("STDFONT").name = "STDFONT";
	list.Top().info = 0;
#ifdef PLATFORM_WINCE
	HDC hdc = CreateDC(NULL, NULL, NULL, NULL);
	Win32_ForceFace(hdc, "Tahoma", NULL);
	Win32_ForceFace(hdc, "Tahoma", "Tahoma");
	Win32_ForceFace(hdc, "Courier New", "Tahoma");
	Win32_ForceFace(hdc, "Tahoma", "Tahoma");
	Win32_ForceFace(hdc, "Tahoma", "Tahoma");
	Win32_ForceFace(hdc, "Tahoma", "Tahoma");
#else
	HDC hdc = CreateIC("DISPLAY", NULL, NULL, NULL);
	Win32_ForceFace(hdc, "Times New Roman", "Arial");
	Win32_ForceFace(hdc, "Arial", "Arial");
	Win32_ForceFace(hdc, "Courier New", "Arial");
	Win32_ForceFace(hdc, "Symbol", "Arial");
	Win32_ForceFace(hdc, "WingDings", "Arial");
	Win32_ForceFace(hdc, "Tahoma", "Arial");
#endif
	Win32_EnumFace(hdc, NULL);
	DeleteDC(hdc);
	return list.PickValues();
}
Example #7
0
void BenchNTL2(const char *file, Stream& out) {
	FileIn in(file);
	if (!in) {
		out << "Cannot open input file.\n";
		return;
	}

	VectorMap<String, int> map;
	
	for(;;) {
		int c = in.Get();
		if(c < 0) break;
		if(IsAlpha(c) || c == '_') {
			String id;
			id.Cat(c);
			c = in.Get();
			while(c >= 0 && (IsAlNum(c) || c == '_')) {
				id.Cat(c);
				c = in.Get();
			}
			map.GetAdd(id, 0)++;
		}
		else
		if(IsDigit(c))
			do c = in.Get();
			while(c >= 0 && (IsAlNum(c) || c == '.'));
	}

	Vector<int> order = GetSortOrder(map.GetKeys());
	for(int i = 0; i < order.GetCount(); i++)
		out << ~map.GetKey(order[i]) << ": " << map[order[i]] << '\n';
}
Example #8
0
PPMacro *FindPPMacro(const String& id, Index<int>& segment_id, int& segmenti)
{
	Index<int> undef;
	PPMacro *r;
	int best;
	for(int pass = 0; pass < 2; pass++) {
		r = NULL;
		best = segmenti;
		int line = -1;
		int q = sAllMacros.Find(id);
		while(q >= 0) {
			PPMacro& m = sAllMacros[q];
			if(m.macro.IsUndef()) {
				if(pass == 0 && segment_id.Find(m.segment_id) >= 0)
					undef.FindAdd(m.segment_id); // cancel out undefined macro...
			}
			else
			if(pass == 0 || m.segment_id == 0 || undef.Find(m.undef_segment_id) < 0) {
				int si = m.segment_id == 0 ? INT_MAX : segment_id.Find(m.segment_id); // defs macros always override
				if(si > best || si >= 0 && si == best && m.line > line) {
					best = si;
					line = m.line;
					r = &m;
				}
			}
			q = sAllMacros.FindNext(q);
		}
		if(undef.GetCount() == 0)
			break;
	}
	segmenti = best;
	return r;
}
	void SetTransform(const btTransform& aT, VectorMap<void*, int>& set){
		if (set.Find(mSelf) != set.end())
			return;
		mSelf->setWorldTransform(aT);
		mSelf->clearForces();
		set[mSelf] = 1;
		if (mGameFlag != 0)
			Logger::Log(FB_DEFAULT_LOG_ARG, FormatString("(info) Setting rigid body transform for %d", mGameFlag).c_str());
		auto numConstraints = mSelf->getNumConstraintRefs();
		for (int i = 0; i < numConstraints; ++i){
			auto con = mSelf->getConstraintRef(i);
			auto conType = con->getConstraintType();
			if (conType == FIXED_CONSTRAINT_TYPE || conType == D6_SPRING_2_CONSTRAINT_TYPE){
				btFixedConstraint* fixedCon = (btFixedConstraint*)con;
				auto a = &con->getRigidBodyA();
				auto b = &con->getRigidBodyB();
				auto trA = fixedCon->getFrameOffsetA();
				auto trB = fixedCon->getFrameOffsetB();
				if (b->getUserPointer() == mSelf){
					std::swap(a, b);
					std::swap(trA, trB);
				}
				auto bT = aT * trA * trB.inverse();
				auto rigidBodyImpl = (RigidBodyImpl*)b->getUserPointer();
				rigidBodyImpl->mImpl->SetTransform(bT, set);				
			}
		}
		mSelf->activate();
	}
Example #10
0
void SerializePPFiles(Stream& s)
{
	s % sAllMacros % sPPfile % sPPserial;
	if(s.IsLoading())
		LoadPPConfig();

#if 0
	if(s.IsLoading()) { _DBG_
		DDUMP(sPPfile.GetCount());
		DDUMP(sAllMacros.GetCount());
		DDUMP(sPPserial);
		
		Index<int> psegment;
		for(int i = 0; i < sPPfile.GetCount(); i++) {
			const PPFile& p = sPPfile[i];
			for(int j = 0; j < p.item.GetCount(); j++)
				psegment.FindAdd(p.item[j].segment_id);
		}
		DDUMP(psegment.GetCount());
			
		int n = 0; _DBG_
		Index<int> msegment;
		for(int i = 0; i < sAllMacros.GetCount(); i++) { _DBG_
			if(sAllMacros.IsUnlinked(i))
				n++;
			else
				msegment.FindAdd(sAllMacros[i].segment_id);
		}
		DLOG("UNLINKED " << n);
		DLOG("Segments " << msegment.GetCount());
	}
Example #11
0
void benchmark_VectorMap(const Vector<T>& key, const Vector<T>& fkey, int count)
{
	StopTime();
	cout << count << " items\n";
	{
		int i;
		VectorMap<T, int> map;
		StopTime();
		for(i = 0; i < count; i++)
			map.Add(key[i], i);
		cout << "Adding done in " << StopTime() << " s\n";
		for(int j = 0; j < 2; j++) {
			for(i = 0; i < count; i++)
				if(map.Get(fkey[i]) != i) {
					cout << "ERROR !\n";
					abort();
				}
			cout << "Search done in " << StopTime() << " s\n";
		}
		for(i = 0; i < count; i++)
			map.UnlinkKey(key[i]);
		cout << "Unlinking done in " << StopTime() << " s\n";
		for(i = 0; i < count; i++)
			map.Put(key[i], i);
		cout << "Putting done in " << StopTime() << " s\n";
	}
}
Example #12
0
void defList::Load(String filePath)
{
	Clear() ;

	path = filePath ;
	name = GetFileTitle(path) ;
	VectorMap<String,String> ini = LoadIniFile(path) ;
	fields = Split(ini.Get("fields", ""), ',' ) ;

	CSVParser csv ;
	for( int i=0; true; i++)
	{
		String s = ini.Get("data_" + AsString(i), "") ;
		if (s.IsEmpty())
			break ;

		data.Add(csv.ParseLine(s, fields.GetCount()) ) ;
	}

	for (int i=0; true; i++)
	{
		String s = ini.Get("error_" + AsString(i), "") ;
		if (s.IsEmpty())
			break ;
		errors.Add(s) ;
	}


	// guardamos este como Ășltimo cargado
	theCfg.lastList = path ;
	theCfg.Save() ;

}
Example #13
0
void Ide::BuildAndDebug0(const String& srcfile)
{
	if(Build()) {
		One<Host> h = CreateHostRunDir();
		h->ChDir(GetFileFolder(target));
		VectorMap<String, String> bm = GetMethodVars(method);
		String dbg = bm.Get("DEBUGGER", Null);
		if(IsNull(dbg)) {
			if(bm.Get("BUILDER", Null) == "MSC71") {
				String sln = ForceExt(target, ".sln");
				if(GetFileLength(sln) > 0)
					h->Launch("devenv \"" + h->GetHostPath(sln) + "\" "
					// + "\"" + h->GetHostPath(srcfile) + "\"" //TRC, 2011/09/26: wrong devenv argument
					);
				else
					h->Launch("devenv \"" + h->GetHostPath(target)
					//+ "\" \"" + h->GetHostPath(srcfile) //TRC, 2011/09/26: wrong devenv argument
					+ "\" /debugexe "
					);
				return;
			}
			dbg = "gdb";
		}
		else
			h->Launch('\"' + dbg + "\" \""
//			          + h->GetHostPath(srcfile) + ' '
			          + h->GetHostPath(target) + "\"", true);
	}
}
Example #14
0
bool LoadVarFile(const char *name, VectorMap<String, String>& _var)
{
	try {
		VectorMap<String, String> var;
		String env = LoadFile(name);
		CParser p(env);
		while(!p.IsEof()) {
			String v = p.ReadId();
			p.Char('=');
			if(p.IsString())
				var.GetAdd(v) = p.ReadString();
			else {
				String ln;
				while(p.PeekChar() != '\r' && p.PeekChar() != '\n' && p.PeekChar() != ';')
					ln.Cat(p.GetChar());
				var.GetAdd(v) = ln;
				p.Spaces();
			}
			p.Char(';');
		}
		_var = pick(var);
		return true;
	}
	catch(...) {
		return false;
	}
}
Example #15
0
bool SaveVarFile(const char *filename, const VectorMap<String, String>& var)
{
	FileOut out(filename);
	for(int i = 0; i < var.GetCount(); i++)
		out << var.GetKey(i) << " = " << AsCString(var[i]) << ";\n";
	out.Close();
	return !out.IsError();
}
Example #16
0
void SEGgradientInPsi(const VectorMap& psi, const deformableImage& I0, const Vector &ps, VectorMap &b, vector<_real> &resol)
{
  Vector I ;
  psi.multilinInterp(I0.img(), I) ;
  psi.multilinInterpGradient(I0.img(), b) ;
  b *= I ;
  b*= ps ;
}
Example #17
0
bool ImageDesignManager::validateCustomizationString(CustomizationVariables* data, const String& appearanceFilename, int skillLevel) {
	VectorMap<String, Reference<CustomizationVariable*> > variables;
	variables.setNullValue(NULL);
	AssetCustomizationManagerTemplate::instance()->getCustomizationVariables(appearanceFilename.hashCode(), variables, false);

	if (variables.size() == 0) {
		instance()->error("no customization data found for " + appearanceFilename);
		return false;
	}

	for (int i = 0; i < data->size(); ++i) {
		uint8 id = data->elementAt(i).getKey();
		int16 val = data->elementAt(i).getValue();

		String name = CustomizationIdManager::instance()->getCustomizationVariable(id);

		//instance()->info("validating " + name + " with value " + String::valueOf(val), true);

		CustomizationVariable* customizationVariable = variables.get(name).get();

		if (customizationVariable == NULL) {
			instance()->error("customization variable id " + String::valueOf(id) + " not found in the appearance file " + appearanceFilename + " with value " + String::valueOf(val));

			continue;
		}

		PaletteColorCustomizationVariable* palette = dynamic_cast<PaletteColorCustomizationVariable*>(customizationVariable);

		if (palette != NULL) {
			if (!validatePalette(palette, val, skillLevel))
				return false;
		} else {
			BasicRangedIntCustomizationVariable* range = dynamic_cast<BasicRangedIntCustomizationVariable*>(customizationVariable);

			if (range == NULL) {
				instance()->error("unkown customization variable type " + name);
				return false;
			} else {
				int maxExcl = range->getMaxValueExclusive();
				int minIncl = range->getMinValueInclusive();

				if (val >= maxExcl || val < minIncl) {
					instance()->error("variable outside bounds " + name + " value " + val + " outside bounds [" + String::valueOf(minIncl) + "," + String::valueOf(maxExcl) + ")");

					return false;
				} else {
					//instance()->info("variable " + name + " value " + String::valueOf(val) + " inside bounds [" + String::valueOf(minIncl) + "," + String::valueOf(maxExcl) + ")", true);
				}

			}
		}


		//info("setting variable:" + name + " to " + String::valueOf(val), true);
	}

	return true;
}
Example #18
0
VectorMap<String, String> DataMap(const ArrayCtrl& data)
{
	GuiLock __;
	
	VectorMap<String, String> m;
	for(int i = 0; i < data.GetCount(); i++)
		m.Add(data.Get(i, 0), data.Get(i, 1));
	return m;
}
Example #19
0
void Ide::BuildAndDebug(bool runto)
{
	VectorMap<String, String> bm = GetMethodVars(method);
	String builder = bm.Get("BUILDER", "");
	if(!Build())
		return;
	if(!FileExists(target))
		return;
	if(designer)
		EditAsText();
	One<Host> host = CreateHostRunDir();
	host->ChDir(Nvl(rundir, GetFileFolder(target)));
	HideBottom();
	editor.Disable();
#ifdef COMPILER_MSC
	if(builder == "GCC")
		if(gdbSelector)
			debugger = Gdb_MI2Create(host, target, runarg);
		else
			debugger = GdbCreate(host, target, runarg);
	else
		debugger = PdbCreate(host, target, runarg);
#else
	if(gdbSelector)
		debugger = Gdb_MI2Create(host, target, runarg);
	else
		debugger = GdbCreate(host, target, runarg);
#endif
	if(!debugger) return;
	debuglock = 0;
	const Workspace& wspc = IdeWorkspace();
	for(int i = 0; i < wspc.GetCount(); i++) {
		const Package& pk = wspc.GetPackage(i);
		String n = wspc[i];
		for(int i = 0; i < pk.file.GetCount(); i++) {
			String file = SourcePath(n, pk.file[i]);
			LineInfo& ln = Filedata(file).lineinfo;
			for(int i = 0; i < ln.GetCount(); i++) {
				LineInfoRecord& lr = ln[i];
				if(!lr.breakpoint.IsEmpty())
					if(!debugger->SetBreakpoint(file, lr.lineno, lr.breakpoint)) {
						lr.breakpoint = "\xe";
						if(PathIsEqual(file, editfile))
							editor.SetBreakpoint(lr.lineno, "\xe");
					}
			}
		}
	}
	SetBar();
	editor.Enable();
	if(runto) {
		if(!debugger->RunTo())
			IdeEndDebug();
	}
	else
		debugger->Run();
}
Example #20
0
void Themed::LoadTheme(const char *dir)
{
	theme.Clear();
	FindFile ff(AppendFileName(dir, "*.class"));
	while(ff) {
		String cls = ToLower(GetFileTitle(ff.GetName()));
		theme.GetAdd(cls).Load(dir, cls);
		ff.Next();
	}
}
Example #21
0
Time GetFileTimeCached(const String& p)
{
	LTIMING("GetFileTimeCached");
	int q = sPathFileTime.Find(p);
	if(q >= 0)
		return sPathFileTime[q];
	Time m = FileGetTime(p);
	sPathFileTime.Put(p, m);
	return m;
}
int SaberInventoryContainerComponent::canAddObject(SceneObject* sceneObject, SceneObject* object, int containmentType, String& errorDescription) {

	ManagedReference<SceneObject*> p = sceneObject->getParent();

	if (p != NULL){
		int containment = p->getContainmentType();
		if (containment == 4){
		errorDescription = "@jedi_spam:saber_not_while_equpped";
		return TransferErrorCode::INVALIDTYPE;
		}
	}

	if (!object->isLightsaberCrystalObject()) {
		errorDescription = "@jedi_spam:saber_not_crystal";
		return TransferErrorCode::INVALIDTYPE;
	}

	LightsaberCrystalComponent* crystal = cast<LightsaberCrystalComponent*> (object);

	if (crystal->getOwner() == ""){
		errorDescription = "@jedi_spam:saber_crystal_not_tuned";
		return TransferErrorCode::INVALIDTYPE;
	}

	ManagedReference<CreatureObject*> creature = cast<CreatureObject*>(object->getParent().get().get());

	if (creature != NULL && crystal->getOwner() != creature->getDisplayedName()){
		errorDescription = "@jedi_spam:saber_crystal_not_owner";
		return TransferErrorCode::INVALIDTYPE;
	}

	if (crystal->isDestroyed()) {
		errorDescription = "You cannot add a broken crystal to your lightsaber.";
		return TransferErrorCode::INVALIDTYPE;
	}

	VectorMap<uint64, ManagedReference<SceneObject*> >* containerObjects = sceneObject->getContainerObjects();

	if (containerObjects->size() >= sceneObject->getContainerVolumeLimit()) {
		errorDescription = "@container_error_message:container03"; //This container is full.
		return TransferErrorCode::CONTAINERFULL;
	}

	for (int i = 0; i < containerObjects->size(); i++){
		Reference<LightsaberCrystalComponent*> crystalInside =  sceneObject->getContainerObject(i).castTo<LightsaberCrystalComponent*>();

		if (crystal->getColor() != 31 && crystalInside->getColor() != 31){
				errorDescription = "@jedi_spam:saber_already_has_color";
				return TransferErrorCode::INVALIDTYPE;
		}
	}

	return 0;
}
Example #23
0
VectorMap<String, SqlColumnInfo> Describe(const SqlVal& table, Sql& cursor)
{
    VectorMap<String, SqlColumnInfo> map;
    if(cursor * SelectAll().From(table).Where(SqlBool::False()))
        for(int i = 0, n = cursor.GetColumns(); i < n; i++)
        {
            const SqlColumnInfo& sci = cursor.GetColumnInfo(i);
            map.Add(sci.name, sci);
        }
    return map;
}
Example #24
0
G_obj *Get(G_obj *(*widget)())
{
	static VectorMap<uintptr_t, G_obj *> wmap;
	G_obj *w = wmap.Get((uintptr_t)widget, NULL);
	if(!w) {
		w = (*widget)();
		if(GTK().gtk_widget_get_parent(w) == NULL)
			Setup(w);
		wmap.Add((uintptr_t)widget, w);
	}
	return w;
}
Example #25
0
void SaveImages(const char *dir, const char *prefix, const VectorMap<String, Image>& img)
{
	for(int i = 0; i < img.GetCount(); i++) {
		String fn;
		if(prefix)
			fn << prefix;
		Point p1 = img[i].GetHotSpot();
		Point p2 = img[i].Get2ndSpot();
		fn << img.GetKey(i) << '.' << p1.x << '.' << p1.y << '.' << p2.x << '.' << p2.y << ".png";
		PNGEncoder().SaveFile(AppendFileName(dir, fn), img[i]);
	}
}
Example #26
0
float EventInterpreter::getMean(const VectorMap& items){
    
        float sum = 0;
  
        for(VectorMap::const_iterator i=items.begin();i != items.end(); ++i){
    
            sum += *i;
    
        }
        
        return (sum/items.size());
    
    }
Example #27
0
bool DlgCompareDir::FetchDir(String dir, VectorMap<String, FileInfo>& files, VectorMap<String, String>& dirs)
{
	FindFile ff;
	if(!ff.Search(AppendFileName(dir, "*")))
		return false;
	do
		if(ff.IsFile() && PatternMatchMulti(fm, ff.GetName()))
			files.Add(NormalizePathCase(ff.GetName()), FileInfo(ff.GetName(), ff.GetLength(), ff.GetLastWriteTime()));
		else if(ff.IsFolder())
			dirs.Add(NormalizePathCase(ff.GetName()), ff.GetName());
	while(ff.Next());
	return true;
}
void CraftingSessionImplementation::addSkillMods() {
	ManagedReference<ManufactureSchematic*> manufactureSchematic = this->manufactureSchematic.get();
	ManagedReference<TangibleObject*> prototype = this->prototype.get();

	ManagedReference<DraftSchematic*> draftSchematic = manufactureSchematic->getDraftSchematic();

	VectorMap<String, int>* skillMods = draftSchematic->getDraftSchematicTemplate()->getSkillMods();

	for (int i = 0; i < skillMods->size(); i++) {
		VectorMapEntry<String, int> mod = skillMods->elementAt(i);
		prototype->addSkillMod(SkillModManager::WEARABLE, mod.getKey(), mod.getValue(), false);
	}
}
	ShaderPtr GetShader(int ResourceTypes_Shaders){
		auto it = mShaders.Find(ResourceTypes_Shaders);
		if (it == mShaders.end()){
			auto shader = CreateShader(ResourceTypes_Shaders);
			if (!shader){
				Logger::Log(FB_ERROR_LOG_ARG, FormatString("Resource Provider - Failed to create the shader (%d)", ResourceTypes_Shaders).c_str());
				return 0;
			}
			mShaders[ResourceTypes_Shaders] = shader;
			return shader;
		}
		return it->second;
	}
Example #30
0
void Puzzle::Scores()
{
    WithScoreLayout<TopWindow> d;
    CtrlLayoutOK(d, t_("Best scores"));
    d.score.AddColumn(t_("Dimension"));
    d.score.AddColumn(t_("Moves"));
    d.score.ColumnWidths("71 48");
    d.score.NoCursor().NoGrid();
    Vector<int> o = GetSortOrder(score.GetKeys());
    for(int i = 0; i < o.GetCount(); i++)
        d.score.Add(score.GetKey(o[i]), score[o[i]]);
    d.Run();
}