//---------------------------------------------------------------------------
void __fastcall TDesign::Button1Click(TObject *Sender)
{
	EventColor = ColorBox1->Selected;
	SelectColor = ColorBox2->Selected;
    if(FileExists(ExtractFilePath(Application->ExeName) + "\\settings.ini"))
	{
		TIniFile *inifile;
		inifile = new TIniFile(ExtractFilePath(Application->ExeName) + "\\settings.ini");
		inifile->WriteInteger("Color", "EventColor", EventColor);
		inifile->WriteInteger("Color", "SelectColor", SelectColor);
        inifile->UpdateFile();
		inifile->Free();
	}
	Close();
	MainForm->Draw();
}
示例#2
0
void TDataManager::saveSettings(vector <TKHR*> vKHRList, int mask)
{
  	AnsiString IniName = ExtractFilePath(Application->ExeName)+AnsiString("setting.ini");

//	AnsiString path = ExtractFilePath(Application->ExeName)+AnsiString(INI_FILE);
	if (FileExists(IniName))
	{
		TIniFile *ini = new TIniFile(IniName);
	 //	ini->CleanupInstance();
		ini->EraseSection("LoadedFiles");
		for(int i = 1; i <= vKHRList.size(); i++)
		{
			AnsiString tempfile = "file"+IntToStr(i);
			ini->WriteString("LoadedFiles",tempfile, vKHRList[i-1]->path.c_str());
		}

		AnsiString tempfile = "mask";
		ini->WriteString("RowSettings",tempfile, mask);

		ini->UpdateFile();
		delete ini;
	}
}