home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 11
/
Freelog011.iso
/
BestOf
/
PhoenixMail
/
Source
/
phoenix
/
FMLanguage.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1999-02-05
|
3KB
|
98 lines
{*****************************************************************************
*
* FMLanguage.pas - Select language form (23-September-1998)
*
* Copyright (c) 1998-99 Michael Haller
*
* Author: Michael Haller
* E-mail: michael@discountdrive.com
* Homepage: http://www.discountdrive.com/sunrise
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
*----------------------------------------------------------------------------
*
* Revision history:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
*
*****************************************************************************}
unit FMLanguage;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls, PXStuff, Buttons;
type
TLanguageForm = class(TForm)
Panel1: TPanel;
RadioGroup1: TRadioGroup;
Panel2: TPanel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Filename: String;
end;
var
LanguageForm: TLanguageForm;
implementation
{$R *.DFM}
procedure TLanguageForm.FormCreate(Sender: TObject);
var
Found: Integer;
SearchRec: TSearchRec;
begin
if bOfficeFonts then Font.Name := sOfficeFontName;
Filename := '';
Found := FindFirst(sLanguageFolder+'*.lng', faAnyFile, SearchRec);
while Found = 0 do begin
RadioGroup1.Items.Add(Copy(SearchRec.Name, 1, Length(SearchRec.Name)-4));
Found := FindNext(SearchRec);
end;
FindClose(SearchRec);
Panel1.Height := RadioGroup1.Items.Count * 20 + 40;
ClientHeight := Panel1.Height + Panel2.Height;
if RadioGroup1.Items.Count = 1 then begin
bLanguageLoaded := False;
Filename := sLanguageFolder+RadioGroup1.Items[0]+'.lng';
ModalResult := mrOK;
end;
end;
procedure TLanguageForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
bLanguageLoaded := False;
Filename := sLanguageFolder+RadioGroup1.Items[RadioGroup1.ItemIndex]+'.lng';
end;
procedure TLanguageForm.FormActivate(Sender: TObject);
begin
RadioGroup1.SetFocus;
end;
end.