unit BrainTrainerStartUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, ComCtrls, jpeg, ExtCtrls, Buttons, LMDControl,
LMDBaseControl, LMDBaseGraphicControl, LMDGraphicControl,
LMDCustomGraphicLabel, LMDGraphicLabel, LMDCustomComponent, LMDTaskDlg,
StdCtrls;
type
TStart =
class(TForm)
Image1: TImage;
StatusBar1: TStatusBar;
MainMenu1: TMainMenu;
Datei1: TMenuItem;
Bestenliste1: TMenuItem;
N1: TMenuItem;
Beenden1: TMenuItem;
Hilfe1: TMenuItem;
Hilfe2: TMenuItem;
N2: TMenuItem;
Info1: TMenuItem;
PopupMenu1: TPopupMenu;
NeuesSpiel1: TMenuItem;
N3: TMenuItem;
Bestenliste2: TMenuItem;
N4: TMenuItem;
Beenden2: TMenuItem;
Anfnger1: TMenuItem;
Mittel1: TMenuItem;
Profi1: TMenuItem;
Genie1: TMenuItem;
NeuesSpiel2: TMenuItem;
N5: TMenuItem;
Anfnger2: TMenuItem;
Mittel2: TMenuItem;
Profi2: TMenuItem;
Genie2: TMenuItem;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
Image2: TImage;
Hilfe3: TMenuItem;
Info2: TMenuItem;
N6: TMenuItem;
Bestenlisteanzeigen1: TMenuItem;
N7: TMenuItem;
Bestenlistespeichern1: TMenuItem;
Bearbeiten1: TMenuItem;
Service1: TMenuItem;
Kontakt1: TMenuItem;
N9: TMenuItem;
Homepage1: TMenuItem;
Extras1: TMenuItem;
N10: TMenuItem;
Registrieren1: TMenuItem;
Registrieren2: TMenuItem;
N11: TMenuItem;
Registrierungsschlsseleingeben1: TMenuItem;
N12: TMenuItem;
Fehlermelden1: TMenuItem;
Anfnger3: TMenuItem;
N13: TMenuItem;
Fortgeschritten1: TMenuItem;
N14: TMenuItem;
Profi3: TMenuItem;
N15: TMenuItem;
Genie3: TMenuItem;
Language1: TMenuItem;
DeutschDe1: TMenuItem;
N16: TMenuItem;
N17: TMenuItem;
Timer1: TTimer;
Image3: TImage;
Image4: TImage;
Label1: TLabel;
NeuerBenutzer1: TMenuItem;
procedure Beenden1Click(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Beenden2Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Info1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure Anfnger2Click(Sender: TObject);
procedure Mittel2Click(Sender: TObject);
procedure Profi2Click(Sender: TObject);
procedure Genie2Click(Sender: TObject);
procedure Info2Click(Sender: TObject);
procedure Hilfe3Click(Sender: TObject);
procedure Bestenlisteanzeigen1Click(Sender: TObject);
procedure Kontakt1Click(Sender: TObject);
procedure Hilfe2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Registrieren2Click(Sender: TObject);
procedure Registrierungsschlsseleingeben1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Fehlermelden1Click(Sender: TObject);
procedure DeutschDe1Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure NeuerBenutzer1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Start: TStart;
implementation
uses BestenlisteUnit, InfoUnit, AnfaengerUnit, MittelUnit, ProfiUnit,
GenieUnit, ShellApi, KontaktUnit, RegSchluesselEingabeUnit,
StartbildschirmUnit, registry, inifiles, NeuerUser;
{$R *.dfm}
procedure TStart.Beenden1Click(Sender: TObject);
begin
Bestenliste.Memo1.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Anfänger.scl');
Bestenliste.Memo2.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Fortgeschritten.scl');
Bestenliste.Memo3.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Profi.scl');
Bestenliste.Memo4.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Genie.scl');
Application.Terminate;
end;
procedure TStart.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Bestenliste.Memo1.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Anfänger.scl');
Bestenliste.Memo2.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Fortgeschritten.scl');
Bestenliste.Memo3.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Profi.scl');
Bestenliste.Memo4.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Genie.scl');
Application.Terminate;
end;
procedure TStart.Beenden2Click(Sender: TObject);
begin
Bestenliste.Memo1.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Anfänger.scl');
Bestenliste.Memo2.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Fortgeschritten.scl');
Bestenliste.Memo3.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Profi.scl');
Bestenliste.Memo4.Lines.SaveToFile('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Genie.scl');
Application.Terminate;
end;
procedure TStart.Timer1Timer(Sender: TObject);
begin
StatusBar1.Panels[0].Text := Datetostr(now);
StatusBar1.Panels[1].Text := Timetostr(now);
end;
procedure TStart.Info1Click(Sender: TObject);
begin
Info.show;
end;
procedure TStart.SpeedButton1Click(Sender: TObject);
begin
Anfaenger.show;
end;
procedure TStart.SpeedButton2Click(Sender: TObject);
begin
Mittel.show;
end;
procedure TStart.SpeedButton3Click(Sender: TObject);
begin
Profi.show;
end;
procedure TStart.SpeedButton4Click(Sender: TObject);
begin
Genie.show;
end;
procedure TStart.Anfnger2Click(Sender: TObject);
begin
Anfaenger.Show;
end;
procedure TStart.Mittel2Click(Sender: TObject);
begin
Mittel.show;
end;
procedure TStart.Profi2Click(Sender: TObject);
begin
Profi.Show;
end;
procedure TStart.Genie2Click(Sender: TObject);
begin
Genie.show;
end;
procedure TStart.Info2Click(Sender: TObject);
begin
Info.Show;
end;
procedure TStart.Hilfe3Click(Sender: TObject);
begin
if ShellExecute(Application.Handle,
'
open',
PChar('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Hilfe.hlp'),
Nil,
Nil, SW_NORMAL) <= 32
then
ShowMessage('
Es ist ein Fehler aufgetreten');
end;
procedure TStart.Bestenlisteanzeigen1Click(Sender: TObject);
begin
Bestenliste.show;
end;
procedure TStart.Kontakt1Click(Sender: TObject);
begin
Kontakt.show;
end;
procedure TStart.Hilfe2Click(Sender: TObject);
begin
if ShellExecute(Application.Handle,
'
open',
PChar('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Hilfe.hlp'),
Nil,
Nil, SW_NORMAL) <= 32
then
ShowMessage('
Es ist ein Fehler aufgetreten');
end;
procedure TStart.FormShow(Sender: TObject);
begin
Timer1.Enabled := true;
end;
procedure TStart.Registrieren2Click(Sender: TObject);
begin
if ShellExecute(Application.Handle,
'
open',
PChar('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Registrieren.exe'),
Nil,
Nil, SW_NORMAL) <= 32
then
ShowMessage('
Es ist ein Fehler aufgetreten');
end;
procedure TStart.Registrierungsschlsseleingeben1Click(Sender: TObject);
begin
RegistrierungsschluesselEingeben.show;
end;
procedure TStart.FormCreate(Sender: TObject);
var Ini:TInifile;
begin
if FileExists('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Anfänger.scl')
then
begin
{ Bestenliste.Memo1.Lines.LoadFromFile('C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Anfänger.scl');
bestenliste.Memo2.Lines.LoadFromFile('C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Fortgeschritten.scl');
bestenliste.Memo3.Lines.LoadFromFile('C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Profi.scl');
bestenliste.Memo4.Lines.LoadFromFile('C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Genie.scl');
}end;
if startbildschirm.label7.Caption = '
English'
then
begin
try
Ini:=TIniFile.Create('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\languagefile.ini');
Start.Datei1.Caption:=Ini.readstring('
English','
File','
Wert');
Start.Beenden1.Caption:=Ini.ReadString('
English','
close','
wert');
start.Beenden2.Caption:=Ini.ReadString('
English','
close','
wert');
start.bestenlisteanzeigen1.Caption:=Ini.ReadString('
English','
Score','
Wert');
start.Bestenliste1.Caption:=Ini.ReadString('
English','
Score','
wert');
start.Bestenliste2.Caption:=Ini.ReadString('
English','
Score','
wert');
start.Bearbeiten1.Caption:=Ini.ReadString('
English','
Edit','
wert');
start.NeuesSpiel2.Caption:=Ini.readstring('
English','
New','
wert');
start.NeuesSpiel1.Caption:=Ini.readstring('
English','
New','
wert');
start.Hilfe1.Caption:=Ini.ReadString('
English','
Help','
wert');
start.Hilfe2.Caption:=Ini.ReadString('
English','
Help','
wert');
start.Hilfe3.Caption:=Ini.ReadString('
English','
Help','
wert');
start.Info1.Caption:=Ini.ReadString('
English','
Info','
wert');
start.Anfnger1.Caption:=Ini.readstring('
English','
beginner','
wert');
start.Anfnger2.Caption:=Ini.readstring('
English','
beginner','
wert');
start.Anfnger3.Caption:=Ini.readstring('
English','
beginner','
wert');
start.Fortgeschritten1.Caption:=Ini.ReadString('
english','
advanced','
wert');
start.Genie1.Caption:=Ini.ReadString('
English','
genius','
wert');
start.Genie2.Caption:=Ini.ReadString('
English','
genius','
wert');
start.Genie3.Caption:=Ini.ReadString('
English','
genius','
wert');
start.Profi1.Caption:=Ini.ReadString('
english','
pro','
wert');
start.Profi2.Caption:=Ini.ReadString('
english','
pro','
wert');
start.Profi3.Caption:=Ini.ReadString('
english','
pro','
wert');
start.Service1.Caption:=Ini.ReadString('
English','
service','
wert');
start.Mittel1.Caption:=Ini.ReadString('
english','
advanced','
wert');
start.Mittel2.Caption:=Ini.readstring('
english','
advanced','
wert');
start.Extras1.Caption:=Ini.ReadString('
english','
extras','
wert');
start.Registrieren1.Caption:=Ini.ReadString('
english','
register','
wert');
start.Registrieren2.Caption:=Ini.ReadString('
english','
register','
wert');
finally
Ini.Free;
end;
if startbildschirm.lmdsimplelabel1.Visible = false
then
begin
speedbutton4.Enabled := true;
Speedbutton3.Enabled := true;
StatusBar1.Panels[4].Text := '
';
end;
end else
begin
try
Ini:=TIniFile.Create('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\languagefile.ini');
Start.Datei1.Caption:=Ini.readstring('
Deutsch','
File','
Wert');
Start.Beenden1.Caption:=Ini.ReadString('
Deutsch','
close','
wert');
start.Beenden2.Caption:=Ini.ReadString('
Deutsch','
close','
wert');
start.bestenlisteanzeigen1.Caption:=Ini.ReadString('
Deutsch','
Score','
Wert');
start.Bestenliste1.Caption:=Ini.ReadString('
Deutsch','
Score','
wert');
start.Bestenliste2.Caption:=Ini.ReadString('
Deutsch','
Score','
wert');
start.Bearbeiten1.Caption:=Ini.ReadString('
Deutsch','
Edit','
wert');
start.NeuesSpiel2.Caption:=Ini.readstring('
Deutsch','
New','
wert');
start.NeuesSpiel1.Caption:=Ini.readstring('
Deutsch','
New','
wert');
start.Hilfe1.Caption:=Ini.ReadString('
Deutsch','
Help','
wert');
start.Hilfe2.Caption:=Ini.ReadString('
Deutsch','
Help','
wert');
start.Hilfe3.Caption:=Ini.ReadString('
Deutsch','
Help','
wert');
start.Info1.Caption:=Ini.ReadString('
Deutsch','
Info','
wert');
start.Anfnger1.Caption:=Ini.readstring('
Deutsch','
beginner','
wert');
start.Anfnger2.Caption:=Ini.readstring('
Deutsch','
beginner','
wert');
start.Anfnger3.Caption:=Ini.readstring('
Deutsch','
beginner','
wert');
start.Fortgeschritten1.Caption:=Ini.ReadString('
Deutsch','
advanced','
wert');
start.Genie1.Caption:=Ini.ReadString('
Deutsch','
genius','
wert');
start.Genie2.Caption:=Ini.ReadString('
Deutsch','
genius','
wert');
start.Genie3.Caption:=Ini.ReadString('
Deutsch','
genius','
wert');
start.Profi1.Caption:=Ini.ReadString('
Deutsch','
pro','
wert');
start.Profi2.Caption:=Ini.ReadString('
Deutsch','
pro','
wert');
start.Profi3.Caption:=Ini.ReadString('
Deutsch','
pro','
wert');
start.Service1.Caption:=Ini.ReadString('
Deutsch','
service','
wert');
start.Mittel1.Caption:=Ini.ReadString('
Deutsch','
advanced','
wert');
start.Mittel2.Caption:=Ini.readstring('
Deutsch','
advanced','
wert');
start.Extras1.Caption:=Ini.ReadString('
Deutsch','
extras','
wert');
start.Registrieren1.Caption:=Ini.ReadString('
Deutsch','
register','
wert');
start.Registrieren2.Caption:=Ini.ReadString('
Deutsch','
register','
wert');
finally
Ini.Free;
end;
if startbildschirm.lmdsimplelabel1.Visible = false
then
begin
speedbutton4.Enabled := true;
Speedbutton3.Enabled := true;
StatusBar1.Panels[4].Text := '
';
end;
end;
end;
procedure TStart.Button1Click(Sender: TObject);
begin
Startbildschirm.show;
end;
procedure TStart.Fehlermelden1Click(Sender: TObject);
begin
if ShellExecute(Application.Handle,
'
open',
PChar('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\Fehlermelde-Assistent.exe'),
Nil,
Nil, SW_NORMAL) <= 32
then
ShowMessage('
Es ist ein Fehler aufgetreten');
end;
procedure TStart.DeutschDe1Click(Sender: TObject);
var regist: TRegistry;
Ini: TIniFile;
begin
label1.Caption:='
Deutsch';
DeutschDe1.enabled := false;
Image2.Visible := true;
Image3.Visible := false;
Image4.Visible := false;
ShowMessage('
Bitte starten Sie BrainTrainer neu, um die Einstellungen zu übernehmen!');
try
Ini:=TIniFile.Create('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\language.ini');
Ini.WriteString('
favoritelanguage','
language',Label1.Caption);
finally
Ini.Free;
end;
{regist:=TRegistry.Create;
try
regist.RootKey:=HKEY_LOCAL_MACHINE; //voreingestellt ist HKEY_CURRENT_USER
regist.OpenKey('SOFTWARE\E.T.-IT Software Corporation\BrainTrainer\2.0',true);
//bei true wird Schlüssel erzeugt, wenn er noch nicht existiert
regist.writestring('Language', 'German');
finally
Free;
end;}
end;
procedure TStart.N16Click(Sender: TObject);
var regist: TRegistry;
Ini: TIniFile;
begin
Label1.Caption:='
English';
Image3.Visible := true;
Image4.Visible := true;
Image2.Visible := false;
ShowMessage('
Please restart BrainTrainer for changing the language!');
try
Ini:=TIniFile.Create('
C:\Program Files\E.T.-IT Software Corporation\BrainTrainer 2.0\language.ini');
Ini.WriteString('
favoritelanguage','
language',Label1.Caption);
finally
Ini.Free;
end;
{ regist:=TRegistry.Create;
try
regist.RootKey:=HKEY_LOCAL_MACHINE; //voreingestellt ist HKEY_CURRENT_USER
regist.OpenKey('SOFTWARE\E.T.-IT Software Corporation\BrainTrainer\2.0',true);
//bei true wird Schlüssel erzeugt, wenn er noch nicht existiert
regist.writestring('Language', 'English');
finally
Free;
end; }
end;
procedure TStart.NeuerBenutzer1Click(Sender: TObject);
begin
NeuerBenutzer.show;
end;
end.