yeni bir kök form oluşturun, diğer formları bı form tipinde create edin.
Kod: Tümünü seç
unit uKokform;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,TntClasses,tntdialogs,tntforms,tntcomctrls,TntStdCtrls,TntButtons,TntMenus,TntExtCtrls,tntdbctrls,TntDBGrids;
type
TKokForm = class(TTntForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
KokForm: TKokForm;
implementation
uses dil;
{$R *.dfm}
procedure TKokForm.FormCreate(Sender: TObject);
var iComp,iFont,iSubitem:integer;
begin
for iComp := 0 to ComponentCount-1 do
begin
{------------------------------------------------}
{ T T N T F O R M S }
{------------------------------------------------}
if (components[iComp] is TTntForm) then
begin
(components[iComp] as TTntForm).caption := SearchCaption(Name,(components[iComp] as TTntForm).Name,(components[iComp] as TTntForm).caption,iFont);
end
{------------------------------------------------}
{ T T N T P A N E L }
{------------------------------------------------}
else if (components[iComp] is TTntPanel) then
begin
iFont :=(components[iComp] as TTntPanel).Font.Size;
(components[iComp] as TTntPanel).caption := SearchCaption(Name,(components[iComp] as TTntPanel).Name,(components[iComp] as TTntPanel).caption,iFont);
if iFont <> (components[iComp] as TTntPanel).Font.Size then
(components[iComp] as TTntPanel).Font.Size := iFont;
end
{------------------------------------------------}
{ T T N T D B G R I D }
{------------------------------------------------}
else if (components[iComp] is TTntDBGrid) then
for iSubitem := 0 to (components[iComp] as TTntDBGrid).Columns.Count -1 do
begin
iFont :=(components[iComp] as TTntDBGrid).Columns[iSubitem].Title.Font.size;
(components[iComp] as TTntDBGrid).Columns[iSubitem].Title.Caption := SearchCaption(Name,(components[iComp] as TTntDBGrid).Name+inttostr(iSubitem),(components[iComp] as TTntDBGrid).Columns[iSubitem].Title.Caption,iFont);
if iFont <> (components[iComp] as TTntDBGrid).Columns[iSubitem].Title.Font.size then
(components[iComp] as TTntDBGrid).Columns[iSubitem].Title.Font.size := iFont;
end
{------------------------------------------------}
{ T T N T T O O L B U T T O N }
{------------------------------------------------}
else if (components[iComp] is TTntToolButton) then
begin
(components[iComp] as TTntToolButton).Caption := SearchCaption(Name,(components[iComp] as TTntToolButton).name,(components[iComp] as TTntToolButton).Caption,iFont);
(components[iComp] as TTntToolButton).Hint := SearchCaption(Name,(components[iComp] as TTntToolButton).name+'HINT',(components[iComp] as TTntToolButton).Hint,iFont);
end
{------------------------------------------------}
{ T T N T S P E E D B U T T O N }
{------------------------------------------------}
else if (components[iComp] is TTntSpeedButton) then
begin
iFont :=(components[iComp] as TTntSpeedButton).Font.Size;
(components[iComp] as TTntSpeedButton).caption := SearchCaption(Name,(components[iComp] as TTntSpeedButton).Name,(components[iComp] as TTntSpeedButton).caption,iFont);
if iFont <> (components[iComp] as TTntSpeedButton).Font.Size then
(components[iComp] as TTntSpeedButton).Font.Size := iFont;
end
{------------------------------------------------}
{ T T n t D B R a d i o G r o u p }
{------------------------------------------------}
else if (components[iComp] is TTntDBRadioGroup) then
for iSubitem := 0 to (components[iComp] as TTntDBRadioGroup).Items.Count -1 do
begin
iFont :=(components[iComp] as TTntDBRadioGroup).Font.Size;
(components[iComp] as TTntDBRadioGroup).Items.Strings[iSubitem] := SearchCaption(Name,(components[iComp] as TTntDBRadioGroup).Name+inttostr(iSubitem),(components[iComp] as TTntDBRadioGroup).Items.Strings[iSubitem],iFont);
if iFont <> (components[iComp] as TTntDBRadioGroup).Font.Size then
(components[iComp] as TTntDBRadioGroup).Font.Size := iFont;
end
{------------------------------------------------}
{ T T n t M E N U I T E M }
{------------------------------------------------}
else if (components[iComp] is TTntMenuItem) then
begin
(components[iComp] as TTntMenuItem).Caption := SearchCaption(Name,(components[iComp] as TTntMenuItem).name,(components[iComp] as TTntMenuItem).Caption,iFont);
(components[iComp] as TTntMenuItem).Hint := SearchCaption(Name,(components[iComp] as TTntMenuItem).name+'HINT',(components[iComp] as TTntMenuItem).Hint,iFont);
end
{------------------------------------------------}
{ T T N T L A B E L }
{------------------------------------------------}
else if (components[iComp] is TTntLabel) then
begin
iFont :=(components[iComp] as TTntLabel).Font.Size;
(components[iComp] as TTntLabel).caption := SearchCaption(Name,(components[iComp] as TTntLabel).Name,(components[iComp] as TTntLabel).caption,iFont);
if iFont <> (components[iComp] as TTntLabel).Font.Size then
(components[iComp] as TTntLabel).Font.Size := iFont;
end
{------------------------------------------------}
{ T T N T B U T T O N }
{------------------------------------------------}
else if (components[iComp] is TTntButton) then
begin
iFont :=(components[iComp] as TTntButton).Font.Size;
(components[iComp] as TTntButton).caption := SearchCaption(Name,(components[iComp] as TTntButton).Name,(components[iComp] as TTntButton).caption,iFont);
if iFont <> (components[iComp] as TTntButton).Font.Size then
(components[iComp] as TTntButton).Font.Size := iFont;
end
{------------------------------------------------}
{ T T N T B I T B T N }
{------------------------------------------------}
else if (components[iComp] is TTntBitBtn) then
begin
iFont :=(components[iComp] as TTntBitBtn).Font.Size;
(components[iComp] as TTntBitBtn).caption := SearchCaption(Name,(components[iComp] as TTntBitBtn).Name,(components[iComp] as TTntBitBtn).caption,iFont);
if iFont <> (components[iComp] as TTntBitBtn).Font.Size then
(components[iComp] as TTntBitBtn).Font.Size := iFont;
end
{------------------------------------------------}
{ T T N T C H E C K B O X }
{------------------------------------------------}
else if (components[iComp] is TTntCheckBox) then
begin
iFont :=(components[iComp] as TTntCheckBox).Font.Size;
(components[iComp] as TTntCheckBox).caption := SearchCaption(Name,(components[iComp] as TTntCheckBox).Name,(components[iComp] as TTntCheckBox).caption,iFont);
if iFont <> (components[iComp] as TTntCheckBox).Font.Size then
(components[iComp] as TTntCheckBox).Font.Size := iFont;
end
{------------------------------------------------}
{ T T n t T r e e V i e w }
{------------------------------------------------}
else if (components[iComp] is TTntTreeView) then
for iSubitem := 0 to (components[iComp] as TTntTreeView).Items.Count -1 do
begin
iFont :=(components[iComp] as TTntTreeView).Font.Size;
(components[iComp] as TTntTreeView).Items.Item[iSubitem].Text := SearchCaption(Name,(components[iComp] as TTntTreeView).Name+inttostr(iSubitem),(components[iComp] as TTntTreeView).Items.Item[iSubitem].Text,iFont);
if iFont <> (components[iComp] as TTntTreeView).Font.Size then
(components[iComp] as TTntTreeView).Font.Size := iFont;
end
end; // for
end;
end.
SearchCaption ise sizin bileşenin adından texti getirecek fonksiyon, bunuda istediğiniz şekilde yazın, mesela
Kod: Tümünü seç
function SearchCaption(sFormname,sCompName:string;wDefault:widestring;var FontSize:integer):widestring;
var iDongu:integer;
begin
result := '';
if (wDefault = '') or (wDefault = ' ') then exit;
result := wDefault;
for iDongu:= 1 to MAX_CAPTIONS do
if (uppercase(language.Captions[iDongu].FormName) = uppercase(sFormName)) and
(uppercase(language.Captions[iDongu].CompName) = uppercase(sCompName)) then
begin
Result := language.Captions[iDongu].Text;
exit;
end;
// buraya düştü ise bulamadı texti dosyaya ekle..
SavetoFile(wideformat('[captions]<%s%s%s%s%d>%s',[sFormName,SEPARATOR_CHAR,sCompName,SEPARATOR_CHAR,Fontsize,wDefault]));
end;
ayrıca benzer birçok örnek atmıştım forumda aratırsanız bulursunuz.