Kamis, 19 April 2012

Form Game Saat Aktif









Form game saat timer waktu habis.










Form game saat button Stop di Klik









= = = = = = = = = = = = = = = == = = = == = = = = = = = = = = = = = === = = == == = =
codingnya   :
implementation

{$R *.dfm}
procedure tform1.aktif;
begin
image1.enabled:=true;
image2.enabled:=true;
image3.enabled:=true;
image4.enabled:=true;
image5.enabled:=true;
edit1.Enabled:=true;
button2.Enabled:=true;
image1.Visible:=true;
image2.Visible:=true;
image3.Visible:=true;
image4.Visible:=true;
image5.Visible:=true;
end;

procedure tform1.nonaktif;
begin
image1.enabled:=false;
image2.enabled:=false;
image3.enabled:=false;
image4.enabled:=false;
image5.enabled:=false;
edit1.enabled:=false;
button2.enabled:=false;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
nonaktif;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
aktif;
button1.Enabled:=true;
panel_timer.Caption:='10';
timer1.Enabled:=true;


end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if(application.MessageBox
('Sumpah Lu Mau keluar dari Game??','Konfirmasi',MB_YesNo)=ID_Yes) then
close;
end;

procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image1.Left:=random(left);
image1.top:=random(top);
end;

procedure TForm1.Image2MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image2.Left:=random(left);
image2.top:=random(top);
end;

procedure TForm1.Image3MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image3.Left:=random(left);
image3.top:=random(top);
end;

procedure TForm1.Image4MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image4.Left:=random(left);
image4.top:=random(top);
end;

procedure TForm1.Image5MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
image5.Left:=random(left);
image5.top:=random(top);
end;

procedure TForm1.Image1Click(Sender: TObject);
begin
image1.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Image2Click(Sender: TObject);
begin
image2.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Image3Click(Sender: TObject);
begin
image3.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Image4Click(Sender: TObject);
begin
image4.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Image5Click(Sender: TObject);
begin
image5.Visible:=false;
edit1.Text:=inttostr(strtoint(edit1.Text)+20);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
waktu:integer;
begin

if panel_timer.Caption='0' then
begin
timer1.Enabled:=false;
showmessage('WAKTUNYA ABIS!');
button1.Enabled:=false;
showmessage('SORY BOS LU KALAH!!!!!');
close;

end
else
begin
waktu:=strtoint(panel_timer.Caption);
waktu:=waktu-1;
panel_timer.Caption:=inttostr(waktu);

end;
end;
end.



Senin, 26 Maret 2012

tugas Aplikasi operasi teks



 private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
memo1.Text:=uppercase(edit1.Text);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
memo1.Text:=lowercase(edit1.Text);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
combobox3.Items:=screen.Fonts;
combobox3.Text:='-PILIH FONTS-';

end;

procedure TForm1.ComboBox3Change(Sender: TObject);
begin
memo1.Font.Name:=combobox3.Text;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
if combobox1.text='merah'then memo1.color:=clred
else
if combobox1.text='biru'then memo1.color:=clblue
else
memo1.color:=clgreen;

end;

procedure TForm1.ComboBox2Change(Sender: TObject);
begin
if combobox2.text='8'then memo1.font.size:=8
else
if combobox2.text='10'then memo1.font.size:=10
else
if combobox2.text='12'then memo1.font.size:=12
else
if combobox2.text='14'then memo1.font.size:=14
else
if combobox2.text='16'then memo1.font.size:=16
else
memo1.font.size:=18;

end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
memo1.Font.Style:=memo1.Font.Style+[fsbold];
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
memo1.Font.Style:=memo1.Font.Style+[fsitalic];
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
begin
memo1.Font.Style:=memo1.Font.Style+[fsunderline];
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
memo1.Text:='';
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
close;
end;

procedure TForm1.RadioButton1Click(Sender: TObject);
begin
memo1.Font.Color:=clred;
end;

procedure TForm1.RadioButton2Click(Sender: TObject);
begin
memo1.Font.Color:=clgreen;
end;

procedure TForm1.RadioButton3Click(Sender: TObject);
begin
memo1.Font.Color:=clyellow;
end;

procedure TForm1.RadioButton4Click(Sender: TObject);
begin
memo1.Font.Color:=clpurple;
end;

procedure TForm1.RadioButton5Click(Sender: TObject);
begin
memo1.Font.Color:=clblack;
end;

procedure TForm1.RadioButton6Click(Sender: TObject);
begin
memo1.Font.Color:=clblue;
end;

end.

Rabu, 21 Maret 2012

Tugas Borland Delphi 7

NAMA : OKI ANDAMITRA
KELAS : 13.6B.01
NIM  :  13090247

Coding Tugas
-------------------------------------------------------------------------------------------------------------
unit Latihan3;

interface

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, StdCtrls, jpeg, ExtCtrls, Menus;

type

  TForm1 = class(TForm)

    GroupBox1: TGroupBox;

    GroupBox2: TGroupBox;

    RadioButton1: TRadioButton;

    RadioButton2: TRadioButton;

    RadioButton3: TRadioButton;

    RadioButton4: TRadioButton;

    RadioButton5: TRadioButton;

    CheckBox1: TCheckBox;

    CheckBox2: TCheckBox;

    CheckBox3: TCheckBox;

    CheckBox4: TCheckBox;

    ComboBox1: TComboBox;

    ComboBox2: TComboBox;

    CheckBox6: TCheckBox;

    CheckBox7: TCheckBox;

    CheckBox8: TCheckBox;

    CheckBox9: TCheckBox;

    CheckBox10: TCheckBox;

    Image1: TImage;

    Label1: TLabel;

    Button1: TButton;

    Memo1: TMemo;

    MainMenu1: TMainMenu;

    File1: TMenuItem;

    Exit1: TMenuItem;

    Help1: TMenuItem;

    AboutMe1: TMenuItem;

    procedure FormCreate(Sender: TObject);

    procedure ComboBox1Change(Sender: TObject);

    procedure ComboBox2Change(Sender: TObject);

    procedure RadioButton1Click(Sender: TObject);

    procedure RadioButton2Click(Sender: TObject);

    procedure RadioButton3Click(Sender: TObject);

    procedure RadioButton4Click(Sender: TObject);

    procedure RadioButton5Click(Sender: TObject);

    procedure CheckBox1Click(Sender: TObject);

    procedure CheckBox2Click(Sender: TObject);

    procedure CheckBox3Click(Sender: TObject);

    procedure CheckBox4Click(Sender: TObject);

    procedure CheckBox6Click(Sender: TObject);

    procedure CheckBox7Click(Sender: TObject);

    procedure CheckBox8Click(Sender: TObject);

    procedure CheckBox9Click(Sender: TObject);

    procedure CheckBox10Click(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure FormActivate(Sender: TObject);

    procedure Exit1Click(Sender: TObject);

    procedure AboutMe1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  Form1: TForm1;

implementation

uses Latihan3Form2;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

begin

ComboBox1.Items:=Screen.Fonts;

ComboBox1.Text:='PILIH FONTS';

ComboBox2.Text:='PILIH UKURAN';

Memo1.Text:='';

end;

procedure TForm1.ComboBox1Change(Sender: TObject);

begin

Memo1.Font.Name:=ComboBox1.Text;

end;

procedure TForm1.ComboBox2Change(Sender: TObject);

begin

memo1.Font.Size:=strtoint(ComboBox2.Text);

end;

procedure TForm1.RadioButton1Click(Sender: TObject);

begin

Memo1.Color:=ClRed;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton2Click(Sender: TObject);

begin

Memo1.Color:=ClBlue;

RadioButton1.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton3Click(Sender: TObject);

begin

Memo1.Color:=ClYellow;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton4.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton4Click(Sender: TObject);

begin

Memo1.Color:=ClGreen;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton5.Enabled :=False;

end;

procedure TForm1.RadioButton5Click(Sender: TObject);

begin

Memo1.Color:=ClGray;

RadioButton1.Enabled :=False;

RadioButton2.Enabled :=False;

RadioButton3.Enabled :=False;

RadioButton4.Enabled :=False;

end;

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

If CheckBox1.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsBold];

   CheckBox1.Caption:='Un Bold';

   End

 Else

 Begin

  CheckBox1.Caption:='Bold';

  Memo1.Font.Style := Memo1.Font.Style-[FsBold];

 End

end;

procedure TForm1.CheckBox2Click(Sender: TObject);

begin

If CheckBox2.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsItalic];

   CheckBox2.Caption:='Un Italic';

   End

 Else

 Begin

  CheckBox2.Caption:='Italic';

  Memo1.Font.Style := Memo1.Font.Style-[FsItalic];

 End

end;

procedure TForm1.CheckBox3Click(Sender: TObject);

begin

If CheckBox3.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsUnderline];

   CheckBox3.Caption:='Non Line';

   End

 Else

 Begin

  CheckBox3.Caption:='Underline';

  Memo1.Font.Style := Memo1.Font.Style-[FsUnderline];

 End

end;

procedure TForm1.CheckBox4Click(Sender: TObject);

begin

If CheckBox4.Checked=True then

   Begin

   Memo1.Font.Style :=Memo1.Font.Style+[FsStrikeOut];

   CheckBox4.Caption:='Un StrikeOut';

   End

 Else

 Begin

  CheckBox4.Caption:='StrikeOut';

  Memo1.Font.Style := Memo1.Font.Style-[FsStrikeOut];

 End

end;

procedure TForm1.CheckBox6Click(Sender: TObject);

begin

If CheckBox6.Checked=True then

   Begin

   Memo1.Font.Color:=ClRed;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox7Click(Sender: TObject);

begin

If CheckBox7.Checked=True then

   Begin

   Memo1.Font.Color:=ClBlue;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox8Click(Sender: TObject);

begin

If CheckBox8.Checked=True then

   Begin

   Memo1.Font.Color:=ClYellow;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox9Click(Sender: TObject);

begin

If CheckBox9.Checked=True then

   Begin

   Memo1.Font.Color:=ClGreen;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.CheckBox10Click(Sender: TObject);

begin

If CheckBox10.Checked=True then

   Begin

   Memo1.Font.Color:=ClGray;

   End

 Else

 Begin

  Memo1.Font.Color:= ClBlack;

 End

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

Memo1.Color:=ClWindow;

RadioButton1.Enabled :=True;

RadioButton2.Enabled :=True;

RadioButton3.Enabled :=True;

RadioButton4.Enabled :=True;

RadioButton5.Enabled :=True;

end;

procedure TForm1.FormActivate(Sender: TObject);

begin

Form1.Action;

Memo1.SetFocus;

end;

procedure TForm1.Exit1Click(Sender: TObject);

begin

Application.Terminate;

end;

procedure TForm1.AboutMe1Click(Sender: TObject);

begin

Form2.Show;

end;

end.