rendered paste bodyunit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus, Mask, inifiles;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
GroupBox2: TGroupBox;
Memo1: TMemo;
ListBox1: TListBox;
GroupBox3: TGroupBox;
Button1: TButton;
Button2: TButton;
Button4: TButton;
Label1: TLabel;
Edit2: TEdit;
Memo2: TMemo;
Button5: TButton;
Button3: TButton;
Memo3: TMemo;
procedure Button5Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i : integer;
implementation
uses Unit2, Unit3, Unit4;
{$R *.dfm}
procedure lyginimas;
begin
form1.edit2.Text := form1.memo2.Text;
end;
procedure didinimas;
begin
inc(i);
form1.memo2.Text := inttostr(i);
form1.edit2.Text := form1.memo2.Text;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
form1.Memo3.Lines.Add('...PROGRAM CLOSED...');
form1.Memo2.Lines.SaveToFile(ExtractFilePath(Application.Exename)+'numeris.andriuxa');
form1.Memo3.Lines.SaveToFile(ExtractFilePath(Application.Exename)+'lastUsedlog.txt');
close;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
didinimas;
form1.Memo3.Lines.Add('...INSERT WORD...');
form2.show;
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
didinimas;
form1.Memo3.Lines.Add('...READING ABOUT...');
form4.show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if listbox1.ItemIndex = -1 then begin
MessageDlg('Choose the word!',mtInformation,[mbOk],0); exit; end;
didinimas;
DeleteFile('duomenubaze\' + listbox1.Items[listbox1.itemindex] +'.profuks');
form1.listbox1.Items.Delete(listbox1.ItemIndex);
form1.listbox1.Items.SaveToFile(ExtractFilePath(Application.Exename)+'zodziai.profas');
listbox1.ItemIndex := 0;
if listbox1.ItemIndex = -1 then memo1.Text := 'There is no words in the list...';
form1.Memo3.Lines.Add('...WORD DELETED...');
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
memo1.Text := 'Choose word...(or there is no words in the list)...';
if FileExists(ExtractFilePath(Application.Exename)+'zodziai.profas')
then listbox1.Items.LoadFromFile(ExtractFilePath(Application.Exename)+'zodziai.profas');
end;
procedure TForm1.ListBox1Click(Sender: TObject);
begin
form1.memo1.Lines.LoadFromFile('duomenubaze\'+listbox1.items[listbox1.itemindex]+'.profuks');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Form1.Memo2.Lines.LoadFromFile(ExtractFilePath(Application.ExeName)+'numeris.andriuxa');
Form1.Edit2.Text := Form1.Memo2.Text;
i := strtoint(form1.Edit2.text);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
Ini: TMemIniFile;
begin
didinimas;
form1.Memo3.Lines.Add('...READING OPTIONS...');
form3.show;
Ini := TMemIniFile.Create('nustatymai.ini');
form3.ComboBox1.Text := Ini.ReadString( 'nustatymai', 'kalba','');
form3.ComboBox2.Text := Ini.ReadString( 'nustatymai', 'skinas','');
form3.ComboBox3.Text := Ini.ReadString( 'nustatymai', 'rusiuotipagal','');
ini.Destroy;
end;
end.
-----------
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
Label1: TLabel;
Memo1: TMemo;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit1;
{$R *.dfm}
procedure lyginimas;
begin
form1.edit2.Text := form1.memo2.Text;
end;
procedure didinimas;
begin
inc(i);
form1.Edit2.Text := inttostr(i);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
if FileExists(ExtractFilePath(Application.Exename)+'duomenubaze/'+ form2.Edit1.Text +'.profuks') then begin
MessageDlg('You have this word in the list already! ',mtInformation,[mbOk],0); exit; end;
if edit1.Text = '' then begin
MessageDlg('Enter the word!',mtInformation,[mbOk],0);
exit; end;
if memo1.Text = '' then begin
MessageDlg('Enter the description!',mtInformation,[mbok],0); exit; end;
didinimas;
form1.ListBox1.items.Add(Edit1.Text);
form1.listbox1.Items.SaveToFile(ExtractFilePath(Application.Exename)+'zodziai.profas');
form2.Memo1.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'/duomenubaze/'+form2.Edit1.Text +'.profuks');
form1.Memo3.Lines.Add('...WORD INSERTED...');
form1.Memo1.Text := 'Choose the word...';
form2.Hide;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
didinimas;
form1.Memo3.Lines.Add('...INSERT WORD IS CLOSED...');
form2.Hide;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
edit1.Text := '';
memo1.Text := '';
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
form2.Memo1.Text := '';
form2.Edit1.Text := '';
end;
end.
--------
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, inifiles;
type
TForm3 = class(TForm)
GroupBox1: TGroupBox;
Button1: TButton;
Button2: TButton;
ComboBox1: TComboBox;
Label1: TLabel;
Label2: TLabel;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
Label3: TLabel;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
SaveDialog1: TSaveDialog;
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
Ini: TMemIniFile;
implementation
uses Unit1;
{$R *.dfm}
procedure configas;
begin
Ini := TMemIniFile.Create( ExtractFilePath(Application.Exename)+'nustatymai.ini' ) ;
Ini.WriteString( 'Nustatymai', 'kalba', form3.ComboBox1.Text);
Ini.WriteString( 'Nustatymai', 'skinas', form3.ComboBox2.Text);
Ini.WriteString( 'Nustatymai', 'rusiuotipagal', form3.ComboBox3.Text);
Ini.UpdateFile;
Ini.Destroy;
end;
procedure defoultconfigas;
begin
form3.ComboBox1.Text := 'English';
form3.ComboBox2.Text := 'Standart';
form3.ComboBox3.Text := 'Last Created';
Ini := TMemIniFile.Create( ExtractFilePath(Application.Exename)+'nustatymai.ini' ) ;
Ini.WriteString( 'Nustatymai', 'kalba', 'English');
Ini.WriteString( 'Nustatymai', 'skinas', 'Standart');
Ini.WriteString( 'Nustatymai', 'rusiuotipagal', 'Last Created');
Ini.UpdateFile;
Ini.Destroy;
end;
procedure didinimas;
begin
inc(i);
form1.Edit2.Text := inttostr(i);
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
didinimas;
form1.Memo3.Lines.Add('...OPTIONS IS CLOSED...');
form3.Hide;
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
form1.memo2.Text := '0';
form1.Edit2.text := '0';
i := 0;
form1.Memo2.Lines.SaveToFile(ExtractFilePath(Application.ExeName)+'numeris.andriuxa');
MessageDlg('Status reseted to 0',mtInformation,[mbOk],0);
form1.Memo3.Lines.Add('...STATUS IS NOW 0...');
end;
procedure TForm3.Button4Click(Sender: TObject);
begin
form1.Memo3.Lines.Add('...SAVING LOG...');
if SaveDIalog1.Execute then
begin
form1.Memo3.Lines.SaveToFile(SaveDialog1.FileName);
form1.Memo3.Lines.Add('...LOG SAVED...');
didinimas;
exit;
end;
form1.Memo3.Lines.Add('...SAVE LOG CANCELED...');
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
didinimas;
form1.Memo3.Lines.Add('...CHANGES SAVED...');
configas;
form3.Hide;
end;
procedure TForm3.Button6Click(Sender: TObject);
begin
defoultconfigas;
form1.Memo3.Lines.Add('...OPTIONS SETED TO DEFOULT...');
didinimas;
messagedlg('Options seted to defoult', mtInformation, [mbok], 0);
end;
procedure TForm3.Button5Click(Sender: TObject);
var a : integer;
begin
form1.Memo3.Lines.Add('...DELITING ALL WORDS...');
if MessageDlg('Are you sure?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
for a:=0 to form1.ListBox1.Items.Count-1 do
DeleteFile('duomenubaze\'+form1.ListBox1.Items[a]+'.profuks');
form1.ListBox1.Items.Text := '';
form1.ListBox1.Items.SaveToFile(ExtractFilePath(Application.ExeName)+'zodziai.profas');
form1.Memo3.Lines.Add('...ALL WORLDS ARE DELETED FORM LIST...');
messagedlg('Deleted!', mtinformation, [mbok], 0);
didinimas;
end else
form1.Memo3.Lines.Add('...DELITING ALL WORDS IS CANCELED...');
exit;
end;
end.
-----------------
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm4 = class(TForm)
GroupBox1: TGroupBox;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Button5: TButton;
Label7: TLabel;
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses Unit1;
{$R *.dfm}
procedure didinimas;
begin
inc(i);
form1.Edit2.Text := inttostr(i);
end;
procedure TForm4.Button5Click(Sender: TObject);
begin
form4.Hide;
didinimas;
form1.Memo3.Lines.Add('...ABOUT IS CLOSED...');
end;
end.