Sunday, July 31, 2011

Jam

unit Unit1;

interface

uses
Windows, SysUtils, Graphics, Forms, ExtCtrls, Classes;

type
TForm1 = class(TForm)
Timer1: TTimer;
procedure FormPaint(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ By : Zephio
Bikin Jam Unik tp jelek }
public
{ http://amateur-guide.blogspot.com }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}



procedure TForm1.FormPaint(Sender: TObject);
begin
with Form1 do
//------------------------------------------------------------------------------>
// Lingkar Jam
Canvas.Brush.Color := CLTeal;
Canvas.Pen.Color := ClBlue;
Canvas.Ellipse(0, 25, ClientWidth, ClientHeight Div 2);
Canvas.Brush.Color := clFuchsia;
Canvas.Ellipse(0, 25, ClientWidth - 10, ClientHeight Div 2 - 10);
//------------------------------------------------------------------------------>
// Per Detik
Canvas.Pen.Color := clBlue;
Canvas.MoveTo(StrToInt(FormatDateTime('ss', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('ss', Now)),ClientHeight Div 2 - 15);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clBlue;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('ss', Now)), ClientHeight Div 2 - 15, FormatDateTime('ss', Now));
//------------------------------------------------------------------------------>
// Per Menit
Canvas.Pen.Color := clRed;
Canvas.MoveTo(StrToInt(FormatDateTime('nn', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('nn', Now)),ClientHeight Div 2 - 30);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clRed;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('nn', Now)), ClientHeight Div 2 - 30, FormatDateTime('nn', Now));
//------------------------------------------------------------------------------>
//Per Jam
Canvas.Pen.Color := clBlack;
Canvas.MoveTo(StrToInt(FormatDateTime('hh', Now)),25);
Canvas.LineTo(StrToInt(FormatDateTime('hh', Now)), ClientHeight Div 2 - 45);
//------------------------------------------------------------------------------>
Canvas.Font.Color := clBlack;
Canvas.Font.Style := [fsBold];
SetBkMode(Canvas.Handle,TRANSPARENT);
Canvas.TextOut(StrToInt(FormatDateTime('hh', Now)), ClientHeight Div 2 - 45, FormatDateTime('hh', Now));
//------------------------------------------------------------------------------>
// Pesan
Canvas.Brush.Style := BSClear;
Canvas.Font.Color := CLRed;
Canvas.Font.Size := 12;
Canvas.TextOut(ClientWidth Div 3 + 15, 0, 'Clock');
Canvas.Font.Color := CLBlue;
Canvas.Font.Size := 12;
Canvas.TextOut(ClientWidth Div 5, 140, 'Created By : Zephio');
//------------------------------------------------------------------------------>
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Invalidate;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.Title := 'ZS Clock';
Form1.Height := 280;
Form1.Width := 256;
DoubleBuffered := true;
end;

end.

Transparent Form

unit Unit1;

interface

uses
Windows, Graphics, Forms;

type
TForm1 = class(TForm)
procedure FormPaint(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ By : Zephio
Membuat Form Tembus Pandang dgn Canvas}
public
{ http://amateur-guide.blogspot.com }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormPaint(Sender: TObject);
begin
with Form1.Canvas do
begin
Brush.Style := BSClear;
Brush.Color := clFuchsia;
Pen.Color := ClYellow;
Rectangle(0 , 0, Form1.ClientWidth, Form1.ClientHeight);
Rectangle(10, 10, Form1.ClientWidth - 10, Form1.ClientHeight - 10);
Rectangle(20, 20, Form1.ClientWidth - 20, Form1.ClientHeight - 20);
Rectangle(30, 30, Form1.ClientWidth - 30, Form1.ClientHeight - 30);
Rectangle(40, 40, Form1.ClientWidth - 40, Form1.ClientHeight - 40);
Rectangle(50, 50, Form1.ClientWidth - 50, Form1.ClientHeight - 50);
Rectangle(60, 60, Form1.ClientWidth - 60, Form1.ClientHeight - 60);
Rectangle(70, 70, Form1.ClientWidth - 70, Form1.ClientHeight - 70);
Rectangle(80, 80, Form1.ClientWidth - 80, Form1.ClientHeight - 80);
Rectangle(90, 90, Form1.ClientWidth - 90, Form1.ClientHeight - 90);
Rectangle(100, 100, Form1.ClientWidth - 100, Form1.ClientHeight - 100);
end;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.Title := 'ZS Form';
end;

end.

Animasi Form

unit Unit1;

interface

uses
SysUtils, Forms, ExtCtrls, Classes;

type
TForm1 = class(TForm)
T1: TTimer;
procedure FormCreate(Sender: TObject);
procedure T1Timer(Sender: TObject);
private
{ Created By : Zephio }
public
{ Title : Anime Form }
{ http://amateur-guide.blogspot.com }
end;

var
Form1: TForm1;

implementation


{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
Tag := 40; // Set Form1.Tag = 40, pembatasan Minimal 40, jk dr 0 kelamaan!...
end;

procedure TForm1.T1Timer(Sender: TObject);
begin
Tag := Tag + 1; //kalk 40..300
Width := Tag * 2; //Lebar 300 x 2 = 600
Height := Tag; //Tinggi 300
Caption := 'Time : '+IntToStr(Tag)+' Width : '+IntToStr(Width)+' Height : '+IntToStr(Height);
if Tag = 300 then // jk value Tag(40..300) = 300 (Penentuan value Maximal) maka Timer1 = Disable/Tidak Aktif
begin
T1.Enabled := false;
Caption := 'Anime Form, By : Zephio, Form Status : Ready';
end;

end;

end.

Check Nilai 2

unit Unit1;

interface

uses
Windows, SysUtils, Graphics, Forms, StdCtrls, ExtCtrls, Controls, Classes;

type
TForm1 = class(TForm)
// Componnent yg diperlukan----------------------------------------------------->
E1: TEdit;
S1: TShape;
procedure E1Change(Sender: TObject);
private
{ By : Zephio
Check Nilai antara 1..100 }
public
{ http://amateur-guide.blogspot.com }
end;

var
Form1: TForm1;

implementation



{$R *.dfm}

procedure TForm1.E1Change(Sender: TObject);
var
I : Integer;
begin
E1.MaxLength := 3; //Batas Maximal Input adalah 3 Digit / [0..999]
I := StrToInt(E1.Text); //I = Input Nilai
case I of
// Dengan Text
1..20 : Caption := 'E = Sangat Payah'; // Jika Input Antara 1 hingga 20 maka tampilkan Pesan E
21..40 : Caption := 'D = Payah'; // Jika Input Antara 21 hingga 40 maka tampilkan Pesan D
41..60 : Caption := 'C = Lumayan'; // Jika Input Antara 41 hingga 60 maka tampilkan Pesan C
61..80 : Caption := 'B = Bagus'; // Jika Input Antara 61 hingga 80 maka tampilkan Pesan B
81..100 : Caption := 'A = Sempurna'; // Jika Input Antara 81 hingga 100 maka tampilkan Pesan A
0, 101..999 : Caption := '? = Diluar Nilai'; // Jika Input adalah 0 Antara 101 hingga 999 maka Pengecualian
else
Caption := '';
end;
case I of
// Dengan Color
1..20 : S1.Brush.Color := ClRed;
21..40 : S1.Brush.Color := clFuchsia;
41..60 : S1.Brush.Color := ClYellow;
61..80 : S1.Brush.Color := ClBlue;
81..100 : S1.Brush.Color := ClGreen;
0, 101..MaxInt : S1.Brush.Color := ClBlack;
else
S1.Brush.Color := ClWhite;
end;
end;

end.