0% found this document useful (0 votes)
42 views5 pages

LAPORAN Pemograman Visual

1. The document describes the steps to create a slideshow program in C++ Builder 6. It involves determining the needed components like buttons, images and a timer. 2. The program uses four buttons for start, stop, previous, and next. It loads three images and uses a timer to automatically swap between the images. 3. The code defines event handlers for each button that swap the images to move to the next slide when the start button is clicked or the timer triggers, go to the previous slide when previous is clicked, and stop the timer when stop is clicked.

Uploaded by

Elvia Somente
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views5 pages

LAPORAN Pemograman Visual

1. The document describes the steps to create a slideshow program in C++ Builder 6. It involves determining the needed components like buttons, images and a timer. 2. The program uses four buttons for start, stop, previous, and next. It loads three images and uses a timer to automatically swap between the images. 3. The code defines event handlers for each button that swap the images to move to the next slide when the start button is clicked or the timer triggers, go to the previous slide when previous is clicked, and stop the timer when stop is clicked.

Uploaded by

Elvia Somente
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

Tugas Mata Kuliah Pemograman Visual

Program Slideshow

DISUSUN OLEH :
Elvia 09091003040

JURUSAN SISTEM INFORMASI


FAKULTAS ILMU KOMPUTER
TAHUN AJARAN 2011

Langkah-langkah dalam pembuatan program ini :

1. Penentuan komponen yang dibutuhkan :


No Komponen Properti Nilai
1. Form1 Borderstyle bsSizeable
Caption Program SlideShow
Font (TFont)
Height 421
Width 833
Position poDesigned
2. Button1 Caption Start
3. Button2 Caption Stop
4. Button3 Caption PREVIEW
5. Button4 Caption NEXT
6. Image1 Name Image1
Picture (None)
Strech true
7. Image2 Name Image2
Picture (TJPEGImage)
Strech true
8. Image3 Name Image3
Picture (TJPEGImage)
Strech true
9. Image4 Name Image4
Picture (TJPEGImage)
Strech true
10. Timer1 Name Timer1
Enabled true

Keteranga lebih lanjut :

1. Empat Button
komponen button ini berfungsi sebagai tombol proses. Adapun tombol button yang terdapat
pada slide show di atas :

a. Button1 dengan caption=”Start” tombol untuk memulai penampilan slideshow


b. Button2 dengan caption=”Stop”  tombol untuk mengakhiri slideshow
c. Button3 dengan caption=”preveiw”  tombol untuk kembali ke slide sebelumnya
d. Button4 dengan caption=”next”  tombol untuk lanjut ke slide selanjutnya.

2. Tiga Image
Komponen image, fungsi dasarnya untuk memasukkan gambar. Yang bisa di load gambarnya pada
properties picture.

3. Satu Timer
Komponen timer, fungsinya untuk proses perulangan menggunakan satuan interval 1 milidetik.

4. Tiga Edit
Komponen ini fungsinya menampilkan input/output yang berupa teks.

Bentuk tampilan rancangan interface di C++ Builder 6


2. Koding program Slideshow
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "e.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)


{
Timer1->Enabled=true;
Image1->Picture=Image2->Picture;
Image2->Picture=Image3->Picture;
Image3->Picture=Image4->Picture;
Image4->Picture=Image1->Picture;
Timer1->OnTimer=Button1Click;
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)


{
Timer1->Enabled=false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Image4->Picture=Image3->Picture;
Image3->Picture=Image2->Picture;
Image2->Picture=Image1->Picture;
Image1->Picture=Image4->Picture;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button4Click(TObject *Sender)
{
Image1->Picture=Image2->Picture;
Image2->Picture=Image3->Picture;
Image3->Picture=Image4->Picture;
Image4->Picture=Image1->Picture;
}
//---------------------------------------------------------------------------

Keterangan program ;

1. Untuk Button1=”Start”
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Timer1->Enabled=true;
Image1->Picture=Image2->Picture;
Image2->Picture=Image3->Picture;
Image3->Picture=Image4->Picture;
Image4->Picture=Image1->Picture;
Timer1->OnTimer=Button1Click;
}
● Timer1-> Enabled=true;
Untuk memulai proses perulangan

● Timer1->OnTimer=Button1Click;
Untuk kembali ke proses yang ada di button1
2. Button2=”Stop”
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Timer1->Enabled=false;
}

Timer1->Enabled=false;

Untuk membuat proses perulangan pada Timer1 berhenti.

3. Button3=”Preview”
void __fastcall TForm1::Button3Click(TObject *Sender)
{
Image4->Picture=Image3->Picture;
Image3->Picture=Image2->Picture;
Image2->Picture=Image1->Picture;
Image1->Picture=Image4->Picture;
}

Membuat pertukaran dari image4 ke image3 ke image2 dan terus ke image1

4. Button4=”next”
void __fastcall TForm1::Button4Click(TObject *Sender)
{
Image1->Picture=Image2->Picture;
Image2->Picture=Image3->Picture;
Image3->Picture=Image4->Picture;
Image4->Picture=Image1->Picture;
}

Membuat pertukaran dari image1 ke image2 ke image3 dan terus ke image4

You might also like