//---------------------------------------------------------------------------


#pragma hdrstop

#include "Environment.h"
#include "MultiLanguage.h"

#include <iostream>
using namespace std;

#pragma package(smart_init)
#pragma link "TntStdCtrls"
#pragma link "TntExtCtrls"
#pragma link "TntGrids"

//---------------------------------------------------------------------------

TProgramPath ProgramPath;

void ComponentSetFontName(TComponent *pComponent, const AnsiString aFontName)
{
	int i;
	for (i = 0; i < pComponent->ComponentCount; i++)
	{
		if (pComponent->Components[i]->InheritsFrom(__classid(TButton)))
			((TButton *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TLabel)))
			((TLabel *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TEdit)))
			((TEdit *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TMemo)))
			((TMemo *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TButton)))
			((TButton *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TGroupBox)))
			((TGroupBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TRadioGroup)))
			((TRadioGroup *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TComboBox)))
			((TComboBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TCheckBox)))
			((TCheckBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TRadioButton)))
			((TRadioButton *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TListBox)))
			((TListBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TPanel)))
			((TPanel *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TStringGrid)))
			((TStringGrid *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TStaticText)))
			((TStaticText *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntLabel)))
			((TTntLabel *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntEdit)))
			((TTntEdit *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntButton)))
			((TTntButton *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntMemo)))
			((TTntMemo *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntStaticText)))
			((TTntStaticText *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntGroupBox)))
			((TTntGroupBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntRadioGroup)))
			((TTntRadioGroup *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntComboBox)))
			((TTntComboBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntCheckBox)))
			((TTntCheckBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntRadioButton)))
			((TTntRadioButton *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntListBox)))
			((TTntListBox *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntPanel)))
			((TTntPanel *)(pComponent->Components[i]))->Font->Name = aFontName;
		else if (pComponent->Components[i]->InheritsFrom(__classid(TTntStringGrid)))
			((TTntStringGrid *)(pComponent->Components[i]))->Font->Name = aFontName;
    else if (pComponent->Components[i]->InheritsFrom(__classid(TQRLabel)))
			((TQRLabel *)(pComponent->Components[i]))->Font->Name = aFontName;


		// Àç±ÍÈ£Ãâ      
		ComponentSetFontName(pComponent->Components[i], aFontName);
	}
}

//---------------------------------------------------------------------------

