بِسْمِ اللهِ الرَّحْمنِ الرَّحِيمِ الْحَمْدُ للّهِ رَبِّ الْعَالَمِينَ الرَّحْمـنِ الرَّحِيمِ مَالِكِ يَوْمِ الدِّينِ إِيَّاكَ نَعْبُدُ وإِيَّاكَ نَسْتَعِينُ اهدِنَا الصِّرَاطَ المُستَقِيمَ صِرَاطَ الَّذِينَ أَنعَمتَ عَلَيهِمْ غَيرِ المَغضُوبِ عَلَيهِمْ وَلاَ الضَّالِّينَنَ
English French German Spain Italian Dutch Russian Portuguese Japanese Korean Arabic Chinese Simplified

this widget by www.AllBlogTools.com

Senin, 02 April 2012

TUGAS 2 : MEMBUAT APLIKASI OPERASI TEKS


Akhirnya selesai juga,tugas pertemuan ke 2 ini membuat sebuah Aplikasi Operasi Teks .Aplikasi Operasi Teks yaitu sebuah aplikasi dimana kita bisa membuat dan merubah font style dari setiap kata yang kita input ke dalam edit box,dan saat kita pilih tombol Uppercase akan tampil kata dalam memo yang tercetak huruf kapital semua.Jika tombol Lowercase yang dipilih maka akan tercetak pada memo huruf kecil semua.Jika font color di pilih Red,kata pada memo tercetak warna merah


 

Jika font color di pilih Green,kata pada memo tercetak warna hijau dan seterusnya sama akan sesuai dengan warna yang kita pilih.
TCombobox1=>Jika dipilih salah satu jenis warna,background memo berubah warna sesuai warna yang dipilih.
TCombobox2=>Jika dipilih salah satu font,kata yang tercetak pada memo akan tercetak sesuai jenis font yang dipilih.
TCombobox3=>Jika dipilih salah satu  size/ukuran font,kata yang tercetak pada memo akan tercetak sesuai dengan size font yang dipilih.

Untuk Font Style "Bold, Italic, Underline" menambahkan 1 Combobox yaitu " Combobox 4" dengan listing Program yang di Blok ungu

LISTING PROGRAM

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

var

  Form1: TForm1;

implementation


{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

begin
combobox1.Items:=screen.Fonts;
combobox1.Text:='-PILIH FONTS-';
combobox2.Text:='-PILIH SIZE-';
combobox3.Text:='-PILIH BACK COLOR-';
end;

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.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.ComboBox3Change(Sender: TObject);

begin
if combobox3.text='merah'then
 memo1.Color:=clred
 else if combobox3.text='biru'then
 memo1.Color:=clblue
 else memo1.Color:=clgreen;
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;

procedure TForm1.ComboBox4Change(Sender: TObject);

begin

if combobox4.Text='Bold' then

memo1.Font.Style:=memo1.Font.Style+[fsbold]

else if combobox4.Text='Italic' then

memo1.Font.Style:=memo1.Font.Style+[fsitalic]

else if combobox4.Text='Underline' then

memo1.Font.Style:=memo1.Font.Style+[fsunderline]

else memo1.Font.Style:=memo1.Font.Style+[fsstrikeout]

end;


end.

1 komentar:

Diantara Kita Slideshow: Purnama’s trip from Jakarta, Jawa, Indonesia to 4 cities , Denmark, Bandung and Depok (near Bogor) was created by TripAdvisor. See another Indonesia slideshow. Take your travel photos and make a slideshow for free.