//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Environment_F.h" #include "Main_F.h" #include "common.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" //--------------------------------------------------------------------------- #define IDS_ENVIRONMENT StringTable[0] #define IDS_ENVIRONMENT_LANGUAGE StringTable[1] #define IDS_ENVIRONMENT_FONT StringTable[2] #define IDS_ENVIRONMENT_FONT_CHANGE StringTable[3] //--------------------------------------------------------------------------- TEnvironment *Environment; //--------------------------------------------------------------------------- __fastcall TEnvironment::TEnvironment(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TEnvironment::LanguageComboBoxChange(TObject *Sender) { TIniFile *IniFile = new TIniFile(BaseDir + "\\Environment.ini"); if (IniFile) { IniFile->WriteString("Environment", "Language", LanguageComboBox->Text); delete IniFile; } ShowMessage(IDS_MESSAGE_RERUN_TO_UPDATE); } //--------------------------------------------------------------------------- void __fastcall TEnvironment::FormCreate(TObject *Sender) { SetFont(); Left=100; Top=100; LanguageComboBox->Text=Language; StringTable.Create(BaseDir, Language, "Environment"); Caption=IDS_ENVIRONMENT; lbLanguage->Caption=IDS_ENVIRONMENT_LANGUAGE; lbFont->Caption=IDS_ENVIRONMENT_FONT; sbFont->Caption=IDS_ENVIRONMENT_FONT_CHANGE; } //--------------------------------------------------------------------------- void __fastcall TEnvironment::SetFont(){ SetSmallFont(Font); SetSmallFont(lbFont->Font); SetSmallFont(sbFont->Font); SetSmallFont(lbLanguage->Font); } //--------------------------------------------------------------------------- void __fastcall TEnvironment::sbFontClick(TObject *Sender) { FontDialog->Font->Assign(SmallFont); if (FontDialog->Execute()) { SmallFont->Assign(FontDialog->Font); TIniFile *IniFile = new TIniFile(BaseDir + "\\Environment.ini"); if (IniFile) { SaveFont(IniFile, SmallFont, "Font"); delete IniFile; } ShowMessage(IDS_MESSAGE_RERUN_TO_UPDATE); } } //---------------------------------------------------------------------------